@nifrajs/cli 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/check.d.ts +4 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +71 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +165 -23
- package/dist/cli.js.map +1 -1
- package/dist/doctor.d.ts +5 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +66 -6
- package/dist/doctor.js.map +1 -1
- package/dist/load.d.ts +11 -0
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +30 -0
- package/dist/load.js.map +1 -1
- package/dist/mcp-docs-tools.d.ts.map +1 -1
- package/dist/mcp-docs-tools.js +7 -3
- package/dist/mcp-docs-tools.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/mcp-render.js +9 -1
- package/dist/mcp-render.js.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +44 -2
- package/dist/mcp.js.map +1 -1
- package/dist/pipeline-guard.d.ts +83 -0
- package/dist/pipeline-guard.d.ts.map +1 -0
- package/dist/pipeline-guard.js +136 -0
- package/dist/pipeline-guard.js.map +1 -0
- package/dist/types-search.d.ts +1 -1
- package/dist/types-search.d.ts.map +1 -1
- package/dist/types-search.js +47 -2
- package/dist/types-search.js.map +1 -1
- package/docs/examples.json +6 -0
- package/docs/llms-full.txt +169 -35
- package/docs/types.json +1618 -45
- package/package.json +9 -9
- package/src/check.ts +91 -0
- package/src/cli.ts +173 -24
- package/src/doctor.ts +71 -6
- package/src/load.ts +44 -0
- package/src/mcp-docs-tools.ts +13 -3
- package/src/mcp-http.ts +1 -1
- package/src/mcp-render.ts +9 -1
- package/src/mcp.ts +45 -2
- package/src/pipeline-guard.ts +186 -0
- package/src/types-search.ts +50 -1
package/docs/types.json
CHANGED
|
@@ -303,6 +303,90 @@
|
|
|
303
303
|
"signature": "export declare function applyResponseHeaders(headers: Headers, res: NodeHeaderSink): void;",
|
|
304
304
|
"doc": "/**\n * Copy a Web `Response`'s headers onto a Node response, emitting EACH `Set-Cookie` as its own header. The\n * `Headers` iterator (and `.get`) join multiple set-cookie values with \", \", which corrupts cookies — e.g.\n * better-auth's `session_token` + `session_data` collapse into one unparseable cookie and the session is\n * silently lost. `getSetCookie()` returns them split; Node's `setHeader` emits one header per array element.\n */"
|
|
305
305
|
},
|
|
306
|
+
{
|
|
307
|
+
"name": "ApprovalBindingError",
|
|
308
|
+
"kind": "class",
|
|
309
|
+
"package": "@nifrajs/core",
|
|
310
|
+
"signature": "export declare class ApprovalBindingError extends Error {\n constructor();\n}"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "ApprovalConsumeResult",
|
|
314
|
+
"kind": "type",
|
|
315
|
+
"package": "@nifrajs/core",
|
|
316
|
+
"signature": "export type ApprovalConsumeResult = {\n readonly state: \"consumed\";\n} | {\n readonly state: \"missing\" | \"pending\" | \"denied\" | \"expired\" | \"replay\" | \"binding\" | \"token\";\n};"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "ApprovalCoordinator",
|
|
320
|
+
"kind": "interface",
|
|
321
|
+
"package": "@nifrajs/core",
|
|
322
|
+
"signature": "export interface ApprovalCoordinator extends CapabilityApprovalGate {\n decide(input: {\n readonly approvalId: string;\n readonly tenantId: string;\n readonly decision: \"approved\" | \"denied\";\n readonly decidedBy: string;\n }): Promise<void>;\n get(approvalId: string): Promise<ApprovalRecord | undefined>;\n}"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "ApprovalCoordinatorOptions",
|
|
326
|
+
"kind": "interface",
|
|
327
|
+
"package": "@nifrajs/core",
|
|
328
|
+
"signature": "export interface ApprovalCoordinatorOptions {\n readonly store: ApprovalStore;\n /** At least 32 random bytes, kept separately from the approval store. */\n readonly secret: Uint8Array;\n readonly ttlMs?: number;\n readonly now?: () => number;\n /** Tests/local development only. Production approval records require a durable store. */\n readonly allowMemoryStore?: boolean;\n}"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "ApprovalDeniedError",
|
|
332
|
+
"kind": "class",
|
|
333
|
+
"package": "@nifrajs/core",
|
|
334
|
+
"signature": "export declare class ApprovalDeniedError extends Error {\n constructor();\n}"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "ApprovalPendingError",
|
|
338
|
+
"kind": "class",
|
|
339
|
+
"package": "@nifrajs/core",
|
|
340
|
+
"signature": "export declare class ApprovalPendingError extends Error {\n constructor();\n}"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "ApprovalRecord",
|
|
344
|
+
"kind": "interface",
|
|
345
|
+
"package": "@nifrajs/core",
|
|
346
|
+
"signature": "export interface ApprovalRecord {\n readonly approvalId: string;\n readonly effectId: string;\n readonly capability: string;\n readonly target?: string;\n readonly digest?: string;\n readonly tenantId: string;\n readonly principalId: string;\n readonly tokenHash: string;\n readonly state: ApprovalState;\n readonly createdAt: number;\n readonly expiresAt: number;\n readonly updatedAt: number;\n readonly decidedBy?: string;\n readonly version: number;\n}"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "ApprovalRequiredError",
|
|
350
|
+
"kind": "class",
|
|
351
|
+
"package": "@nifrajs/core",
|
|
352
|
+
"signature": "export declare class ApprovalRequiredError extends Error {\n readonly approvalId: string;\n readonly effectId: string;\n readonly resumeToken: string;\n readonly expiresAt: number;\n constructor(approvalId: string, effectId: string, resumeToken: string, expiresAt: number);\n}"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "ApprovalState",
|
|
356
|
+
"kind": "type",
|
|
357
|
+
"package": "@nifrajs/core",
|
|
358
|
+
"signature": "export type ApprovalState = \"pending\" | \"approved\" | \"denied\" | \"consumed\" | \"expired\";"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "ApprovalStore",
|
|
362
|
+
"kind": "interface",
|
|
363
|
+
"package": "@nifrajs/core",
|
|
364
|
+
"signature": "export interface ApprovalStore {\n readonly durability?: \"memory\" | \"durable\";\n create(record: ApprovalRecord): boolean | Promise<boolean>;\n get(approvalId: string): ApprovalRecord | undefined | Promise<ApprovalRecord | undefined>;\n decide(input: {\n readonly approvalId: string;\n readonly tenantId: string;\n readonly decision: \"approved\" | \"denied\";\n readonly decidedBy: string;\n readonly now: number;\n }): boolean | Promise<boolean>;\n /**\n * Atomically validate binding/token/state and change `approved` to `consumed`. Two concurrent\n * callers with one token must yield exactly one `consumed` and one `replay` result.\n */\n consume(input: {\n readonly approvalId: string;\n readonly tenantId: string;\n readonly principalId: string;\n readonly capability: string;\n readonly target?: string;\n readonly digest?: string;\n readonly tokenHash: string;\n readonly now: number;\n }): ApprovalConsumeResult | Promise<ApprovalConsumeResult>;\n}"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "ApprovalTokenExpiredError",
|
|
368
|
+
"kind": "class",
|
|
369
|
+
"package": "@nifrajs/core",
|
|
370
|
+
"signature": "export declare class ApprovalTokenExpiredError extends Error {\n constructor();\n}"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "ApprovalTokenInvalidError",
|
|
374
|
+
"kind": "class",
|
|
375
|
+
"package": "@nifrajs/core",
|
|
376
|
+
"signature": "export declare class ApprovalTokenInvalidError extends Error {\n constructor();\n}"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "ApprovalTokenReplayError",
|
|
380
|
+
"kind": "class",
|
|
381
|
+
"package": "@nifrajs/core",
|
|
382
|
+
"signature": "export declare class ApprovalTokenReplayError extends Error {\n constructor();\n}"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"name": "AroundCapabilityOptions",
|
|
386
|
+
"kind": "interface",
|
|
387
|
+
"package": "@nifrajs/core",
|
|
388
|
+
"signature": "export interface AroundCapabilityOptions {\n /** Maximum admission time in milliseconds. Default 30_000. */\n readonly timeoutMs?: number;\n}"
|
|
389
|
+
},
|
|
306
390
|
{
|
|
307
391
|
"name": "assertAdapterCertification",
|
|
308
392
|
"kind": "function",
|
|
@@ -351,6 +435,13 @@
|
|
|
351
435
|
"signature": "export declare function assertSafeKey(key: string): void;",
|
|
352
436
|
"doc": "/** Throw {@link StorageKeyError} unless `key` is a safe relative storage key. */"
|
|
353
437
|
},
|
|
438
|
+
{
|
|
439
|
+
"name": "assertSingleReactCore",
|
|
440
|
+
"kind": "function",
|
|
441
|
+
"package": "@nifrajs/web-react",
|
|
442
|
+
"signature": "export declare function assertSingleReactCore(reactDomServerPath: string, resolve: ResolveSync, realpath?: (path: string) => string): void;",
|
|
443
|
+
"doc": "/**\n * The dual-React crash, caught on the RESOLVED graph instead of after it detonates.\n *\n * The re-root above makes `react-dom/server` load from the app root, which is right almost always. What it\n * cannot guarantee is that react-dom then pulls in the SAME physical `react` the route components import -\n * a nested `react` under react-dom, or a components tree resolving react elsewhere, still yields two cores.\n * Two cores is two hook dispatchers, and the renderer sees a null (or foreign) one: the SSR throws\n * `resolveDispatcher().useState is null` from deep inside react-dom-server, naming a React internal and\n * nothing about the two directories that actually caused it. That is hours of inference from a message\n * that points nowhere useful.\n *\n * `nifra doctor` checks what is INSTALLED; this checks what SSR actually RESOLVED, which is the only thing\n * that can catch a duplicate the two dev pipelines introduce (Bun for SSR, Vite for the client) rather\n * than the install. It compares the realpath of the `react` react-dom will render with against the\n * `react` the components import, and if they differ throws with BOTH paths - turning a five-hour hunt into\n * a five-second read. Silent when they agree, which is the single-copy common case.\n *\n * Never manufactures a failure: if either side cannot be resolved it returns, because a resolver that\n * cannot answer is not evidence of a duplicate. Exported for direct unit testing.\n */"
|
|
444
|
+
},
|
|
354
445
|
{
|
|
355
446
|
"name": "assertStorageAdapterConformance",
|
|
356
447
|
"kind": "function",
|
|
@@ -648,6 +739,12 @@
|
|
|
648
739
|
"package": "@nifrajs/middleware",
|
|
649
740
|
"signature": "export interface BearerOptions<P> {\n /** Verify a bearer token → a principal (truthy) or `null`/`undefined` (rejected). May be async\n * (DB/JWT lookup). For a constant-secret comparison, use a constant-time compare — never `===`. */\n readonly verify: (token: string) => MaybePromise<P | null | undefined>;\n /** When `true`, requests without a valid token pass through (`principal` is `null`) instead of `401`. */\n readonly optional?: boolean;\n /** `realm` for the `WWW-Authenticate: Bearer` header on `401`. Default `\"api\"`. */\n readonly realm?: string;\n}"
|
|
650
741
|
},
|
|
742
|
+
{
|
|
743
|
+
"name": "beginRequestEffectTracking",
|
|
744
|
+
"kind": "function",
|
|
745
|
+
"package": "@nifrajs/core",
|
|
746
|
+
"signature": "export declare function beginRequestEffectTracking(request: Request): EffectEvidenceScope;"
|
|
747
|
+
},
|
|
651
748
|
{
|
|
652
749
|
"name": "betterAuth",
|
|
653
750
|
"kind": "function",
|
|
@@ -747,7 +844,21 @@
|
|
|
747
844
|
"name": "BuildClientOptions",
|
|
748
845
|
"kind": "interface",
|
|
749
846
|
"package": "@nifrajs/web",
|
|
750
|
-
"signature": "export interface BuildClientOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the bundle + `manifest.json` (absolute path). */\n readonly outDir: string;\n /** The adapter's client runtime (exports `mountRouter`), e.g. `\"@nifrajs/web-solid/client\"`. */\n readonly clientModule: string;\n /** Route/layout file → import specifier (default: `${routesDir}/${file}`). */\n readonly resolve?: (file: string) => string;\n /** Adapter build plugins (e.g. `solidBunPlugin(\"dom\")`). */\n readonly plugins?: readonly BunPlugin[];\n /** `Bun.build` export conditions (e.g. `[\"bun\", \"solid\", \"browser\"]`). */\n readonly conditions?: readonly string[];\n /** Compile-time replacements (e.g. `{ \"process.env.NODE_ENV\": '\"production\"' }`). */\n readonly define?: Readonly<Record<string, string>>;\n /** Minify the output (default `true`). */\n readonly minify?: boolean;\n /** URL prefix the assets are served under (default `\"/assets/\"`); also Bun's chunk `publicPath`. */\n readonly publicPath?: string;\n /**\n * Prefix that opts an environment variable into the **client** bundle (Vite/Next convention; default\n * `\"PUBLIC_\"`). Every var in the build environment whose name starts with this prefix is baked into\n * the client `define` as `\"process.env.NAME\": JSON.stringify(value)`, so `process.env.PUBLIC_API_URL`\n * compiles to its literal value in the browser. Vars WITHOUT the prefix are never exposed — the bare\n * `process.env` define resolves them to `undefined`, so server secrets can't leak into the client\n * bundle. Set to `\"\"` to disable auto-exposure entirely (no var is baked in). `options.define` still\n * wins over an auto-exposed var (it's layered last). Sourced from `Bun.env` (falls back to\n * `process.env`) at build time. */\n readonly publicEnvPrefix?: string;\n}"
|
|
847
|
+
"signature": "export interface BuildClientOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the bundle + `manifest.json` (absolute path). */\n readonly outDir: string;\n /** The adapter's client runtime (exports `mountRouter`), e.g. `\"@nifrajs/web-solid/client\"`. */\n readonly clientModule: string;\n /** Route/layout file → import specifier (default: `${routesDir}/${file}`). */\n readonly resolve?: (file: string) => string;\n /** Adapter build plugins (e.g. `solidBunPlugin(\"dom\")`). */\n readonly plugins?: readonly BunPlugin[];\n /** `Bun.build` export conditions (e.g. `[\"bun\", \"solid\", \"browser\"]`). */\n readonly conditions?: readonly string[];\n /** Compile-time replacements (e.g. `{ \"process.env.NODE_ENV\": '\"production\"' }`). */\n readonly define?: Readonly<Record<string, string>>;\n /** Minify the output (default `true`). */\n readonly minify?: boolean;\n /** URL prefix the assets are served under (default `\"/assets/\"`); also Bun's chunk `publicPath`. */\n readonly publicPath?: string;\n /**\n * Directory of user-authored static files copied into the build and served at the root (default\n * `\"public\"`). Absent directory ⇒ nothing copied, no error.\n *\n * NOT the same thing as {@link publicPath}, despite the names: that is the URL prefix for\n * content-hashed bundle chunks and never covers files an author put on disk. The collision is a\n * real source of confusion, which is why both are spelled out here.\n */\n readonly publicDir?: string | false;\n /**\n * Prefix that opts an environment variable into the **client** bundle (Vite/Next convention; default\n * `\"PUBLIC_\"`). Every var in the build environment whose name starts with this prefix is baked into\n * the client `define` as `\"process.env.NAME\": JSON.stringify(value)`, so `process.env.PUBLIC_API_URL`\n * compiles to its literal value in the browser. Vars WITHOUT the prefix are never exposed — the bare\n * `process.env` define resolves them to `undefined`, so server secrets can't leak into the client\n * bundle. Set to `\"\"` to disable auto-exposure entirely (no var is baked in). `options.define` still\n * wins over an auto-exposed var (it's layered last). Sourced from `Bun.env` (falls back to\n * `process.env`) at build time. */\n readonly publicEnvPrefix?: string;\n}"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"name": "buildClientVite",
|
|
851
|
+
"kind": "function",
|
|
852
|
+
"package": "@nifrajs/web",
|
|
853
|
+
"signature": "export declare function buildClientVite(options: BuildClientViteOptions): Promise<BuildManifest>;",
|
|
854
|
+
"doc": "/**\n * Build the client bundle with Vite, emitting the SAME {@link BuildManifest} `buildClient` (Bun) does:\n * a content-hashed entry, per-route chunk lists, aggregate + per-route CSS, and copied `public/` files.\n *\n * The route→chunk and route→CSS mappings come from Vite's own `.vite/manifest.json` (`build.manifest`),\n * which records each entry's emitted `file` and its transitive `css` - exactly the two facts the Bun path\n * reconstructs from Bun's metafile. `viteLeakGuard()` runs during the build, so a client leak fails here\n * with the same error as the Bun build rather than shipping.\n */"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"name": "BuildClientViteOptions",
|
|
858
|
+
"kind": "interface",
|
|
859
|
+
"package": "@nifrajs/web",
|
|
860
|
+
"signature": "export interface BuildClientViteOptions extends Omit<BuildClientOptions, \"plugins\"> {\n /** Vite plugins for the app's client transforms (e.g. `react()`, `vue()`). */\n readonly vitePlugins?: readonly unknown[];\n /** Vite project root (default: the parent of `routesDir`). Manifest keys are relative to it. */\n readonly root?: string;\n}",
|
|
861
|
+
"doc": "/** Options for {@link buildClientVite} — the Bun {@link BuildClientOptions} minus Bun-plugin specifics,\n * plus the Vite plugin list the app injects for its transforms. */"
|
|
751
862
|
},
|
|
752
863
|
{
|
|
753
864
|
"name": "buildManifest",
|
|
@@ -760,8 +871,7 @@
|
|
|
760
871
|
"name": "BuildManifest",
|
|
761
872
|
"kind": "interface",
|
|
762
873
|
"package": "@nifrajs/web",
|
|
763
|
-
"signature": "export interface BuildManifest {\n /** URL of the client entry module (content-hashed). */\n readonly entry: string;\n /** URLs of every emitted asset (entry + chunks) — for serving + preloading. */\n readonly assets: readonly string[];\n /** `routeId → [layout chunk URLs…, own chunk URL]` — the chunks a route needs, for `createWebApp`'s\n * `routePreload` (`<link rel=\"modulepreload\">` the matched route alongside the entry). Each route +\n * layout is also a build entrypoint, so it gets a named chunk the bootstrap's lazy import dedupes to. */\n readonly routes: Readonly<Record<string, readonly string[]>>;\n /** The app's bundled, content-hashed stylesheet(s) — the bootstrap's **aggregate** CSS (every\n * `import './x.css'` reachable from the app). The complete stylesheet regardless of which file\n * imported the CSS; the always-safe fallback `createWebApp` links when a route has no per-route entry\n * in {@link routeStyles}. Omitted when the app imports no CSS. */\n readonly css?: readonly string[];\n /** `routeId → [chain CSS URLs]` — only the stylesheets the matched route's layout chain + own file\n * actually use (Bun emits a per-entrypoint CSS bundle per route/layout, with shared-component CSS\n * inlined into each consumer). `createWebApp` links these instead of the aggregate, so a page ships\n * only its own CSS. A route is omitted (→ aggregate fallback) when its `[name]` collides with another\n * route's basename (ambiguous CSS↔route) or the build emitted orphan shared-chunk CSS — correctness\n * over minimality. Absent entirely when the app imports no CSS. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n}"
|
|
764
|
-
"doc": "/** The built asset map — the server reads `entry` for the client script + serves `assets`. */"
|
|
874
|
+
"signature": "export interface BuildManifest {\n /** URL of the client entry module (content-hashed). */\n readonly entry: string;\n /** URLs of every emitted asset (entry + chunks) — for serving + preloading. */\n readonly assets: readonly string[];\n /** `routeId → [layout chunk URLs…, own chunk URL]` — the chunks a route needs, for `createWebApp`'s\n * `routePreload` (`<link rel=\"modulepreload\">` the matched route alongside the entry). Each route +\n * layout is also a build entrypoint, so it gets a named chunk the bootstrap's lazy import dedupes to. */\n readonly routes: Readonly<Record<string, readonly string[]>>;\n /** URL paths copied from `publicDir`, sorted. Lets the server entry serve them without scanning a\n * directory per request, and lets an adapter that needs a file list (CDN upload, platform static\n * assets) consume one. Omitted when there is no `public/`. */\n readonly publicFiles?: readonly string[];\n /** The app's bundled, content-hashed stylesheet(s) — the bootstrap's **aggregate** CSS (every\n * `import './x.css'` reachable from the app). The complete stylesheet regardless of which file\n * imported the CSS; the always-safe fallback `createWebApp` links when a route has no per-route entry\n * in {@link routeStyles}. Omitted when the app imports no CSS. */\n readonly css?: readonly string[];\n /** `routeId → [chain CSS URLs]` — only the stylesheets the matched route's layout chain + own file\n * actually use (Bun emits a per-entrypoint CSS bundle per route/layout, with shared-component CSS\n * inlined into each consumer). `createWebApp` links these instead of the aggregate, so a page ships\n * only its own CSS. A route is omitted (→ aggregate fallback) when its `[name]` collides with another\n * route's basename (ambiguous CSS↔route) or the build emitted orphan shared-chunk CSS — correctness\n * over minimality. Absent entirely when the app imports no CSS. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n}"
|
|
765
875
|
},
|
|
766
876
|
{
|
|
767
877
|
"name": "buildNifraManifest",
|
|
@@ -783,6 +893,20 @@
|
|
|
783
893
|
"signature": "export declare function buildOpenApiDocument(routes: readonly RouteLike[], options?: OpenApiOptions): Record<string, unknown>;",
|
|
784
894
|
"doc": "/**\n * Build an OpenAPI 3.1 document from a route list. Delegates to `@nifrajs/schema`'s `toOpenAPI`, so a\n * route validated with `t` (TypeBox) emits full field-level request/query/response schemas plus\n * `$ref`-reused `components.schemas`; a BYO Standard Schema (zod/valibot/arktype) exposes no portable\n * JSON-Schema form, so its body/response is omitted (supply it via `options.operations`). Path params,\n * wildcards, tags, security, and servers always emit. Exported so you can also generate the doc at\n * build time (write it to disk in CI) without booting the server.\n */"
|
|
785
895
|
},
|
|
896
|
+
{
|
|
897
|
+
"name": "BuildPipeline",
|
|
898
|
+
"kind": "type",
|
|
899
|
+
"package": "@nifrajs/cli",
|
|
900
|
+
"signature": "export type BuildPipeline = \"bun\" | \"vite\";",
|
|
901
|
+
"doc": "/** Which bundler a build runs on. */"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"name": "buildRouteManifest",
|
|
905
|
+
"kind": "function",
|
|
906
|
+
"package": "@nifrajs/web",
|
|
907
|
+
"signature": "export declare function buildRouteManifest(manifest: Manifest, options?: {\n readonly target?: string;\n readonly prerendered?: Readonly<Record<string, readonly string[]>>;\n /** Runtime capabilities supplied outside generated entries (for example an explicit `withISR`). */\n readonly capabilities?: readonly RouteCapability[];\n}): Promise<RouteManifest>;",
|
|
908
|
+
"doc": "/**\n * Build the route manifest for a discovered app, optionally resolved against a deploy target.\n *\n * `prerendered` maps a route id to the concrete paths the build actually emitted for it - pass what\n * `prerenderRoutes` produced. Without it, dynamic routes are reported by their declaration alone, which\n * is the right answer before a build has run and the wrong one after.\n */"
|
|
909
|
+
},
|
|
786
910
|
{
|
|
787
911
|
"name": "buildRouteTable",
|
|
788
912
|
"kind": "function",
|
|
@@ -803,12 +927,26 @@
|
|
|
803
927
|
"package": "@nifrajs/web",
|
|
804
928
|
"signature": "export interface BuildServerOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** The worker entry module (absolute path) — your `worker.ts`. It imports `{ manifest, clientEntry }`\n * from the generated `./server-manifest`, builds `createWebApp`, and `export default toFetchHandler(app)`. */\n readonly serverEntry: string;\n /** Output directory for the bundled worker (absolute path). */\n readonly outDir: string;\n /** The content-hashed client entry URL (from `buildClient`'s manifest) — **baked** into the generated\n * server manifest, since a disk-less worker can't read `manifest.json` at runtime. */\n readonly clientEntry: string;\n /** The app's aggregate stylesheet URLs (`buildClient`'s `BuildManifest.css`) — baked into the generated\n * manifest so the server entry hands them to `createWebApp` (→ `<link rel=\"stylesheet\">`). Omit ⇒ no CSS\n * link (the built SSR page would otherwise render unstyled). */\n readonly styles?: readonly string[] | undefined;\n /** Per-route stylesheet URLs (`buildClient`'s `BuildManifest.routeStyles`) — baked alongside `styles`. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>> | undefined;\n /** Route/layout file → import specifier in the generated manifest (default: a relative path from the\n * manifest's location — written next to `serverEntry` — to `routesDir`). */\n readonly resolve?: (file: string) => string;\n /** Filename for the generated server-manifest module, written next to `serverEntry` (default\n * `\"server-manifest.ts\"`); your `serverEntry` imports it as `./server-manifest`. */\n readonly manifestFile?: string;\n /** Adapter build plugins (e.g. `solidBunPlugin(\"ssr\")` — Solid routes need their SSR transform at\n * build time; React's JSX is Bun-native and needs none). */\n readonly plugins?: readonly BunPlugin[];\n /** `Bun.build` resolution conditions (default `[\"workerd\", \"edge-light\", \"browser\"]`) — selects each\n * dependency's edge build. */\n readonly conditions?: readonly string[];\n /** Compile-time replacements (default `{ \"process.env.NODE_ENV\": '\"production\"' }` → production\n * React/Solid on the edge). Pass an explicit object to override (e.g. `{}` to opt out). */\n readonly define?: Readonly<Record<string, string>>;\n /** Minify the output (default `true`). */\n readonly minify?: boolean;\n /** `Bun.build` target (default `\"browser\"` — the right shape for edge runtimes: Cloudflare Workers,\n * Vercel Edge, Deno, Deno Deploy). Use `\"node\"` for a `@nifrajs/node` server (so `node:*` built-ins\n * stay external), or `\"bun\"` for a Bun server. The default `conditions` + the edge resolve shims\n * only apply to the `\"browser\"` target; `\"node\"`/`\"bun\"` resolve their own renderer builds via the\n * matching condition. */\n readonly target?: \"browser\" | \"node\" | \"bun\";\n /** **Lazy/code-split routes** (default `false`): emit `() => import(route)` loaders + bundle with\n * `splitting`, so each route is its own chunk loaded on first request (smaller cold-start parse)\n * instead of all parsed at boot. The output becomes the worker entry **+ chunk files** in `outDir`\n * — on Cloudflare, ship them with wrangler's `no_bundle` + `find_additional_modules` + an ESModule\n * `rule` (Node/Deno import the chunks natively). Eager (one self-contained file) stays the default. */\n readonly lazy?: boolean;\n}"
|
|
805
929
|
},
|
|
930
|
+
{
|
|
931
|
+
"name": "buildServerVite",
|
|
932
|
+
"kind": "function",
|
|
933
|
+
"package": "@nifrajs/web",
|
|
934
|
+
"signature": "export declare function buildServerVite(options: BuildServerViteOptions): Promise<ServerBuild>;",
|
|
935
|
+
"doc": "/**\n * Build the SSR worker with Vite, emitting the SAME {@link ServerBuild} `buildServer` (Bun) does: a\n * self-contained worker bundle whose path is returned as `worker`.\n *\n * Like `buildServer`, it codegens the statically-analyzable `server-manifest` next to the entry (so no\n * `node:fs` route scan runs on a disk-less edge), then bundles. `ssr.noExternal` bundles the app + adapter\n * + `@nifrajs/*` into ONE file (the self-contained worker), while `node:` builtins stay external on the\n * `node`/`bun` targets that provide them. `NIFRA_SSR_BUNDLED` is defined so the web-react adapter uses the\n * bundled, deduped react-dom rather than re-rooting to a disk copy at runtime - the same tag `buildServer`\n * sets, and the reason a bundled SSR output does not hit the dual-React crash.\n *\n * The client-leak guards are deliberately NOT run here: a server bundle's `node:` imports are legitimate.\n */"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"name": "BuildServerViteOptions",
|
|
939
|
+
"kind": "interface",
|
|
940
|
+
"package": "@nifrajs/web",
|
|
941
|
+
"signature": "export interface BuildServerViteOptions {\n readonly routesDir: string;\n readonly serverEntry: string;\n readonly outDir: string;\n readonly clientEntry: string;\n readonly styles?: readonly string[] | undefined;\n readonly routeStyles?: Readonly<Record<string, readonly string[]>> | undefined;\n readonly resolve?: (file: string) => string;\n readonly manifestFile?: string;\n readonly vitePlugins?: readonly unknown[];\n readonly conditions?: readonly string[];\n readonly define?: Readonly<Record<string, string>>;\n readonly minify?: boolean;\n /** The runtime the worker targets — mirrors `buildServer`. `browser` = the edge (workerd/edge-light). */\n readonly target?: \"browser\" | \"node\" | \"bun\";\n /** Vite project root (default: the parent of `routesDir`). */\n readonly root?: string;\n}",
|
|
942
|
+
"doc": "/** Options for {@link buildServerVite} — the same surface as `buildServer` minus Bun-plugin specifics. */"
|
|
943
|
+
},
|
|
806
944
|
{
|
|
807
945
|
"name": "buildTarget",
|
|
808
946
|
"kind": "function",
|
|
809
947
|
"package": "@nifrajs/web",
|
|
810
948
|
"signature": "export declare function buildTarget(target: BuildTarget, options: BuildTargetOptions): Promise<BuildTargetResult>;",
|
|
811
|
-
"doc": "
|
|
949
|
+
"doc": "/** Build a full deploy dir for `target` using the default Bun bundler. See {@link buildTargetWith}. */"
|
|
812
950
|
},
|
|
813
951
|
{
|
|
814
952
|
"name": "BuildTarget",
|
|
@@ -820,7 +958,7 @@
|
|
|
820
958
|
"name": "BuildTargetOptions",
|
|
821
959
|
"kind": "interface",
|
|
822
960
|
"package": "@nifrajs/web",
|
|
823
|
-
"signature": "export interface BuildTargetOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the assembled deploy dir (absolute path). Cleared and recreated. */\n readonly outDir: string;\n /** A scratch directory for intermediate codegen (the generated server entry + manifest) and the\n * server bundle, cleaned up after. Absolute path. */\n readonly workDir: string;\n /** The adapter's client runtime module (exports `mountRouter`), e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `adapter`. */\n readonly adapterImport: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `backend`, or `undefined`. */\n readonly backendImport?: string;\n /** Factory that builds the app for `static` prerendering, GIVEN the client build's manifest — so the\n * emitted hydration `<script src>` uses the REAL content-hashed entry (`client.entry`) plus the same\n * styles/route-preload the server targets use. A pre-built instance can't work here: the hash isn't known\n * until `buildClient` runs inside `buildTarget`, so a hardcoded entry 404s → pages render but never\n * hydrate. Required for `target: \"static\"` (SSG drives `app.fetch`); ignored otherwise. */\n readonly prerenderApp?: (client: BuildManifest) => PrerenderAppLike | Promise<PrerenderAppLike>;\n /** Client-build plugins (e.g. the MDX/Vue/Solid Bun plugins). */\n readonly clientPlugins?: readonly BunPlugin[];\n /** Server-build plugins (e.g. the SSR variants). */\n readonly serverPlugins?: readonly BunPlugin[];\n /** Extra Bun.build resolve conditions for the CLIENT build. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements layered onto both builds. */\n readonly define?: Readonly<Record<string, string>>;\n /** Document `<title>` for the generated server entry. */\n readonly title?: string;\n}"
|
|
961
|
+
"signature": "export interface BuildTargetOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the assembled deploy dir (absolute path). Cleared and recreated. */\n readonly outDir: string;\n /** A scratch directory for intermediate codegen (the generated server entry + manifest) and the\n * server bundle, cleaned up after. Absolute path. */\n readonly workDir: string;\n /** The adapter's client runtime module (exports `mountRouter`), e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `adapter`. */\n readonly adapterImport: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `backend`, or `undefined`. */\n readonly backendImport?: string;\n /** Factory that builds the app for `static` prerendering, GIVEN the client build's manifest — so the\n * emitted hydration `<script src>` uses the REAL content-hashed entry (`client.entry`) plus the same\n * styles/route-preload the server targets use. A pre-built instance can't work here: the hash isn't known\n * until `buildClient` runs inside `buildTarget`, so a hardcoded entry 404s → pages render but never\n * hydrate. Required for `target: \"static\"` (SSG drives `app.fetch`); ignored otherwise. */\n readonly prerenderApp?: (client: BuildManifest) => PrerenderAppLike | Promise<PrerenderAppLike>;\n /** Client-build plugins (e.g. the MDX/Vue/Solid Bun plugins). */\n readonly clientPlugins?: readonly BunPlugin[];\n /** Server-build plugins (e.g. the SSR variants). */\n readonly serverPlugins?: readonly BunPlugin[];\n /** Extra Bun.build resolve conditions for the CLIENT build. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements layered onto both builds. */\n readonly define?: Readonly<Record<string, string>>;\n /** Project-root static directory copied to deploy root. `false` disables it. */\n readonly publicDir?: string | false;\n /** Prefix of environment variables allowed into the client bundle (default `\"PUBLIC_\"`). */\n readonly publicEnvPrefix?: string;\n /** Document `<title>` for the generated server entry. */\n readonly title?: string;\n}"
|
|
824
962
|
},
|
|
825
963
|
{
|
|
826
964
|
"name": "BuildTargetResult",
|
|
@@ -829,6 +967,34 @@
|
|
|
829
967
|
"signature": "export interface BuildTargetResult {\n /** The deploy target that was built. */\n readonly target: BuildTarget;\n /** The assembled output directory. */\n readonly outDir: string;\n /** The client build's manifest (entry URL, assets, per-route chunks/styles). */\n readonly client: BuildManifest;\n /** A human-readable note on how to run/deploy the output. */\n readonly run: string;\n /** Per-chunk size report over the emitted client (+ server) outputs. Always computed; the CLI prints\n * it only with `--report`. */\n readonly size: SizeReport;\n}",
|
|
830
968
|
"doc": "/** The result of a target build — the deploy dir + the client manifest + an optional size report. */"
|
|
831
969
|
},
|
|
970
|
+
{
|
|
971
|
+
"name": "buildTargetVite",
|
|
972
|
+
"kind": "function",
|
|
973
|
+
"package": "@nifrajs/web",
|
|
974
|
+
"signature": "export declare function buildTargetVite(target: BuildTarget, options: BuildTargetOptions): Promise<BuildTargetResult>;",
|
|
975
|
+
"doc": "/**\n * Build a full deploy dir for `target` using the Vite/Rollup pipeline - the escape hatch for apps that\n * need a Vite-only transform in production. Identical output shape to {@link import(\"./build.js\").buildTarget}\n * (same deploy dir, same server entry, same prerender + size report), because both delegate to the ONE\n * `buildTargetWith` orchestrator; only the two bundling steps differ.\n *\n * Pass the app's Vite plugins via `clientPlugins` / `serverPlugins` (the shared option names) - here they\n * are Vite plugins, not Bun plugins.\n */"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"name": "buildTargetWith",
|
|
979
|
+
"kind": "function",
|
|
980
|
+
"package": "@nifrajs/web",
|
|
981
|
+
"signature": "export declare function buildTargetWith(target: BuildTarget, options: BuildTargetOptions, bundler: Bundler): Promise<BuildTargetResult>;",
|
|
982
|
+
"doc": "/**\n * The bundler-agnostic deploy orchestrator: everything `buildTarget` does EXCEPT the two bundling steps,\n * which come from `bundler`. `buildTarget` passes {@link bunBundler}; `buildTargetVite`\n * (`@nifrajs/web/build-vite`) passes the Vite strategy. One orchestrator, so the deploy-dir shape,\n * server-entry codegen, prerender and size report are identical across pipelines.\n */"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"name": "bunBundler",
|
|
986
|
+
"kind": "const",
|
|
987
|
+
"package": "@nifrajs/web",
|
|
988
|
+
"signature": "export declare const bunBundler: Bundler;",
|
|
989
|
+
"doc": "/** The default (Bun) strategy — `buildClient`/`buildServer` from this module. */"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"name": "Bundler",
|
|
993
|
+
"kind": "interface",
|
|
994
|
+
"package": "@nifrajs/web",
|
|
995
|
+
"signature": "export interface Bundler {\n /** Build the client bundle → the shared {@link BuildManifest}. */\n buildClient(input: {\n readonly routesDir: string;\n readonly outDir: string;\n readonly clientModule: string;\n readonly plugins?: readonly unknown[];\n readonly conditions?: readonly string[];\n readonly define?: Readonly<Record<string, string>>;\n readonly publicDir?: string | false;\n readonly publicEnvPrefix?: string;\n /** Project root (Vite needs it; the Bun strategy ignores it). */\n readonly root?: string;\n }): Promise<BuildManifest>;\n /** Build the server worker → the shared {@link ServerBuild}. */\n buildServer(input: {\n readonly routesDir: string;\n readonly serverEntry: string;\n readonly outDir: string;\n readonly clientEntry: string;\n readonly target: \"browser\" | \"node\" | \"bun\";\n readonly plugins?: readonly unknown[];\n readonly define?: Readonly<Record<string, string>>;\n readonly root?: string;\n }): Promise<ServerBuild>;\n}",
|
|
996
|
+
"doc": "/**\n * A build-tool STRATEGY for {@link buildTargetWith} — the two bundling steps, and nothing else. Everything\n * around them (server-entry codegen, deploy assembly, prerender, size report) is bundler-agnostic and\n * lives in `buildTargetWith`, so a second bundler (Vite) is this interface, not a second orchestrator.\n *\n * Plugin lists are `readonly unknown[]` because a Bun plugin and a Vite plugin are different types; each\n * strategy casts to its own. `buildTargetWith` only forwards them.\n */"
|
|
997
|
+
},
|
|
832
998
|
{
|
|
833
999
|
"name": "bunImageBackend",
|
|
834
1000
|
"kind": "function",
|
|
@@ -836,6 +1002,13 @@
|
|
|
836
1002
|
"signature": "export declare function bunImageBackend(): ImageBackend;",
|
|
837
1003
|
"doc": "/**\n * {@link ImageBackend} backed by `Bun.Image` (libjpeg-turbo / libspng / libwebp, decoded off the main\n * thread). Requires the Bun runtime. The default backend of `createImageHandler`.\n */"
|
|
838
1004
|
},
|
|
1005
|
+
{
|
|
1006
|
+
"name": "BunMetafileLike",
|
|
1007
|
+
"kind": "interface",
|
|
1008
|
+
"package": "@nifrajs/web",
|
|
1009
|
+
"signature": "export interface BunMetafileLike {\n readonly inputs?: Readonly<Record<string, {\n readonly imports?: ReadonlyArray<{\n path?: string;\n original?: string;\n }>;\n }>>;\n readonly outputs?: Readonly<Record<string, {\n readonly entryPoint?: string;\n readonly inputs?: Readonly<Record<string, unknown>>;\n }>>;\n}",
|
|
1010
|
+
"doc": "/** The slice of Bun's metafile this seam consumes. Not yet in `@types/bun`; shape per the docs. */"
|
|
1011
|
+
},
|
|
839
1012
|
{
|
|
840
1013
|
"name": "bunResolverFn",
|
|
841
1014
|
"kind": "function",
|
|
@@ -981,6 +1154,25 @@
|
|
|
981
1154
|
"package": "@nifrajs/core",
|
|
982
1155
|
"signature": "export type CapabilityAccess = \"read\" | \"write\";"
|
|
983
1156
|
},
|
|
1157
|
+
{
|
|
1158
|
+
"name": "CapabilityAdmissionAbortedError",
|
|
1159
|
+
"kind": "class",
|
|
1160
|
+
"package": "@nifrajs/core",
|
|
1161
|
+
"signature": "export declare class CapabilityAdmissionAbortedError extends Error {\n readonly capability: string;\n readonly effectId: string;\n constructor(capability: string, effectId: string);\n}",
|
|
1162
|
+
"doc": "/** The request was cancelled while capability admission was pending. */"
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"name": "CapabilityApprovalGate",
|
|
1166
|
+
"kind": "interface",
|
|
1167
|
+
"package": "@nifrajs/core",
|
|
1168
|
+
"signature": "export interface CapabilityApprovalGate {\n authorize(input: {\n readonly effectId: string;\n readonly capability: string;\n readonly target?: string;\n readonly digest?: string;\n readonly identity: CapabilityExecutionIdentity;\n readonly resumeToken?: string;\n readonly signal: AbortSignal;\n }): void | PromiseLike<void>;\n}"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
"name": "CapabilityApprovalInput",
|
|
1172
|
+
"kind": "interface",
|
|
1173
|
+
"package": "@nifrajs/core",
|
|
1174
|
+
"signature": "export interface CapabilityApprovalInput extends CapabilityExecutionIdentity {\n /** Signed token returned by the approval coordinator after the first suspended attempt. */\n readonly resumeToken?: string;\n}"
|
|
1175
|
+
},
|
|
984
1176
|
{
|
|
985
1177
|
"name": "CapabilityAssuranceReport",
|
|
986
1178
|
"kind": "interface",
|
|
@@ -993,6 +1185,13 @@
|
|
|
993
1185
|
"package": "@nifrajs/core",
|
|
994
1186
|
"signature": "export interface CapabilityDefinition {\n readonly id: string;\n /** Domain state is subject to HTTP method semantics; operational writes (logs/metrics) are not. */\n readonly zone: CapabilityZone;\n readonly access: CapabilityAccess;\n /** Evidence required when this capability may execute. Default `none`. */\n readonly idempotency?: CapabilityIdempotency;\n}"
|
|
995
1187
|
},
|
|
1188
|
+
{
|
|
1189
|
+
"name": "CapabilityDeniedError",
|
|
1190
|
+
"kind": "class",
|
|
1191
|
+
"package": "@nifrajs/core",
|
|
1192
|
+
"signature": "export declare class CapabilityDeniedError extends Error {\n readonly capability: string;\n readonly effectId: string;\n constructor(capability: string, effectId: string);\n}",
|
|
1193
|
+
"doc": "/** A capability admission policy returned without calling `next()`. */"
|
|
1194
|
+
},
|
|
996
1195
|
{
|
|
997
1196
|
"name": "CapabilityEvidence",
|
|
998
1197
|
"kind": "interface",
|
|
@@ -1012,6 +1211,40 @@
|
|
|
1012
1211
|
"package": "@nifrajs/core",
|
|
1013
1212
|
"signature": "export interface CapabilityEvidenceSet {\n readonly routes: readonly RouteCapabilityEvidence[];\n}"
|
|
1014
1213
|
},
|
|
1214
|
+
{
|
|
1215
|
+
"name": "CapabilityExecutionContext",
|
|
1216
|
+
"kind": "interface",
|
|
1217
|
+
"package": "@nifrajs/core",
|
|
1218
|
+
"signature": "export interface CapabilityExecutionContext {\n readonly effectId: string;\n readonly signal: AbortSignal;\n}",
|
|
1219
|
+
"doc": "/** Context passed to the owned effect callback. Use the signal for cancellation-aware I/O. */"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"name": "CapabilityExecutionIdentity",
|
|
1223
|
+
"kind": "interface",
|
|
1224
|
+
"package": "@nifrajs/core",
|
|
1225
|
+
"signature": "export interface CapabilityExecutionIdentity {\n readonly tenantId: string;\n readonly principalId: string;\n}",
|
|
1226
|
+
"doc": "/** Server-owned identity binding for durable admission. Values are opaque tokens, never payloads. */"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"name": "CapabilityExecutionJournal",
|
|
1230
|
+
"kind": "interface",
|
|
1231
|
+
"package": "@nifrajs/core",
|
|
1232
|
+
"signature": "export interface CapabilityExecutionJournal {\n intent(input: {\n readonly effectId: string;\n readonly capability: string;\n readonly target?: string;\n readonly digest?: string;\n readonly identity?: CapabilityExecutionIdentity;\n }): void | PromiseLike<void>;\n executing(effectId: string): void | PromiseLike<void>;\n committed(effectId: string): void | PromiseLike<void>;\n failed(effectId: string, input: {\n readonly began: boolean;\n readonly errorCode: string;\n }): void | PromiseLike<void>;\n}",
|
|
1233
|
+
"doc": "/** Durable, token-only journal seam. Implementations must fail closed on transition failure. */"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"name": "CapabilityExecutionOptions",
|
|
1237
|
+
"kind": "interface",
|
|
1238
|
+
"package": "@nifrajs/core",
|
|
1239
|
+
"signature": "export interface CapabilityExecutionOptions extends UseCapabilityOptions {\n readonly approval?: CapabilityApprovalInput & {\n readonly gate: CapabilityApprovalGate;\n };\n readonly journal?: CapabilityExecutionJournal;\n}",
|
|
1240
|
+
"doc": "/** Durable controls consumed by `executeCapability`; none of these fields enter the effect ledger. */"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
"name": "CapabilityExecutor",
|
|
1244
|
+
"kind": "type",
|
|
1245
|
+
"package": "@nifrajs/core",
|
|
1246
|
+
"signature": "export type CapabilityExecutor<T> = (execution: CapabilityExecutionContext) => T | PromiseLike<T>;"
|
|
1247
|
+
},
|
|
1015
1248
|
{
|
|
1016
1249
|
"name": "CapabilityFinding",
|
|
1017
1250
|
"kind": "interface",
|
|
@@ -1028,7 +1261,7 @@
|
|
|
1028
1261
|
"name": "CapabilityGuard",
|
|
1029
1262
|
"kind": "interface",
|
|
1030
1263
|
"package": "@nifrajs/core",
|
|
1031
|
-
"signature": "export interface CapabilityGuard {\n readonly allowed: readonly string[];\n readonly method: string;\n readonly path: string;\n readonly onUse?: (event: CapabilityUseEvent) => void;\n}"
|
|
1264
|
+
"signature": "export interface CapabilityGuard {\n readonly allowed: readonly string[];\n readonly method: string;\n readonly path: string;\n readonly onUse?: (event: CapabilityUseEvent) => void;\n readonly trackEffect?: (context: object, committed: boolean) => void;\n readonly interceptors: readonly RegisteredCapabilityInterceptor[];\n readonly observers: readonly EffectLifecycleObserver[];\n}"
|
|
1032
1265
|
},
|
|
1033
1266
|
{
|
|
1034
1267
|
"name": "CapabilityIdempotency",
|
|
@@ -1048,6 +1281,47 @@
|
|
|
1048
1281
|
"package": "@nifrajs/cli",
|
|
1049
1282
|
"signature": "export interface CapabilityImportViolation {\n readonly method: string;\n readonly path: string;\n readonly module: string;\n readonly specifier: string;\n readonly reason: string;\n readonly chain: readonly string[];\n}"
|
|
1050
1283
|
},
|
|
1284
|
+
{
|
|
1285
|
+
"name": "CapabilityInterceptor",
|
|
1286
|
+
"kind": "type",
|
|
1287
|
+
"package": "@nifrajs/core",
|
|
1288
|
+
"signature": "export type CapabilityInterceptor = (event: CapabilityInterceptorEvent, next: CapabilityInterceptorNext) => void | PromiseLike<void>;"
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
"name": "CapabilityInterceptorEvent",
|
|
1292
|
+
"kind": "interface",
|
|
1293
|
+
"package": "@nifrajs/core",
|
|
1294
|
+
"signature": "export interface CapabilityInterceptorEvent extends CapabilityUseEvent {\n readonly effectId: string;\n readonly signal: AbortSignal;\n readonly target?: string;\n readonly cost?: EffectCost;\n readonly digest?: string;\n}",
|
|
1295
|
+
"doc": "/** Token-only metadata supplied to an asynchronous capability admission interceptor. */"
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"name": "CapabilityInterceptorNext",
|
|
1299
|
+
"kind": "type",
|
|
1300
|
+
"package": "@nifrajs/core",
|
|
1301
|
+
"signature": "export type CapabilityInterceptorNext = () => Promise<void>;",
|
|
1302
|
+
"doc": "/** Continue to the next admission policy. The owned effect runs only after the full chain admits. */"
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"name": "CapabilityInterceptorProtocolError",
|
|
1306
|
+
"kind": "class",
|
|
1307
|
+
"package": "@nifrajs/core",
|
|
1308
|
+
"signature": "export declare class CapabilityInterceptorProtocolError extends Error {\n readonly capability: string;\n readonly effectId: string;\n constructor(capability: string, effectId: string);\n}",
|
|
1309
|
+
"doc": "/** An interceptor called its one-shot `next()` continuation more than once. */"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"name": "CapabilityInterceptorTimeoutError",
|
|
1313
|
+
"kind": "class",
|
|
1314
|
+
"package": "@nifrajs/core",
|
|
1315
|
+
"signature": "export declare class CapabilityInterceptorTimeoutError extends Error {\n readonly capability: string;\n readonly effectId: string;\n readonly timeoutMs: number;\n constructor(capability: string, effectId: string, timeoutMs: number);\n}",
|
|
1316
|
+
"doc": "/** A capability admission policy exceeded its configured bound. */"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"name": "CapabilityJournalTransitionError",
|
|
1320
|
+
"kind": "class",
|
|
1321
|
+
"package": "@nifrajs/core",
|
|
1322
|
+
"signature": "export declare class CapabilityJournalTransitionError extends Error {\n readonly capability: string;\n readonly effectId: string;\n readonly transition: \"committed\";\n constructor(capability: string, effectId: string, transition: \"committed\");\n}",
|
|
1323
|
+
"doc": "/** The effect may have committed, but its durable terminal transition could not be recorded. */"
|
|
1324
|
+
},
|
|
1051
1325
|
{
|
|
1052
1326
|
"name": "CapabilityOutcomeOptions",
|
|
1053
1327
|
"kind": "interface",
|
|
@@ -1375,9 +1649,23 @@
|
|
|
1375
1649
|
"name": "CheckDiagnostic",
|
|
1376
1650
|
"kind": "interface",
|
|
1377
1651
|
"package": "@nifrajs/cli",
|
|
1378
|
-
"signature": "export interface CheckDiagnostic {\n readonly rule: \"typecheck\" | \"typed-client\" | \"untyped-client\" | \"server-only-import\" | \"response-route\" | \"undeclared-dependency\" | \"duplicate-install\" | \"server-manifest-drift\" | \"manifest-drift\" | \"capability-assurance\" | \"capability-config\" | \"check-config\";\n /** `error` fails the gate (a real contract break); `warning` is advisory — surfaced to the agent but\n * does NOT fail `nifra check`, for patterns that are sometimes intentional (a route returning a raw\n * `Response`, which silently drops the typed client to `data: never` but is valid for files/redirects). */\n readonly severity: \"error\" | \"warning\";\n readonly file?: string;\n readonly line?: number;\n readonly message: string;\n /** The canonical, rule-level fix — clean of the per-occurrence snippet, so an agent can apply it\n * directly. Set for the lint rules (they have one correct fix); omitted for `typecheck` (the fix is\n * specific to each type error). */\n readonly fix?: string;\n /** A richer, agent-oriented fix hint. Diffs are only emitted when the edit is mechanical and local;\n * ambiguous cases give concrete steps instead of pretending the checker can safely rewrite code. */\n readonly suggestion?: CheckSuggestion;\n /**\n * The import chain that pulls server-only code into the browser bundle, as display labels\n * `[routeFile, …as-written specifiers…, sink]`. Set only on `server-only-import`.\n *\n * #4.4: this is now the FULL **transitive** chain — a bounded import-resolution walk (`Bun.resolveSync`\n * from each file's dir, BFS the local module graph) follows `route → ../data → ../db → node:crypto`,\n * matching the build leak-guard's depth (`detectNodeBuiltinsInClient` in `@nifrajs/web/build`). A\n * length-2 chain (`[routeFile, specifier]`) means the route imports the sink directly. When a hop can't\n * be resolved precisely (a bare pkg, a tsconfig path alias), the walk degrades to the honest direct\n * edge rather than fabricating a deeper path — never a lie.\n */\n readonly chain?: readonly string[];\n}",
|
|
1652
|
+
"signature": "export interface CheckDiagnostic {\n readonly rule: \"typecheck\" | \"typed-client\" | \"untyped-client\" | \"server-only-import\" | \"removed-import\" | \"response-route\" | \"undeclared-dependency\" | \"duplicate-install\" | \"server-manifest-drift\" | \"manifest-drift\" | \"capability-assurance\" | \"capability-config\" | \"check-config\";\n /** `error` fails the gate (a real contract break); `warning` is advisory — surfaced to the agent but\n * does NOT fail `nifra check`, for patterns that are sometimes intentional (a route returning a raw\n * `Response`, which silently drops the typed client to `data: never` but is valid for files/redirects). */\n readonly severity: \"error\" | \"warning\";\n readonly file?: string;\n readonly line?: number;\n readonly message: string;\n /** The canonical, rule-level fix — clean of the per-occurrence snippet, so an agent can apply it\n * directly. Set for the lint rules (they have one correct fix); omitted for `typecheck` (the fix is\n * specific to each type error). */\n readonly fix?: string;\n /** A richer, agent-oriented fix hint. Diffs are only emitted when the edit is mechanical and local;\n * ambiguous cases give concrete steps instead of pretending the checker can safely rewrite code. */\n readonly suggestion?: CheckSuggestion;\n /**\n * The import chain that pulls server-only code into the browser bundle, as display labels\n * `[routeFile, …as-written specifiers…, sink]`. Set only on `server-only-import`.\n *\n * #4.4: this is now the FULL **transitive** chain — a bounded import-resolution walk (`Bun.resolveSync`\n * from each file's dir, BFS the local module graph) follows `route → ../data → ../db → node:crypto`,\n * matching the build leak-guard's depth (`detectNodeBuiltinsInClient` in `@nifrajs/web/build`). A\n * length-2 chain (`[routeFile, specifier]`) means the route imports the sink directly. When a hop can't\n * be resolved precisely (a bare pkg, a tsconfig path alias), the walk degrades to the honest direct\n * edge rather than fabricating a deeper path — never a lie.\n */\n readonly chain?: readonly string[];\n}",
|
|
1379
1653
|
"doc": "/** A single machine-readable check failure — the unit an agent (or CI) acts on. */"
|
|
1380
1654
|
},
|
|
1655
|
+
{
|
|
1656
|
+
"name": "checkPipelineSeparation",
|
|
1657
|
+
"kind": "function",
|
|
1658
|
+
"package": "@nifrajs/cli",
|
|
1659
|
+
"signature": "export declare function checkPipelineSeparation(slots: {\n readonly vitePlugins?: readonly unknown[];\n readonly clientPlugins?: readonly unknown[];\n readonly serverPlugins?: readonly unknown[];\n}): PipelineMismatch[];",
|
|
1660
|
+
"doc": "/** Check every slot of a resolved framework config. */"
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"name": "checkPipelineSlot",
|
|
1664
|
+
"kind": "function",
|
|
1665
|
+
"package": "@nifrajs/cli",
|
|
1666
|
+
"signature": "export declare function checkPipelineSlot(slot: PipelineSlot, plugins: readonly unknown[]): PipelineMismatch[];",
|
|
1667
|
+
"doc": "/**\n * Check one slot's resolved plugin list. Pure: takes the already-resolved array so a thunk-valued\n * field is awaited by the caller, and so this stays testable without loading a project.\n */"
|
|
1668
|
+
},
|
|
1381
1669
|
{
|
|
1382
1670
|
"name": "CheckResult",
|
|
1383
1671
|
"kind": "interface",
|
|
@@ -1391,6 +1679,13 @@
|
|
|
1391
1679
|
"package": "@nifrajs/cli",
|
|
1392
1680
|
"signature": "export interface CheckSuggestion {\n readonly kind: \"edit\" | \"command\" | \"manual\";\n readonly title: string;\n readonly diff?: string;\n /** argv array, not a shell string, so MCP clients can run it without quoting hazards. */\n readonly command?: readonly string[];\n readonly steps?: readonly string[];\n}"
|
|
1393
1681
|
},
|
|
1682
|
+
{
|
|
1683
|
+
"name": "chooseBuildPipeline",
|
|
1684
|
+
"kind": "function",
|
|
1685
|
+
"package": "@nifrajs/cli",
|
|
1686
|
+
"signature": "export declare function chooseBuildPipeline(slots: PipelineSlots, forced?: BuildPipeline): PipelineDecision;",
|
|
1687
|
+
"doc": "/**\n * Pick the bundler for `nifra build`, per app rather than per global default.\n *\n * The phase defaults are deliberately asymmetric - `nifra dev` is Vite (for the plugin ecosystem, and\n * because Bun's DEV-server bundler cannot compile CSS Modules), `nifra build` is Bun (faster and\n * Bun-native). For an app with no transforms that asymmetry is free: there is nothing to disagree about.\n * For an app whose ONLY transforms are Vite plugins it is not. Those plugins run in dev and are then\n * dropped by the Bun build - `buildForTarget` reads `clientPlugins`/`serverPlugins`, never `vitePlugins`\n * - so the build succeeds, the output looks plausible, and the transform simply did not happen. That is\n * the same failure {@link checkPipelineSeparation} exists to prevent, reached by crossing PHASES instead\n * of slots, and the slot check cannot see it because the plugins are correctly placed.\n *\n * So the default follows the app: Vite plugins with no Bun counterpart means the app has exactly one\n * pipeline that can build it, and that is the one used. An app declaring BOTH has supplied the Bun\n * equivalent on purpose - nothing is dropped - so the fast Bun default stands.\n *\n * `forced` is `--vite` / `--bun` and always wins, except for the one combination that silently discards\n * work, which throws instead. Refusing rather than warning matches the slot guard: a build that succeeds\n * and omits the transform is worse than one that stops and says so.\n */"
|
|
1688
|
+
},
|
|
1394
1689
|
{
|
|
1395
1690
|
"name": "ChunkSize",
|
|
1396
1691
|
"kind": "interface",
|
|
@@ -1438,6 +1733,13 @@
|
|
|
1438
1733
|
"signature": "export declare function client<App>(baseUrl: string, options?: ClientOptions): Treaty<App>;",
|
|
1439
1734
|
"doc": "/**\n * Create an end-to-end-typed client for a nifra server. Two modes:\n *\n * // coupled — typed from the server's type (`typeof app`)\n * const api = client<typeof app>(\"http://localhost:3000\")\n *\n * // decoupled — typed from a contract VALUE, no server import\n * const api = client(contract, \"https://api.example.com\")\n *\n * const { data, error } = await api.users({ id: \"1\" }).get()\n *\n * Both return the same Eden-style proxy. Browser-safe: uses only `fetch` /\n * `Proxy` / `URL`, never the server runtime. Never throws — network and non-2xx\n * responses surface as a `Result` `error`.\n */"
|
|
1440
1735
|
},
|
|
1736
|
+
{
|
|
1737
|
+
"name": "CLIENT_ENTRY_PATH",
|
|
1738
|
+
"kind": "const",
|
|
1739
|
+
"package": "@nifrajs/web",
|
|
1740
|
+
"signature": "export declare const CLIENT_ENTRY_PATH = \"/__nifra/client.js\";",
|
|
1741
|
+
"doc": "/**\n * The stable URL every SSR'd page points its client entry at.\n *\n * It has to be stable, and Bun's own URL is not: that one is a content hash over the entire client graph,\n * so it changes whenever anything the entry imports changes. This path redirects to whichever hashed\n * chunk Bun is serving at the moment the browser asks, which is the only formulation that stays correct\n * across a rebuild.\n */"
|
|
1742
|
+
},
|
|
1441
1743
|
{
|
|
1442
1744
|
"name": "clientCall",
|
|
1443
1745
|
"kind": "function",
|
|
@@ -1452,11 +1754,18 @@
|
|
|
1452
1754
|
"signature": "export type ClientIpTrust = {\n readonly trustedHops: number;\n} | {\n readonly header: string;\n};",
|
|
1453
1755
|
"doc": "/**\n * How much of the forwarding chain to trust when deriving `c.clientIp`. Omit for the safe default\n * (socket peer only, no header believed).\n *\n * - `{ trustedHops: n }` - trust `n` reverse-proxy hops in front of the app. The caller is taken from\n * `X-Forwarded-For` counted from the right past the `n` trusted hops (the socket peer is hop 0). Use\n * this when the app sits behind `n` proxies **you operate**. Fewer entries than trusted hops means\n * the header is too short to trust, so `c.clientIp` is `undefined` (fail closed).\n * - `{ header: name }` - trust a single named header's first value (e.g. a CDN that overwrites it at\n * the edge). Only declare this when the app is reachable **exclusively** through that edge; a\n * directly-reachable app lets any client forge the header.\n */"
|
|
1454
1756
|
},
|
|
1757
|
+
{
|
|
1758
|
+
"name": "ClientModuleGraph",
|
|
1759
|
+
"kind": "interface",
|
|
1760
|
+
"package": "@nifrajs/web",
|
|
1761
|
+
"signature": "export interface ClientModuleGraph {\n /** Module id → its imports. Ids are bundler-native (Bun graph keys, Rollup module ids). */\n readonly modules: Readonly<Record<string, GraphModule>>;\n /** Output path → what it contains. */\n readonly chunks: Readonly<Record<string, GraphChunk>>;\n}",
|
|
1762
|
+
"doc": "/** What a client build looks like to the guards, whichever bundler produced it. */"
|
|
1763
|
+
},
|
|
1455
1764
|
{
|
|
1456
1765
|
"name": "ClientOptions",
|
|
1457
1766
|
"kind": "interface",
|
|
1458
1767
|
"package": "@nifrajs/client",
|
|
1459
|
-
"signature": "export interface ClientOptions {\n /** Headers sent on every request (a per-call `headers` option is merged on top). */\n readonly headers?: Record<string, string>;\n /** Override the `fetch` implementation (tests, an in-process bridge, a custom agent, etc.). */\n readonly fetch?: FetchFn;\n /**\n * Runs before each request (including each retry). Return a header map to MERGE onto the outgoing\n * request — the place to inject a fresh auth token. `await`ed, so async token refresh works.\n */\n readonly onRequest?: (request: {\n readonly url: string;\n readonly method: string;\n readonly headers: Record<string, string>;\n readonly body: unknown;\n }) => MaybePromise<Record<string, string> | undefined>;\n /** Runs after a response arrives (once per call, on the final response). Observe-only. */\n readonly onResponse?: (response: {\n readonly url: string;\n readonly method: string;\n readonly response: Response;\n }) => MaybePromise<void>;\n /** Abort a call that takes longer than this many ms. Surfaces as `{ ok: false, status: 0 }` with a\n * `timeout` error, never a throw. Combined with a per-call `signal`. */\n readonly timeoutMs?: number;\n /** Enable safe automatic retries. See {@link ClientRetryOptions}. */\n readonly retry?: ClientRetryOptions;\n}"
|
|
1768
|
+
"signature": "export interface ClientOptions {\n /** Headers sent on every request (a per-call `headers` option is merged on top). */\n readonly headers?: Record<string, string>;\n /** Override the `fetch` implementation (tests, an in-process bridge, a custom agent, etc.). */\n readonly fetch?: FetchFn;\n /**\n * Runs before each request (including each retry). Return a header map to MERGE onto the outgoing\n * request — the place to inject a fresh auth token. `await`ed, so async token refresh works.\n */\n readonly onRequest?: (request: {\n readonly url: string;\n readonly method: string;\n readonly headers: Record<string, string>;\n readonly body: unknown;\n }) => MaybePromise<Record<string, string> | undefined>;\n /** Runs after a response arrives (once per call, on the final response). Observe-only. */\n readonly onResponse?: (response: {\n readonly url: string;\n readonly method: string;\n readonly response: Response;\n }) => MaybePromise<void>;\n /** Abort a call that takes longer than this many ms. Surfaces as `{ ok: false, status: 0 }` with a\n * `timeout` error, never a throw. Combined with a per-call `signal`. */\n readonly timeoutMs?: number;\n /** Enable safe automatic retries. See {@link ClientRetryOptions}. */\n readonly retry?: ClientRetryOptions;\n /**\n * Opt into a versioned transport representation. Plain JSON remains the default. Responses are\n * decoded through the bounded registry, and WebSocket frames use the same codec.\n */\n readonly transport?: {\n readonly codec: TransportCodec;\n readonly registry?: TransportCodecRegistry;\n readonly maxBytes?: number;\n };\n}"
|
|
1460
1769
|
},
|
|
1461
1770
|
{
|
|
1462
1771
|
"name": "ClientRetryOptions",
|
|
@@ -1476,7 +1785,7 @@
|
|
|
1476
1785
|
"name": "ClientRouterOptions",
|
|
1477
1786
|
"kind": "interface",
|
|
1478
1787
|
"package": "@nifrajs/web",
|
|
1479
|
-
"signature": "export interface ClientRouterOptions {\n readonly patterns: readonly RoutePattern[];\n readonly initial: RouterState;\n /** Override the loader-data fetch (tests inject a stub; defaults to a same-origin JSON GET). */\n readonly fetchData?: FetchRouteData;\n /** Ensure a route's code chunk is loaded before rendering (code-splitting). Awaited in parallel\n * with the loader data, so `pending` covers both. Omit when the bundle isn't split. */\n readonly loadModule?: (routeId: string) => Promise<void>;\n}"
|
|
1788
|
+
"signature": "export interface ClientRouterOptions {\n readonly patterns: readonly RoutePattern[];\n readonly initial: RouterState;\n /** Override the loader-data fetch (tests inject a stub; defaults to a same-origin JSON GET). */\n readonly fetchData?: FetchRouteData;\n /** Ensure a route's code chunk is loaded before rendering (code-splitting). Awaited in parallel\n * with the loader data, so `pending` covers both. Omit when the bundle isn't split. */\n readonly loadModule?: (routeId: string) => Promise<void>;\n /** Terminal status → client route id. Generated entries populate this from `_404` and\n * `_<status>` files so soft navigation renders the same boundary as a hard request. */\n readonly statusRoutes?: Readonly<Record<number, string>>;\n}"
|
|
1480
1789
|
},
|
|
1481
1790
|
{
|
|
1482
1791
|
"name": "cloudflareLoader",
|
|
@@ -1511,6 +1820,19 @@
|
|
|
1511
1820
|
"package": "@nifrajs/web",
|
|
1512
1821
|
"signature": "export interface CloudflarePagesRoutesOptions {\n /** Prerendered request paths (e.g. `prerenderRoutes(...).prerendered.map(p => p.path)`, or the\n * build's `prerendered.json`). Each is excluded from the worker — plus its static `_data.json`. */\n readonly prerendered: readonly string[];\n /** Extra globs to keep OFF the worker (CDN-served). Default `[\"/assets/*\"]` (the hashed bundle). */\n readonly staticGlobs?: readonly string[];\n}"
|
|
1513
1822
|
},
|
|
1823
|
+
{
|
|
1824
|
+
"name": "cloudflareRouteRules",
|
|
1825
|
+
"kind": "function",
|
|
1826
|
+
"package": "@nifrajs/web",
|
|
1827
|
+
"signature": "export declare function cloudflareRouteRules(publicFiles: readonly string[], \n/**\n * Every route pattern the app serves. Required, not defaulted: an empty list means \"this app serves\n * no routes\", which makes every directory collapsible - a defensible answer to state deliberately and\n * a dangerous one to arrive at by forgetting the argument.\n */\nroutePatterns: readonly string[]): CloudflareRouteRules;",
|
|
1828
|
+
"doc": "/**\n * Build the cf-pages `_routes.json` rules for a set of copied public files, within Cloudflare's budget.\n *\n * `exclude` is what Pages serves straight from the CDN instead of invoking the worker, so naming every\n * public file is ideal - and impossible past ~99 of them. A `public/` of icons, fonts and share images\n * clears 100 easily, and the rejection lands at `wrangler pages deploy`, long after the build reported\n * success.\n *\n * A glob is emitted only where it cannot be wrong. `/assets/*` always is: the build owns that prefix\n * outright, since it is where the hashed bundle is written. A `public/` subdirectory is different - the\n * name is the author's, and a `/blog/*` rule would hand Pages every future path under `/blog/`, so a\n * `/blog/:slug` route would 404 from the CDN in production only. {@link collapsibleDirs} therefore\n * collapses a directory only after checking it against the app's real route patterns, which is what\n * makes the compaction safe rather than merely smaller. Everything else stays an exact path, and a name\n * containing `*` is dropped rather than escaped, since the rule would become a wildcard.\n *\n * What still does not fit is dropped, which is safe because the list is only an optimization: the\n * generated worker serves any allowlisted path it receives through the ASSETS binding, so an omitted\n * file costs one worker invocation, not a 404.\n */"
|
|
1829
|
+
},
|
|
1830
|
+
{
|
|
1831
|
+
"name": "CloudflareRouteRules",
|
|
1832
|
+
"kind": "interface",
|
|
1833
|
+
"package": "@nifrajs/web",
|
|
1834
|
+
"signature": "export interface CloudflareRouteRules {\n readonly include: readonly string[];\n readonly exclude: readonly string[];\n /** Public files the budget could not name, so the build can say so instead of capping silently. */\n readonly omitted: readonly string[];\n}"
|
|
1835
|
+
},
|
|
1514
1836
|
{
|
|
1515
1837
|
"name": "codePositionMask",
|
|
1516
1838
|
"kind": "function",
|
|
@@ -1550,7 +1872,7 @@
|
|
|
1550
1872
|
"kind": "function",
|
|
1551
1873
|
"package": "@nifrajs/cli",
|
|
1552
1874
|
"signature": "export declare function collectDuplicateInstalls(cwd: string, rootPackage: Record<string, unknown>): Promise<DuplicateInstallFinding[]>;",
|
|
1553
|
-
"doc": "/** Find identity-sensitive dependencies that resolve to multiple physical directories. Two copies at\n * the same version still fail: module identity (React hooks, Nifra symbols/registries) is path-based. */"
|
|
1875
|
+
"doc": "/** Find identity-sensitive dependencies that resolve to multiple physical directories. Two copies at\n * the same version still fail: module identity (React hooks, Nifra symbols/registries) is path-based.\n *\n * `cwd` is where the user ran the check; the scan is anchored at the workspace root above it (see\n * {@link findWorkspaceRoot}) so sibling packages are probed, while paths are still REPORTED relative\n * to `cwd` so the findings read the way the user's terminal does. */"
|
|
1554
1876
|
},
|
|
1555
1877
|
{
|
|
1556
1878
|
"name": "CollectLevelsOptions",
|
|
@@ -1600,12 +1922,19 @@
|
|
|
1600
1922
|
"signature": "export declare const commonSecretPatterns: ReadonlyArray<RegExp>;",
|
|
1601
1923
|
"doc": "/**\n * A conservative, high-signal set of patterns for {@link RedactOptions.valuePatterns} — opt in by\n * passing it (or a subset) to `jsonLogger`/`redactLogFields`. Covers bearer tokens, JWTs, emails, and a\n * few well-known key formats (Stripe, GitHub, AWS access-key ids). Chosen to minimize false positives;\n * add your own (e.g. internal id formats) as needed. Every pattern is global so all matches are scrubbed.\n */"
|
|
1602
1924
|
},
|
|
1925
|
+
{
|
|
1926
|
+
"name": "compareMixedPartsSpecificity",
|
|
1927
|
+
"kind": "function",
|
|
1928
|
+
"package": "@nifrajs/core",
|
|
1929
|
+
"signature": "export declare function compareMixedPartsSpecificity(left: readonly MixedPart[], right: readonly MixedPart[]): number;",
|
|
1930
|
+
"doc": "/**\n * Total ordering for mixed segment shapes, shared by the trie and regex-based routers.\n *\n * Code-unit comparison, never `localeCompare`: this exists so the server and the browser agree on which\n * of two equally-weighted patterns wins, and `localeCompare` answers by the RUNTIME's locale - a server\n * and a visitor in different locales would order the same pair differently, which is the divergence\n * being prevented.\n */"
|
|
1931
|
+
},
|
|
1603
1932
|
{
|
|
1604
1933
|
"name": "compareRoutePatternSpecificity",
|
|
1605
1934
|
"kind": "function",
|
|
1606
1935
|
"package": "@nifrajs/core",
|
|
1607
1936
|
"signature": "export declare function compareRoutePatternSpecificity(left: CompiledRoutePattern, right: CompiledRoutePattern): number;",
|
|
1608
|
-
"doc": "/** Core precedence: static > param > wildcard at the first differing segment, independent of order. */"
|
|
1937
|
+
"doc": "/** Core precedence: static > mixed > param > wildcard at the first differing segment, independent of\n * registration order. */"
|
|
1609
1938
|
},
|
|
1610
1939
|
{
|
|
1611
1940
|
"name": "CompiledRoutePattern",
|
|
@@ -1929,6 +2258,13 @@
|
|
|
1929
2258
|
"signature": "export interface CookieOptions {\n /** Lifetime in seconds. `0` (with a past `expires`) deletes the cookie. */\n readonly maxAge?: number;\n readonly expires?: Date;\n readonly path?: string;\n readonly domain?: string;\n readonly secure?: boolean;\n readonly httpOnly?: boolean;\n readonly sameSite?: \"strict\" | \"lax\" | \"none\";\n readonly partitioned?: boolean;\n}",
|
|
1930
2259
|
"doc": "/** Attributes for a `Set-Cookie`. `expires` is a `Date`; `maxAge` is in **seconds**. */"
|
|
1931
2260
|
},
|
|
2261
|
+
{
|
|
2262
|
+
"name": "copyPublicDir",
|
|
2263
|
+
"kind": "function",
|
|
2264
|
+
"package": "@nifrajs/web",
|
|
2265
|
+
"signature": "export declare function copyPublicDir(from: string, to: string): Promise<string[]>;",
|
|
2266
|
+
"doc": "/**\n * Copy `from` into `to`, returning the URL paths copied (sorted).\n *\n * Lives here, not beside `servePublicDir`, because it is BUILD-time: it reaches for `Bun.Glob` and\n * `node:fs`, and `public-dir.ts` is reachable from the client bundle graph through the package\n * entry - a dynamic `import(\"bun\")` there fails the browser build outright.\n */"
|
|
2267
|
+
},
|
|
1932
2268
|
{
|
|
1933
2269
|
"name": "cors",
|
|
1934
2270
|
"kind": "function",
|
|
@@ -1962,6 +2298,12 @@
|
|
|
1962
2298
|
"signature": "export declare function createAdmissionController(options: AdmissionOptions): AdmissionControllerHandle;",
|
|
1963
2299
|
"doc": "/**\n * Build a capacity-admission controller. Pass the returned handle as the server's `admission` option.\n */"
|
|
1964
2300
|
},
|
|
2301
|
+
{
|
|
2302
|
+
"name": "createApprovalCoordinator",
|
|
2303
|
+
"kind": "function",
|
|
2304
|
+
"package": "@nifrajs/core",
|
|
2305
|
+
"signature": "export declare function createApprovalCoordinator(options: ApprovalCoordinatorOptions): ApprovalCoordinator;"
|
|
2306
|
+
},
|
|
1965
2307
|
{
|
|
1966
2308
|
"name": "createBunWsHandlers",
|
|
1967
2309
|
"kind": "function",
|
|
@@ -1987,7 +2329,7 @@
|
|
|
1987
2329
|
"name": "createCapabilityGuard",
|
|
1988
2330
|
"kind": "function",
|
|
1989
2331
|
"package": "@nifrajs/core",
|
|
1990
|
-
"signature": "export declare function createCapabilityGuard(allowed: readonly string[], method: string, path: string, onUse: ((event: CapabilityUseEvent) => void) | undefined): CapabilityGuard;"
|
|
2332
|
+
"signature": "export declare function createCapabilityGuard(allowed: readonly string[], method: string, path: string, onUse: ((event: CapabilityUseEvent) => void) | undefined, trackEffect: ((context: object, committed: boolean) => void) | undefined, interceptors: readonly RegisteredCapabilityInterceptor[], observers: readonly EffectLifecycleObserver[]): CapabilityGuard;"
|
|
1991
2333
|
},
|
|
1992
2334
|
{
|
|
1993
2335
|
"name": "createClientRouter",
|
|
@@ -2007,7 +2349,26 @@
|
|
|
2007
2349
|
"kind": "function",
|
|
2008
2350
|
"package": "@nifrajs/web",
|
|
2009
2351
|
"signature": "export declare function createDevServer(options: DevServerOptions): Promise<DevServer>;",
|
|
2010
|
-
"doc": "/** Start the dev server:
|
|
2352
|
+
"doc": "/** Start the Bun dev server: generate → bundle → serve → watch → hot-reload on change. */"
|
|
2353
|
+
},
|
|
2354
|
+
{
|
|
2355
|
+
"name": "createDurableEffectJournal",
|
|
2356
|
+
"kind": "function",
|
|
2357
|
+
"package": "@nifrajs/core",
|
|
2358
|
+
"signature": "export declare function createDurableEffectJournal(options: DurableEffectJournalOptions): CapabilityExecutionJournal;"
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
"name": "createDurableExecutionAdapter",
|
|
2362
|
+
"kind": "function",
|
|
2363
|
+
"package": "@nifrajs/core",
|
|
2364
|
+
"signature": "export declare function createDurableExecutionAdapter(backend: DurableRecordBackend): DurableExecutionAdapter;"
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
"name": "createEffectEvidenceScope",
|
|
2368
|
+
"kind": "function",
|
|
2369
|
+
"package": "@nifrajs/core",
|
|
2370
|
+
"signature": "export declare function createEffectEvidenceScope(): EffectEvidenceScope;",
|
|
2371
|
+
"doc": "/** Lightweight aggregate evidence shared by request idempotency and full owned-effect runners. */"
|
|
2011
2372
|
},
|
|
2012
2373
|
{
|
|
2013
2374
|
"name": "createEffectLedgerRuntime",
|
|
@@ -2016,6 +2377,12 @@
|
|
|
2016
2377
|
"signature": "export declare function createEffectLedgerRuntime(options: EffectLedgerOptions): EffectLedgerRuntime;",
|
|
2017
2378
|
"doc": "/**\n * Build an effect-ledger runtime from the app-wide options. `sink` receives the sealed, token-only\n * ledger when a capability-declaring route settles with recorded entries; `maxEntries` bounds a single\n * request's ledger; `chain` opts into the per-entry hash chain.\n */"
|
|
2018
2379
|
},
|
|
2380
|
+
{
|
|
2381
|
+
"name": "createEffectScope",
|
|
2382
|
+
"kind": "function",
|
|
2383
|
+
"package": "@nifrajs/core",
|
|
2384
|
+
"signature": "export declare function createEffectScope(options?: EffectScopeOptions, evidenceScope?: EffectEvidenceScope): EffectScope;"
|
|
2385
|
+
},
|
|
2019
2386
|
{
|
|
2020
2387
|
"name": "createEventLoopLagSampler",
|
|
2021
2388
|
"kind": "function",
|
|
@@ -2192,6 +2559,12 @@
|
|
|
2192
2559
|
"package": "@nifrajs/core",
|
|
2193
2560
|
"signature": "export interface CreateRequestLedgerOptions {\n /** HTTP method of the matched route. */\n readonly method: string;\n /** The registered route pattern — callers must never pass the concrete request URL. */\n readonly path: string;\n /** The route's declared capability tokens, surfaced verbatim on the sealed ledger. Default `[]`. */\n readonly declared?: readonly string[];\n /** Entry bound; exceeding it throws {@link EffectLedgerOverflowError}. Default {@link DEFAULT_MAX_ENTRIES}. */\n readonly maxEntries?: number;\n /** Compute the tamper-evident hash chain at seal. Default false. */\n readonly chain?: boolean;\n /** Injectable monotonic clock (ms) for deterministic tests. Default `performance.now`. */\n readonly clock?: () => number;\n}"
|
|
2194
2561
|
},
|
|
2562
|
+
{
|
|
2563
|
+
"name": "createSagaEngine",
|
|
2564
|
+
"kind": "function",
|
|
2565
|
+
"package": "@nifrajs/core",
|
|
2566
|
+
"signature": "export declare function createSagaEngine(options: SagaEngineOptions): SagaEngine;"
|
|
2567
|
+
},
|
|
2195
2568
|
{
|
|
2196
2569
|
"name": "createScheduler",
|
|
2197
2570
|
"kind": "function",
|
|
@@ -2212,6 +2585,12 @@
|
|
|
2212
2585
|
"signature": "export declare function createStylesheetEmitter(build: PluginBuilder, namespace: string): StylesheetEmitter;",
|
|
2213
2586
|
"doc": "/**\n * Wire the virtual-CSS-module handlers onto `build` for `namespace`, returning an {@link StylesheetEmitter}.\n * The `namespace` must be a plain identifier (letters/`-`); it's used verbatim as the import suffix and\n * the Bun namespace. Only the `\"dom\"` build should emit CSS — the `\"ssr\"` build ships no stylesheet.\n */"
|
|
2214
2587
|
},
|
|
2588
|
+
{
|
|
2589
|
+
"name": "createTransportCodecRegistry",
|
|
2590
|
+
"kind": "function",
|
|
2591
|
+
"package": "@nifrajs/core",
|
|
2592
|
+
"signature": "export declare function createTransportCodecRegistry(codecs: readonly TransportCodec[], fallback?: TransportCodec): TransportCodecRegistry;"
|
|
2593
|
+
},
|
|
2215
2594
|
{
|
|
2216
2595
|
"name": "createUnboundedRequestBudget",
|
|
2217
2596
|
"kind": "function",
|
|
@@ -2237,7 +2616,7 @@
|
|
|
2237
2616
|
"name": "CreateWebAppOptions",
|
|
2238
2617
|
"kind": "interface",
|
|
2239
2618
|
"package": "@nifrajs/web",
|
|
2240
|
-
"signature": "export interface CreateWebAppOptions {\n readonly adapter: RenderAdapter;\n readonly manifest: Manifest;\n /** URL of the built client entry (module script) injected into every page. */\n readonly clientEntry: string;\n /** Default document title for all pages. */\n readonly title?: string;\n /** Injected into each loader's `ctx.api` — typically an `inProcessClient(app)` (typed\n * per-route via `@nifrajs/client`'s `createRoutes`). Opaque to the core.\n *\n * **Auto-mount.** Every `inProcessClient(backend)` exposes the symbol-keyed platform-aware backend\n * mount interface from `@nifrajs/core/mount`; `createWebApp` also serves that backend over HTTP at\n * {@link apiPrefix} (default `/api`): a request whose pathname starts with the prefix is dispatched\n * before page routing with the same `env`/`waitUntil` platform context, and the backend's `Response`\n * is returned untouched. The mount runs in `nifra dev` too. Pass `apiPrefix: \"\"` to disable it. */\n readonly api?: unknown;\n /** HTTP path prefix the {@link api} backend is auto-mounted at (default `\"/api\"`). A request whose\n * pathname is exactly the prefix or starts with `prefix + \"/\"` is dispatched to the backend before\n * page routing; the backend therefore defines its routes at the **full** path (`server().post(\"/api/\n * sync\", …)`), matching the in-process `inProcessClient` call sites. Set to `\"\"` to disable the\n * auto-mount entirely (the app serves pages only and `api` stays a loader-only `ctx.api`). Mounting\n * is also a no-op when `api` does not expose the symbol mount. */\n readonly apiPrefix?: string;\n /** Secret for **draft / preview mode** (see `enableDraft`). When set, a request carrying a valid\n * signed `__nifra_draft` cookie gets `ctx.draft === true` in loaders/actions (else always `false`).\n * Pair with `withISR({ draftSecret })` so editors bypass the cache. Omit to disable draft mode. */\n readonly draftSecret?: string;\n /** Per-route chunk URLs (`buildClient`'s `BuildManifest.routes`) — `routeId → [layout chunks…, own\n * chunk]`. When present, each page `modulepreload`s its matched route's chunks alongside the entry,\n * so the route code downloads in parallel (no entry→route-chunk waterfall). Omit ⇒ entry-only. */\n readonly routePreload?: Readonly<Record<string, readonly string[]>>;\n /** The app's bundled stylesheet URLs (`buildClient`'s `BuildManifest.css`) — the aggregate, injected\n * as `<link rel=\"stylesheet\">` in a page's `<head>`. Used as the fallback for any route absent from\n * {@link routeStyles}. Omit ⇒ no links (dev, where Vite injects CSS, or a CSS-free app). */\n readonly styles?: readonly string[];\n /** Per-route stylesheet URLs (`buildClient`'s `BuildManifest.routeStyles`) — `routeId → [chain CSS]`.\n * When a matched route has an entry here, only those (its layout chain + own CSS) are linked instead\n * of the aggregate `styles`, so a page ships only the CSS it uses. An empty array ⇒ no `<link>` (the\n * page imports no CSS). Routes absent here fall back to `styles`. Omit ⇒ always use `styles`. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n /** SSG: the prerendered-path set (e.g. `enumerateStaticRoutes(routes).paths` or the build's\n * `prerendered.json`). Injected as `window.__NIFRA_PRERENDERED__` on every page so a client soft-nav\n * into a prerendered route fetches its static `_data.json` instead of hitting the worker. */\n readonly prerenderedPaths?: readonly string[];\n /** SSG: per dynamic route pattern, its `getStaticPaths` `fallback` (from `enumerateStaticRoutes` or\n * the build's `prerendered.json`). A route mapped to `\"404\"` rejects any path NOT in\n * `prerenderedPaths` with the 404 page — the unlisted path simply doesn't exist. `\"ssr\"` (the\n * default for unmapped routes) renders unlisted paths on-demand. */\n readonly staticFallbacks?: Readonly<Record<string, \"ssr\" | \"404\">>;\n /** Observe every loader/action failure — for error-reporting plugins (Sentry-style). Called for\n * real throws (not control-flow `Response`s like `redirect`), **before** the nearest `_error`\n * boundary renders / a soft-nav 500 / a rethrow — so it sees errors that the boundary would\n * otherwise hide. Observation only; its own throws are swallowed so a faulty reporter can't break\n * rendering. (`beforeLoader` is intentionally omitted — the core HTTP hooks already cover\n * pre-request work.) */\n readonly onLoaderError?: (error: unknown, ctx: {\n readonly request: Request;\n readonly params: Readonly<Record<string, string>>;\n readonly route: string;\n }) => void;\n}"
|
|
2619
|
+
"signature": "export interface CreateWebAppOptions {\n readonly adapter: RenderAdapter;\n readonly manifest: Manifest;\n /** URL of the built client entry (module script) injected into every page. */\n readonly clientEntry: string;\n /** Default document title for all pages. */\n readonly title?: string;\n /** Injected into each loader's `ctx.api` — typically an `inProcessClient(app)` (typed\n * per-route via `@nifrajs/client`'s `createRoutes`). Opaque to the core.\n *\n * **Auto-mount.** Every `inProcessClient(backend)` exposes the symbol-keyed platform-aware backend\n * mount interface from `@nifrajs/core/mount`; `createWebApp` also serves that backend over HTTP at\n * {@link apiPrefix} (default `/api`): a request whose pathname starts with the prefix is dispatched\n * before page routing with the same `env`/`waitUntil` platform context, and the backend's `Response`\n * is returned untouched. The mount runs in `nifra dev` too. Pass `apiPrefix: \"\"` to disable it. */\n readonly api?: unknown;\n /** HTTP path prefix the {@link api} backend is auto-mounted at (default `\"/api\"`). A request whose\n * pathname is exactly the prefix or starts with `prefix + \"/\"` is dispatched to the backend before\n * page routing; the backend therefore defines its routes at the **full** path (`server().post(\"/api/\n * sync\", …)`), matching the in-process `inProcessClient` call sites. Set to `\"\"` to disable the\n * auto-mount entirely (the app serves pages only and `api` stays a loader-only `ctx.api`). Mounting\n * is also a no-op when `api` does not expose the symbol mount. */\n readonly apiPrefix?: string;\n /**\n * Strip {@link apiPrefix} from the pathname before dispatching to `api` (default `false`).\n *\n * The default suits a backend that declares FULL paths (`server().post(\"/api/sync\", …)`), which is\n * right when it is only ever mounted here. Set this when the backend declares its routes WITHOUT the\n * prefix because it also runs standalone behind its own shell, so its paths cannot carry a prefix that\n * only exists when it is mounted. Without it every request 404s inside the backend, and the workaround\n * is a `Proxy` that rewrites each URL.\n */\n readonly apiStrip?: boolean;\n /**\n * Sub-apps mounted ahead of page routing - an auth handler, a webhook receiver, a stack's routes.\n *\n * Structural on purpose: anything with `{ path, app: { fetch } }` fits, so a library that exposes its\n * routes as such a list mounts as `mounts: theirRoutes` without `@nifrajs/web` taking a dependency on\n * it. `better-auth` is the motivating case - it is not a `backend` route, so `/api/auth/*` used to 404\n * silently.\n *\n * Tried longest-path-first and BEFORE the `api` mount, so a mount at `/api/auth` wins over a backend\n * at `/api` no matter which was declared first. `stripPrefix` is the per-mount form of {@link apiStrip}:\n * leave it off to pass the full path through.\n */\n readonly mounts?: ReadonlyArray<{\n readonly path: string;\n readonly app: {\n fetch(request: Request): Response | Promise<Response>;\n };\n readonly stripPrefix?: boolean;\n }>;\n /** Secret for **draft / preview mode** (see `enableDraft`). When set, a request carrying a valid\n * signed `__nifra_draft` cookie gets `ctx.draft === true` in loaders/actions (else always `false`).\n * Pair with `withISR({ draftSecret })` so editors bypass the cache. Omit to disable draft mode. */\n readonly draftSecret?: string;\n /** Per-route chunk URLs (`buildClient`'s `BuildManifest.routes`) — `routeId → [layout chunks…, own\n * chunk]`. When present, each page `modulepreload`s its matched route's chunks alongside the entry,\n * so the route code downloads in parallel (no entry→route-chunk waterfall). Omit ⇒ entry-only. */\n readonly routePreload?: Readonly<Record<string, readonly string[]>>;\n /** The app's bundled stylesheet URLs (`buildClient`'s `BuildManifest.css`) — the aggregate, injected\n * as `<link rel=\"stylesheet\">` in a page's `<head>`. Used as the fallback for any route absent from\n * {@link routeStyles}. Omit ⇒ no links (dev, where Vite injects CSS, or a CSS-free app). */\n readonly styles?: readonly string[];\n /** Per-route stylesheet URLs (`buildClient`'s `BuildManifest.routeStyles`) — `routeId → [chain CSS]`.\n * When a matched route has an entry here, only those (its layout chain + own CSS) are linked instead\n * of the aggregate `styles`, so a page ships only the CSS it uses. An empty array ⇒ no `<link>` (the\n * page imports no CSS). Routes absent here fall back to `styles`. Omit ⇒ always use `styles`. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n /** SSG: the prerendered-path set (e.g. `enumerateStaticRoutes(routes).paths` or the build's\n * `prerendered.json`). Injected as `window.__NIFRA_PRERENDERED__` on every page so a client soft-nav\n * into a prerendered route fetches its static `_data.json` instead of hitting the worker. */\n readonly prerenderedPaths?: readonly string[];\n /** SSG: per dynamic route pattern, its `getStaticPaths` `fallback` (from `enumerateStaticRoutes` or\n * the build's `prerendered.json`). A route mapped to `\"404\"` rejects any path NOT in\n * `prerenderedPaths` with the 404 page — the unlisted path simply doesn't exist. `\"ssr\"` (the\n * default for unmapped routes) renders unlisted paths on-demand. */\n readonly staticFallbacks?: Readonly<Record<string, \"ssr\" | \"404\">>;\n /** Observe every loader/action failure — for error-reporting plugins (Sentry-style). Called for\n * real throws (not control-flow `Response`s like `redirect`), **before** the nearest `_error`\n * boundary renders / a soft-nav 500 / a rethrow — so it sees errors that the boundary would\n * otherwise hide. Observation only; its own throws are swallowed so a faulty reporter can't break\n * rendering. (`beforeLoader` is intentionally omitted — the core HTTP hooks already cover\n * pre-request work.) */\n readonly onLoaderError?: (error: unknown, ctx: {\n readonly request: Request;\n readonly params: Readonly<Record<string, string>>;\n readonly route: string;\n }) => void;\n}"
|
|
2241
2620
|
},
|
|
2242
2621
|
{
|
|
2243
2622
|
"name": "CronError",
|
|
@@ -2416,6 +2795,13 @@
|
|
|
2416
2795
|
"signature": "export declare function declaredCapabilities(context: object): readonly string[];",
|
|
2417
2796
|
"doc": "/**\n * Read the route's token-only declaration for admission plugins. This intentionally exposes neither\n * the request nor runtime evidence; it is the stable public seam for private entitlement policy.\n */"
|
|
2418
2797
|
},
|
|
2798
|
+
{
|
|
2799
|
+
"name": "decode",
|
|
2800
|
+
"kind": "function",
|
|
2801
|
+
"package": "@nifrajs/core",
|
|
2802
|
+
"signature": "export declare function decode(wire: Wire, limits?: WireDecodeLimits): unknown;",
|
|
2803
|
+
"doc": "/** Reconstruct the original value from a {@link Wire} form produced by {@link encode}. */"
|
|
2804
|
+
},
|
|
2419
2805
|
{
|
|
2420
2806
|
"name": "decodeBase64",
|
|
2421
2807
|
"kind": "function",
|
|
@@ -2443,12 +2829,30 @@
|
|
|
2443
2829
|
"signature": "export declare function decodeRouteParams(raw: Record<string, string>): Record<string, string> | null;",
|
|
2444
2830
|
"doc": "/** Decode router captures under one rule. Plain values take the zero-allocation path; malformed\n * escapes return `null`, allowing HTTP to emit 400 while client navigation declines the match. */"
|
|
2445
2831
|
},
|
|
2832
|
+
{
|
|
2833
|
+
"name": "decodeTransportFrame",
|
|
2834
|
+
"kind": "function",
|
|
2835
|
+
"package": "@nifrajs/core",
|
|
2836
|
+
"signature": "export declare function decodeTransportFrame(frame: string, registry?: TransportCodecRegistry, options?: TransportDecodeOptions): unknown;"
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
"name": "decodeTransportResponse",
|
|
2840
|
+
"kind": "function",
|
|
2841
|
+
"package": "@nifrajs/core",
|
|
2842
|
+
"signature": "export declare function decodeTransportResponse(response: Response, registry?: TransportCodecRegistry, options?: TransportDecodeOptions): Promise<unknown>;"
|
|
2843
|
+
},
|
|
2446
2844
|
{
|
|
2447
2845
|
"name": "DEFAULT_ASSURANCE_CONFIG",
|
|
2448
2846
|
"kind": "const",
|
|
2449
2847
|
"package": "@nifrajs/cli",
|
|
2450
2848
|
"signature": "export declare const DEFAULT_ASSURANCE_CONFIG = \"nifra.assurance.ts\";"
|
|
2451
2849
|
},
|
|
2850
|
+
{
|
|
2851
|
+
"name": "DEFAULT_CAPABILITY_INTERCEPTOR_TIMEOUT_MS",
|
|
2852
|
+
"kind": "const",
|
|
2853
|
+
"package": "@nifrajs/core",
|
|
2854
|
+
"signature": "export declare const DEFAULT_CAPABILITY_INTERCEPTOR_TIMEOUT_MS = 30000;"
|
|
2855
|
+
},
|
|
2452
2856
|
{
|
|
2453
2857
|
"name": "DEFAULT_DEV_PORT",
|
|
2454
2858
|
"kind": "const",
|
|
@@ -2489,6 +2893,18 @@
|
|
|
2489
2893
|
"package": "@nifrajs/cli",
|
|
2490
2894
|
"signature": "export declare const DEFAULT_SNAPSHOT_FILE = \"api-snapshot.json\";"
|
|
2491
2895
|
},
|
|
2896
|
+
{
|
|
2897
|
+
"name": "DEFAULT_WIRE_DECODE_LIMITS",
|
|
2898
|
+
"kind": "const",
|
|
2899
|
+
"package": "@nifrajs/core",
|
|
2900
|
+
"signature": "export declare const DEFAULT_WIRE_DECODE_LIMITS: Readonly<Required<WireDecodeLimits>>;"
|
|
2901
|
+
},
|
|
2902
|
+
{
|
|
2903
|
+
"name": "defaultTransportCodecs",
|
|
2904
|
+
"kind": "const",
|
|
2905
|
+
"package": "@nifrajs/core",
|
|
2906
|
+
"signature": "export declare const defaultTransportCodecs: TransportCodecRegistry;"
|
|
2907
|
+
},
|
|
2492
2908
|
{
|
|
2493
2909
|
"name": "defer",
|
|
2494
2910
|
"kind": "function",
|
|
@@ -2617,6 +3033,12 @@
|
|
|
2617
3033
|
"signature": "export declare const defineRouterPlugin: typeof defineIdentityPlugin;",
|
|
2618
3034
|
"doc": "/**\n * Alias of {@link defineIdentityPlugin} with a name that says what it's FOR: a plugin that **mounts\n * routes/hooks but adds no context type** (an auth router, an audit logger). Use this - not\n * {@link definePlugin} - for any such plugin, or the typed client silently collapses to `any`. The\n * \"identity\" in {@link defineIdentityPlugin} refers to the type-identity it preserves; `defineRouterPlugin`\n * is the same thing under a clearer name.\n *\n * Mount routes as a **side effect**, then return the app unchanged (registering via `.get`/`.post` would\n * change the type away from the identity `S`; the mounted routes run but aren't in the caller's typed\n * registry - that's the trade that keeps everything else typed):\n *\n * ```ts\n * export const scim = defineRouterPlugin(\"scim\", (app) => {\n * app.get(\"/scim/v2/Users\", listUsers) // side effect: mounted at runtime\n * return app // return S unchanged → routes added after .use(scim) stay typed\n * })\n * const api = server().get(\"/a\", h).use(scim).get(\"/b\", h) // /a AND /b stay typed\n * ```\n */"
|
|
2619
3035
|
},
|
|
3036
|
+
{
|
|
3037
|
+
"name": "defineSaga",
|
|
3038
|
+
"kind": "function",
|
|
3039
|
+
"package": "@nifrajs/core",
|
|
3040
|
+
"signature": "export declare function defineSaga<I, C extends Record<string, unknown>>(definition: SagaDefinition<I, C>): SagaDefinition<I, C>;"
|
|
3041
|
+
},
|
|
2620
3042
|
{
|
|
2621
3043
|
"name": "DehydratedState",
|
|
2622
3044
|
"kind": "interface",
|
|
@@ -2637,6 +3059,13 @@
|
|
|
2637
3059
|
"package": "@nifrajs/cli",
|
|
2638
3060
|
"signature": "export interface DependencyMoveChange {\n readonly file: string;\n readonly field: string;\n readonly from: string;\n readonly to: string;\n readonly fromVersion: string;\n readonly toVersion: string;\n readonly action: \"renamed\" | \"removed\";\n}"
|
|
2639
3061
|
},
|
|
3062
|
+
{
|
|
3063
|
+
"name": "deriveRouteEntry",
|
|
3064
|
+
"kind": "function",
|
|
3065
|
+
"package": "@nifrajs/web",
|
|
3066
|
+
"signature": "export declare function deriveRouteEntry(id: string, pattern: string, module: Pick<RouteModule, \"prerender\" | \"getStaticPaths\" | \"revalidate\" | \"hydrate\">, prerenderedPaths?: readonly string[]): RouteManifestEntry;",
|
|
3067
|
+
"doc": "/**\n * Derive one route's behaviour from its module exports.\n *\n * `prerender`/`getStaticPaths` win over `revalidate`: a page rendered at build time is not revalidated at\n * runtime, so if a route declares both, the build-time answer is the one that describes what ships. That\n * combination is worth surfacing rather than silently resolving, which is what `conflicts` is for once a\n * target is known.\n */"
|
|
3068
|
+
},
|
|
2640
3069
|
{
|
|
2641
3070
|
"name": "describeProject",
|
|
2642
3071
|
"kind": "function",
|
|
@@ -2683,27 +3112,55 @@
|
|
|
2683
3112
|
"name": "detectNodeBuiltinsInClient",
|
|
2684
3113
|
"kind": "function",
|
|
2685
3114
|
"package": "@nifrajs/web",
|
|
2686
|
-
"signature": "export declare function detectNodeBuiltinsInClient(
|
|
3115
|
+
"signature": "export declare function detectNodeBuiltinsInClient(graph: ClientModuleGraph): ReadonlyArray<NodeBuiltinFinding>;",
|
|
2687
3116
|
"doc": "/**\n * Scan a build's metafile for any `node:` builtin that a USER module pulled into a CLIENT output\n * chunk, returning a sorted, deduped list of {@link NodeBuiltinFinding}s. Three graph facts combine so\n * the report is precise AND actionable:\n * 1. **What the user wrote** — only builtins imported by a NON-`node:` input count, so Bun's own\n * polyfill chain (`node:crypto` → `node:buffer`/`node:stream`/…) doesn't bury the real cause.\n * 2. **Where it landed** — the chunk is read from the per-output `inputs`, so the error names the\n * emitted file to look at.\n * 3. **How it got there** — the shortest import chain from a user entry to the builtin\n * (`shortestBuiltinChain`), so the error points straight at the offending `import` line instead of\n * leaving the dev to grep the dependency tree (the DX gap this closes).\n * Graph-based (never the emitted text), so it survives minification and can't be fooled by a string\n * literal that merely contains `\"node:crypto\"`. Pure + exported for unit testing. Empty ⇒ clean.\n */"
|
|
2688
3117
|
},
|
|
2689
3118
|
{
|
|
2690
3119
|
"name": "detectServerOnlyInClient",
|
|
2691
3120
|
"kind": "function",
|
|
2692
3121
|
"package": "@nifrajs/web",
|
|
2693
|
-
"signature": "export declare function detectServerOnlyInClient(
|
|
3122
|
+
"signature": "export declare function detectServerOnlyInClient(graph: ClientModuleGraph): ReadonlyArray<ServerOnlyFinding>;",
|
|
2694
3123
|
"doc": "/**\n * Scan a build's metafile for any module that opts into the `server-only` marker (a side-effect\n * `import \"@nifrajs/web/server-only\"`) yet landed in a CLIENT output chunk, returning a sorted, deduped\n * list of {@link ServerOnlyFinding}s. Mirrors {@link detectNodeBuiltinsInClient}: it reads the SAME\n * graph facts — which inputs import the marker (the \"marked\" modules), which chunk each landed in (the\n * per-output `inputs`), and the shortest import chain from a user entry to it. The marker module ITSELF\n * (which imports nothing) is excluded — only the modules that *opt in* are flagged. Pure + exported for\n * unit testing. Empty ⇒ clean.\n */"
|
|
2695
3124
|
},
|
|
3125
|
+
{
|
|
3126
|
+
"name": "DevEntryMatch",
|
|
3127
|
+
"kind": "interface",
|
|
3128
|
+
"package": "@nifrajs/web",
|
|
3129
|
+
"signature": "export interface DevEntryMatch {\n readonly src: string;\n /**\n * Stylesheet URLs Bun extracted from the entry's CSS imports.\n *\n * These are not a nicety. Bun's bundler pulls `import \"./app.css\"` out of the JS graph and links it\n * from the HTML *it* bundled - the throwaway probe page, which nobody ever sees. nifra renders the real\n * pages, so unless these are carried across, a Bun-pipeline dev session serves every page unstyled\n * while the production build (which reads CSS from the build manifest) is fine. That is the worst\n * possible shape for a bug: dev-only, silent, and looks like the app's own CSS is broken.\n */\n readonly styles: readonly string[];\n readonly via: DevEntryVia;\n}",
|
|
3130
|
+
"doc": "/** A located client entry: the URL to hand nifra, its stylesheets, and which signal found it. */"
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
"name": "devEntryNotFoundMessage",
|
|
3134
|
+
"kind": "function",
|
|
3135
|
+
"package": "@nifrajs/web",
|
|
3136
|
+
"signature": "export declare function devEntryNotFoundMessage(probeUrl: string, html: string): string;",
|
|
3137
|
+
"doc": "/** The error thrown when Bun's dev server serves a page nothing in it can be recognised as the entry. */"
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
"name": "DevEntryVia",
|
|
3141
|
+
"kind": "type",
|
|
3142
|
+
"package": "@nifrajs/web",
|
|
3143
|
+
"signature": "export type DevEntryVia = \"marker\" | \"single-bun-script\";",
|
|
3144
|
+
"doc": "/** How the entry URL was found - reported so a fallback hit is visible rather than silent. */"
|
|
3145
|
+
},
|
|
3146
|
+
{
|
|
3147
|
+
"name": "devHtml",
|
|
3148
|
+
"kind": "function",
|
|
3149
|
+
"package": "@nifrajs/web",
|
|
3150
|
+
"signature": "export declare function devHtml(entryHref: string): string;",
|
|
3151
|
+
"doc": "/**\n * The throwaway HTML document. Its only job is to make Bun bundle the entry and assign it a URL - it is\n * never shown to a user, so it carries no app markup. The `<div id=\"root\">` is there purely so the\n * document stands on its own if someone opens the probe path directly while debugging.\n */"
|
|
3152
|
+
},
|
|
2696
3153
|
{
|
|
2697
3154
|
"name": "DevServer",
|
|
2698
3155
|
"kind": "interface",
|
|
2699
3156
|
"package": "@nifrajs/web",
|
|
2700
|
-
"signature": "export interface DevServer {\n readonly port: number;\n stop(): void;\n}"
|
|
3157
|
+
"signature": "export interface DevServer {\n readonly port: number;\n /**\n * The URL pages point their client entry at — always {@link CLIENT_ENTRY_PATH}, never Bun's hashed\n * chunk. Deliberately not the underlying chunk URL: that one moves on every rebuild, and anything\n * holding onto it is holding onto a URL that will stop working.\n */\n readonly clientEntry: string;\n stop(): void;\n}"
|
|
2701
3158
|
},
|
|
2702
3159
|
{
|
|
2703
3160
|
"name": "DevServerOptions",
|
|
2704
3161
|
"kind": "interface",
|
|
2705
3162
|
"package": "@nifrajs/web",
|
|
2706
|
-
"signature": "export interface DevServerOptions extends Omit<BuildClientOptions, \"minify\"> {\n /**\n * Build the nifra app for the
|
|
3163
|
+
"signature": "export interface DevServerOptions extends Omit<BuildClientOptions, \"minify\"> {\n /**\n * Build the nifra app for the current client entry. `importQuery` changes on every reload — pass it to\n * `discoverRoutes(routesDir, { importQuery })` so SSR re-imports edited route modules instead of Bun's\n * cached copies.\n */\n readonly createApp: (clientEntry: string, importQuery: string) => FetchApp | Promise<FetchApp>;\n /** Directories to watch (default: `[routesDir]`). */\n readonly watch?: readonly string[];\n /** Port to listen on (default {@link DEFAULT_DEV_PORT}). */\n readonly port?: number;\n /** Directory of user-authored static files served at the root (default `\"public\"`). The SAME\n * option the production build copies and serves, so dev and prod cannot drift. */\n readonly publicDir?: string | false;\n /**\n * Run the client-leak guards on each change (default `true`).\n *\n * `buildClient` is what runs them - server-only code reaching the browser, `node:` builtins in client\n * code - and Bun's dev server does its own bundling, so nothing would run them otherwise. They are\n * security guards; a dev loop that stops enforcing them is how a leak reaches a deploy unnoticed. The\n * pass runs in the background off the hot path, so HMR is never waiting on it, and only reports.\n */\n readonly guardLeaks?: boolean;\n}"
|
|
2707
3164
|
},
|
|
2708
3165
|
{
|
|
2709
3166
|
"name": "devtools",
|
|
@@ -2797,7 +3254,7 @@
|
|
|
2797
3254
|
"name": "DiscoverRoutesOptions",
|
|
2798
3255
|
"kind": "interface",
|
|
2799
3256
|
"package": "@nifrajs/web",
|
|
2800
|
-
"signature": "export interface DiscoverRoutesOptions {\n /** Appended (as `?<importQuery>`) to each route's dynamic import — the dev server sets a\n * changing value to bust Bun's module cache so SSR picks up edited route files. */\n readonly importQuery?: string;\n}",
|
|
3257
|
+
"signature": "export interface DiscoverRoutesOptions {\n /** Appended (as `?<importQuery>`) to each route's dynamic import — the dev server sets a\n * changing value to bust Bun's module cache so SSR picks up edited route files. Ignored when\n * {@link load} is supplied, which does its own cache handling. */\n readonly importQuery?: string;\n /**\n * Load a route module by its absolute path, instead of a bare dynamic `import()`.\n *\n * This is what lets a pipeline own SSR resolution. A bare `import()` always resolves through the\n * RUNTIME - Bun - so the Vite dev server ended up serving the client while Bun resolved the server,\n * two resolvers disagreeing about one specifier in a single process. That is the dual-React bug and\n * the reason `resolve.dedupe` never reached SSR: the alias governs Vite, and SSR never asked Vite.\n *\n * Pass `vite.ssrLoadModule` here and the Vite pipeline resolves both halves. Omit it and Bun does,\n * which is correct for the Bun pipeline. Either way one toolchain owns the phase.\n */\n readonly load?: (absolutePath: string) => Promise<unknown>;\n}",
|
|
2801
3258
|
"doc": "/** Options for {@link discoverRoutes}. */"
|
|
2802
3259
|
},
|
|
2803
3260
|
{
|
|
@@ -2871,6 +3328,54 @@
|
|
|
2871
3328
|
"package": "@nifrajs/cli",
|
|
2872
3329
|
"signature": "export interface DuplicateInstallFinding {\n readonly package: string;\n readonly copies: readonly DuplicateInstallCopy[];\n}"
|
|
2873
3330
|
},
|
|
3331
|
+
{
|
|
3332
|
+
"name": "DurableEffectJournalOptions",
|
|
3333
|
+
"kind": "interface",
|
|
3334
|
+
"package": "@nifrajs/core",
|
|
3335
|
+
"signature": "export interface DurableEffectJournalOptions {\n readonly store: DurableEffectStore;\n readonly now?: () => number;\n /** Tests/local development only. Production journals require `store.durability === \"durable\"`. */\n readonly allowMemoryStore?: boolean;\n}"
|
|
3336
|
+
},
|
|
3337
|
+
{
|
|
3338
|
+
"name": "DurableEffectRecord",
|
|
3339
|
+
"kind": "interface",
|
|
3340
|
+
"package": "@nifrajs/core",
|
|
3341
|
+
"signature": "export interface DurableEffectRecord {\n readonly effectId: string;\n readonly capability: string;\n readonly target?: string;\n readonly digest?: string;\n readonly tenantId?: string;\n readonly principalId?: string;\n readonly state: DurableEffectState;\n readonly createdAt: number;\n readonly updatedAt: number;\n readonly errorCode?: string;\n readonly version: number;\n}"
|
|
3342
|
+
},
|
|
3343
|
+
{
|
|
3344
|
+
"name": "DurableEffectState",
|
|
3345
|
+
"kind": "type",
|
|
3346
|
+
"package": "@nifrajs/core",
|
|
3347
|
+
"signature": "export type DurableEffectState = \"admission\" | \"executing\" | \"committed\" | \"failed\" | \"unknown\";"
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
"name": "DurableEffectStore",
|
|
3351
|
+
"kind": "interface",
|
|
3352
|
+
"package": "@nifrajs/core",
|
|
3353
|
+
"signature": "export interface DurableEffectStore {\n readonly durability?: \"memory\" | \"durable\";\n create(record: DurableEffectRecord): boolean | Promise<boolean>;\n get(effectId: string): DurableEffectRecord | undefined | Promise<DurableEffectRecord | undefined>;\n /** Atomic compare-and-set; exactly one caller may advance the supplied `version` and `from` state. */\n transition(input: {\n readonly effectId: string;\n readonly version: number;\n readonly from: DurableEffectState;\n readonly to: DurableEffectState;\n readonly updatedAt: number;\n readonly errorCode?: string;\n }): boolean | Promise<boolean>;\n /** Bounded operational scan. Transition-only stores do not need to implement reconciliation. */\n scan?(input: ReconciliationScanOptions<DurableEffectState>): ReconciliationScanPage<DurableEffectRecord> | Promise<ReconciliationScanPage<DurableEffectRecord>>;\n /** @deprecated Compatibility fallback; production reconciliation should implement `scan`. */\n list?(): readonly DurableEffectRecord[] | Promise<readonly DurableEffectRecord[]>;\n}"
|
|
3354
|
+
},
|
|
3355
|
+
{
|
|
3356
|
+
"name": "DurableEffectTransitionError",
|
|
3357
|
+
"kind": "class",
|
|
3358
|
+
"package": "@nifrajs/core",
|
|
3359
|
+
"signature": "export declare class DurableEffectTransitionError extends Error {\n readonly effectId: string;\n readonly transition: string;\n constructor(effectId: string, transition: string);\n}"
|
|
3360
|
+
},
|
|
3361
|
+
{
|
|
3362
|
+
"name": "DurableExecutionAdapter",
|
|
3363
|
+
"kind": "interface",
|
|
3364
|
+
"package": "@nifrajs/core",
|
|
3365
|
+
"signature": "export interface DurableExecutionAdapter {\n readonly effects: DurableEffectStore;\n readonly approvals: ApprovalStore;\n readonly sagas: SagaStore;\n readonly leases: ReconciliationLeaseStore;\n}"
|
|
3366
|
+
},
|
|
3367
|
+
{
|
|
3368
|
+
"name": "DurableExecutionConformanceResult",
|
|
3369
|
+
"kind": "interface",
|
|
3370
|
+
"package": "@nifrajs/core",
|
|
3371
|
+
"signature": "export interface DurableExecutionConformanceResult {\n readonly effects: true;\n readonly approvals: true;\n readonly sagas: true;\n readonly leases: true;\n}"
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
"name": "DurableObjectExecutionAdapter",
|
|
3375
|
+
"kind": "class",
|
|
3376
|
+
"package": "@nifrajs/core",
|
|
3377
|
+
"signature": "export declare class DurableObjectExecutionAdapter implements DurableExecutionAdapter {\n readonly effects: DurableEffectStore;\n readonly approvals: ApprovalStore;\n readonly sagas: SagaStore;\n readonly leases: ReconciliationLeaseStore;\n readonly backend: DurableObjectRecordBackend;\n constructor(storage: DurableObjectStorage);\n}"
|
|
3378
|
+
},
|
|
2874
3379
|
{
|
|
2875
3380
|
"name": "DurableObjectNamespaceLike",
|
|
2876
3381
|
"kind": "interface",
|
|
@@ -2878,6 +3383,36 @@
|
|
|
2878
3383
|
"signature": "export interface DurableObjectNamespaceLike {\n idFromName(name: string): unknown;\n get(id: unknown): {\n fetch(request: Request): Promise<Response>;\n };\n}",
|
|
2879
3384
|
"doc": "/** Structural view of a Cloudflare Durable Object namespace binding — keeps `@cloudflare/workers-types`\n * out of `@nifrajs/core`. The real `DurableObjectNamespace` satisfies it. */"
|
|
2880
3385
|
},
|
|
3386
|
+
{
|
|
3387
|
+
"name": "DurableObjectRecordBackend",
|
|
3388
|
+
"kind": "class",
|
|
3389
|
+
"package": "@nifrajs/core",
|
|
3390
|
+
"signature": "export declare class DurableObjectRecordBackend implements DurableRecordBackend {\n private readonly storage;\n constructor(storage: DurableObjectStorage);\n private recordKey;\n private leaseKey;\n create(kind: DurableRecordKind, id: string, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n get<T extends {\n readonly version: number;\n }>(kind: DurableRecordKind, id: string): Promise<T | undefined>;\n compareAndSet(kind: DurableRecordKind, id: string, expectedVersion: number, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n scan<T extends {\n readonly state: string;\n readonly updatedAt: number;\n }>(kind: DurableRecordKind, input: ReconciliationScanOptions<string>): Promise<ReconciliationScanPage<T>>;\n acquireLease(input: Parameters<DurableRecordBackend[\"acquireLease\"]>[0]): Promise<ReconciliationLease | undefined>;\n renewLease(input: Parameters<DurableRecordBackend[\"renewLease\"]>[0]): Promise<boolean>;\n checkpointLease(input: Parameters<DurableRecordBackend[\"checkpointLease\"]>[0]): Promise<boolean>;\n releaseLease(input: Parameters<DurableRecordBackend[\"releaseLease\"]>[0]): Promise<boolean>;\n}"
|
|
3391
|
+
},
|
|
3392
|
+
{
|
|
3393
|
+
"name": "DurableObjectStorage",
|
|
3394
|
+
"kind": "interface",
|
|
3395
|
+
"package": "@nifrajs/core",
|
|
3396
|
+
"signature": "export interface DurableObjectStorage extends DurableObjectStorageTransaction {\n transaction<T>(closure: (transaction: DurableObjectStorageTransaction) => Promise<T>): Promise<T>;\n}"
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
"name": "DurableObjectStorageTransaction",
|
|
3400
|
+
"kind": "interface",
|
|
3401
|
+
"package": "@nifrajs/core",
|
|
3402
|
+
"signature": "export interface DurableObjectStorageTransaction {\n get<T = unknown>(key: string): Promise<T | undefined>;\n put<T = unknown>(key: string, value: T): Promise<void>;\n list<T = unknown>(options?: {\n readonly prefix?: string;\n readonly startAfter?: string;\n readonly limit?: number;\n }): Promise<Map<string, T>>;\n}"
|
|
3403
|
+
},
|
|
3404
|
+
{
|
|
3405
|
+
"name": "DurableRecordBackend",
|
|
3406
|
+
"kind": "interface",
|
|
3407
|
+
"package": "@nifrajs/core",
|
|
3408
|
+
"signature": "export interface DurableRecordBackend {\n create(kind: DurableRecordKind, id: string, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n get<T extends {\n readonly version: number;\n }>(kind: DurableRecordKind, id: string): Promise<T | undefined>;\n compareAndSet(kind: DurableRecordKind, id: string, expectedVersion: number, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n scan<T extends {\n readonly state: string;\n readonly updatedAt: number;\n }>(kind: DurableRecordKind, input: ReconciliationScanOptions<string>): Promise<ReconciliationScanPage<T>>;\n acquireLease(input: {\n readonly name: string;\n readonly owner: string;\n readonly now: number;\n readonly leaseMs: number;\n }): Promise<ReconciliationLease | undefined>;\n renewLease(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n readonly now: number;\n readonly leaseMs: number;\n }): Promise<boolean>;\n checkpointLease(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n readonly cursor?: string;\n }): Promise<boolean>;\n releaseLease(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n }): Promise<boolean>;\n}"
|
|
3409
|
+
},
|
|
3410
|
+
{
|
|
3411
|
+
"name": "DurableRecordKind",
|
|
3412
|
+
"kind": "type",
|
|
3413
|
+
"package": "@nifrajs/core",
|
|
3414
|
+
"signature": "export type DurableRecordKind = \"effect\" | \"approval\" | \"saga\";"
|
|
3415
|
+
},
|
|
2881
3416
|
{
|
|
2882
3417
|
"name": "effect",
|
|
2883
3418
|
"kind": "function",
|
|
@@ -2903,16 +3438,22 @@
|
|
|
2903
3438
|
"name": "EffectEntry",
|
|
2904
3439
|
"kind": "interface",
|
|
2905
3440
|
"package": "@nifrajs/core",
|
|
2906
|
-
"signature": "export interface EffectEntry {\n /** Monotonic position within the request (0-based). The replay/simulation order. */\n readonly seq: number;\n /** Milliseconds from the ledger's (injectable) clock at append time. */\n readonly at: number;\n readonly capability: string;\n readonly phase: EffectPhase;\n readonly target?: string;\n readonly cost?: EffectCost;\n readonly digest?: string;\n readonly error?: {\n readonly code: string;\n };\n}",
|
|
3441
|
+
"signature": "export interface EffectEntry {\n /** Monotonic position within the request (0-based). The replay/simulation order. */\n readonly seq: number;\n /** Milliseconds from the ledger's (injectable) clock at append time. */\n readonly at: number;\n readonly effectId?: string;\n readonly capability: string;\n readonly phase: EffectPhase;\n readonly target?: string;\n readonly cost?: EffectCost;\n readonly digest?: string;\n readonly error?: {\n readonly code: string;\n };\n}",
|
|
2907
3442
|
"doc": "/** One recorded effect. Frozen; token-only by construction (no payload field exists). */"
|
|
2908
3443
|
},
|
|
2909
3444
|
{
|
|
2910
3445
|
"name": "EffectEntryInput",
|
|
2911
3446
|
"kind": "interface",
|
|
2912
3447
|
"package": "@nifrajs/core",
|
|
2913
|
-
"signature": "export interface EffectEntryInput {\n /** Capability token (`db.write`, `payments.charge`). Must be a valid capability id. */\n readonly capability: string;\n /** Default `\"intent\"`. Record `committed`/`failed`/`compensated` only after the outcome is known. */\n readonly phase?: EffectPhase;\n /**
|
|
3448
|
+
"signature": "export interface EffectEntryInput extends EffectMetadata {\n /** Opaque execution correlation token shared by one intent and its terminal outcome. */\n readonly effectId?: string;\n /** Capability token (`db.write`, `payments.charge`). Must be a valid capability id. */\n readonly capability: string;\n /** Default `\"intent\"`. Record `committed`/`failed`/`compensated` only after the outcome is known. */\n readonly phase?: EffectPhase;\n /** Outcome error as a bounded token code — never a message, never a stack. */\n readonly error?: {\n readonly code: string;\n };\n}",
|
|
2914
3449
|
"doc": "/** Caller-supplied fields for one entry. Everything else (`seq`, `at`) is assigned by the ledger. */"
|
|
2915
3450
|
},
|
|
3451
|
+
{
|
|
3452
|
+
"name": "EffectEvidenceScope",
|
|
3453
|
+
"kind": "interface",
|
|
3454
|
+
"package": "@nifrajs/core",
|
|
3455
|
+
"signature": "export interface EffectEvidenceScope {\n evidence(): EffectScopeEvidence;\n /** Legacy/manual effects cannot prove a terminal outcome and therefore become ambiguous. */\n markBegan(): void;\n /** Pair a prior manual `markBegan()` with a proven commit. */\n markCommitted(): void;\n /** Preserve uncertainty when a caller loses the terminal outcome. */\n markAmbiguous(): void;\n /** Settle one begun effect as a proven terminal failure without claiming it committed. */\n markFailed(): void;\n /**\n * Declare that the enclosing request may release its idempotency reservation if it returns a\n * server error before any owned effect begins.\n */\n markSafeToRetry(): void;\n /** True only while the retry declaration remains backed by evidence that no effect began. */\n safeToRetry(): boolean;\n}"
|
|
3456
|
+
},
|
|
2916
3457
|
{
|
|
2917
3458
|
"name": "effectLedger",
|
|
2918
3459
|
"kind": "function",
|
|
@@ -2955,6 +3496,40 @@
|
|
|
2955
3496
|
"signature": "export declare class EffectLedgerSealedError extends Error {\n constructor();\n}",
|
|
2956
3497
|
"doc": "/** Thrown by `append` after `seal()` — e.g. an effect attempted while streaming a response body. */"
|
|
2957
3498
|
},
|
|
3499
|
+
{
|
|
3500
|
+
"name": "EffectLifecycleEvent",
|
|
3501
|
+
"kind": "interface",
|
|
3502
|
+
"package": "@nifrajs/core",
|
|
3503
|
+
"signature": "export interface EffectLifecycleEvent extends EffectMetadata {\n readonly effectId: string;\n readonly capability: string;\n readonly stage: EffectLifecycleStage;\n readonly phase: EffectLifecyclePhase;\n readonly at: number;\n readonly durationMs?: number;\n readonly attempt?: number;\n readonly errorCode?: string;\n readonly trace?: EffectTraceParent;\n}",
|
|
3504
|
+
"doc": "/**\n * Token-only lifecycle evidence. There is deliberately no payload, argument, result, error message,\n * request, or context field, so observation adapters cannot accidentally export business data.\n */"
|
|
3505
|
+
},
|
|
3506
|
+
{
|
|
3507
|
+
"name": "EffectLifecycleObserver",
|
|
3508
|
+
"kind": "type",
|
|
3509
|
+
"package": "@nifrajs/core",
|
|
3510
|
+
"signature": "export type EffectLifecycleObserver = (event: EffectLifecycleEvent) => void;",
|
|
3511
|
+
"doc": "/** Observation is fail-open: a broken sink must never change effect behavior. */"
|
|
3512
|
+
},
|
|
3513
|
+
{
|
|
3514
|
+
"name": "EffectLifecyclePhase",
|
|
3515
|
+
"kind": "type",
|
|
3516
|
+
"package": "@nifrajs/core",
|
|
3517
|
+
"signature": "export type EffectLifecyclePhase = \"started\" | \"succeeded\" | \"failed\" | \"ambiguous\";"
|
|
3518
|
+
},
|
|
3519
|
+
{
|
|
3520
|
+
"name": "EffectLifecycleStage",
|
|
3521
|
+
"kind": "type",
|
|
3522
|
+
"package": "@nifrajs/core",
|
|
3523
|
+
"signature": "export type EffectLifecycleStage = \"admission\" | \"execution\" | \"compensation\" | \"reconciliation\";",
|
|
3524
|
+
"doc": "/** A bounded, payload-free stage in an effect's lifecycle. */"
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
"name": "EffectMetadata",
|
|
3528
|
+
"kind": "interface",
|
|
3529
|
+
"package": "@nifrajs/core",
|
|
3530
|
+
"signature": "export interface EffectMetadata {\n /** Adapter/resource token (`repo:orders`, `provider:payments`). A token — never a value or a row. */\n readonly target?: string;\n /** Dimensionless counters; see {@link EffectCost}. At most {@link MAX_COST_AXES} axes. */\n readonly cost?: EffectCost;\n /** Optional keyed-HMAC digest of the effect payload (see {@link computeEffectDigest}); hex, 64 chars. */\n readonly digest?: string;\n}",
|
|
3531
|
+
"doc": "/** Token-only caller metadata shared by an effect intent and outcome. */"
|
|
3532
|
+
},
|
|
2958
3533
|
{
|
|
2959
3534
|
"name": "EffectPhase",
|
|
2960
3535
|
"kind": "type",
|
|
@@ -2962,6 +3537,81 @@
|
|
|
2962
3537
|
"signature": "export type EffectPhase = \"intent\" | \"committed\" | \"failed\" | \"compensated\";",
|
|
2963
3538
|
"doc": "/** Lifecycle phase of one effect. `intent` precedes execution; the rest describe its outcome. */"
|
|
2964
3539
|
},
|
|
3540
|
+
{
|
|
3541
|
+
"name": "EffectReconciliationFinding",
|
|
3542
|
+
"kind": "interface",
|
|
3543
|
+
"package": "@nifrajs/core",
|
|
3544
|
+
"signature": "export interface EffectReconciliationFinding {\n readonly effectId: string;\n readonly capability: string;\n readonly state: \"incomplete\" | \"ambiguous\";\n readonly updatedAt: number;\n}"
|
|
3545
|
+
},
|
|
3546
|
+
{
|
|
3547
|
+
"name": "EffectScope",
|
|
3548
|
+
"kind": "interface",
|
|
3549
|
+
"package": "@nifrajs/core",
|
|
3550
|
+
"signature": "export interface EffectScope extends EffectEvidenceScope {\n run<T>(options: OwnedEffectRunOptions<T>, execute: (context: OwnedEffectContext) => T | PromiseLike<T>): Promise<T>;\n}"
|
|
3551
|
+
},
|
|
3552
|
+
{
|
|
3553
|
+
"name": "EffectScopeEvidence",
|
|
3554
|
+
"kind": "interface",
|
|
3555
|
+
"package": "@nifrajs/core",
|
|
3556
|
+
"signature": "export interface EffectScopeEvidence {\n readonly began: boolean;\n readonly committed: boolean;\n readonly ambiguous: boolean;\n}"
|
|
3557
|
+
},
|
|
3558
|
+
{
|
|
3559
|
+
"name": "effectScopeForContext",
|
|
3560
|
+
"kind": "function",
|
|
3561
|
+
"package": "@nifrajs/core",
|
|
3562
|
+
"signature": "export declare function effectScopeForContext(context: object): EffectEvidenceScope | undefined;"
|
|
3563
|
+
},
|
|
3564
|
+
{
|
|
3565
|
+
"name": "EffectScopeOptions",
|
|
3566
|
+
"kind": "interface",
|
|
3567
|
+
"package": "@nifrajs/core",
|
|
3568
|
+
"signature": "export interface EffectScopeOptions {\n readonly observers?: readonly EffectLifecycleObserver[];\n readonly signal?: AbortSignal;\n readonly effectId?: () => string;\n}"
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
"name": "EffectTraceParent",
|
|
3572
|
+
"kind": "interface",
|
|
3573
|
+
"package": "@nifrajs/core",
|
|
3574
|
+
"signature": "export interface EffectTraceParent {\n readonly traceId: string;\n readonly spanId: string;\n readonly sampled: boolean;\n}",
|
|
3575
|
+
"doc": "/** Trace-parent tokens copied structurally from an installed tracing plugin. */"
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
"name": "effectTraceParentOf",
|
|
3579
|
+
"kind": "function",
|
|
3580
|
+
"package": "@nifrajs/core",
|
|
3581
|
+
"signature": "export declare function effectTraceParentOf(context: object): EffectTraceParent | undefined;"
|
|
3582
|
+
},
|
|
3583
|
+
{
|
|
3584
|
+
"name": "effectTracing",
|
|
3585
|
+
"kind": "function",
|
|
3586
|
+
"package": "@nifrajs/otel",
|
|
3587
|
+
"signature": "export declare function effectTracing(options?: EffectTracingOptions): EffectTracingPlugin;",
|
|
3588
|
+
"doc": "/**\n * Installs child effect spans on subsequent routes. The observer consumes only the constrained\n * `EffectLifecycleEvent` contract; request/business payloads and error text cannot enter an export.\n */"
|
|
3589
|
+
},
|
|
3590
|
+
{
|
|
3591
|
+
"name": "EffectTracingOptions",
|
|
3592
|
+
"kind": "interface",
|
|
3593
|
+
"package": "@nifrajs/otel",
|
|
3594
|
+
"signature": "export interface EffectTracingOptions {\n readonly exporter?: ObservationAdapter;\n readonly adapters?: readonly ObservationAdapter[];\n /** Maximum unmatched started events retained at once. Default 10,000. */\n readonly maxActive?: number;\n /** Opportunistically expire unmatched events older than this many milliseconds. Default 5 min. */\n readonly maxActiveAgeMs?: number;\n /** Injectable wall clock for deterministic retention tests. */\n readonly now?: () => number;\n}"
|
|
3595
|
+
},
|
|
3596
|
+
{
|
|
3597
|
+
"name": "EffectTracingPlugin",
|
|
3598
|
+
"kind": "interface",
|
|
3599
|
+
"package": "@nifrajs/otel",
|
|
3600
|
+
"signature": "export interface EffectTracingPlugin extends IdentityPlugin {\n /** Pass the same observer to `createSagaEngine({ observer })` and reconciliation helpers. */\n readonly observer: EffectLifecycleObserver;\n}"
|
|
3601
|
+
},
|
|
3602
|
+
{
|
|
3603
|
+
"name": "emitEffectLifecycle",
|
|
3604
|
+
"kind": "function",
|
|
3605
|
+
"package": "@nifrajs/core",
|
|
3606
|
+
"signature": "export declare function emitEffectLifecycle(observers: readonly EffectLifecycleObserver[], input: EmitEffectLifecycleInput): void;",
|
|
3607
|
+
"doc": "/** @internal Validate, freeze, and fan out one token-only event. */"
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
"name": "EmitEffectLifecycleInput",
|
|
3611
|
+
"kind": "interface",
|
|
3612
|
+
"package": "@nifrajs/core",
|
|
3613
|
+
"signature": "export interface EmitEffectLifecycleInput extends EffectMetadata {\n readonly effectId: string;\n readonly capability: string;\n readonly stage: EffectLifecycleStage;\n readonly phase: EffectLifecyclePhase;\n readonly at?: number;\n readonly durationMs?: number;\n readonly attempt?: number;\n readonly errorCode?: string;\n readonly trace?: EffectTraceParent;\n}"
|
|
3614
|
+
},
|
|
2965
3615
|
{
|
|
2966
3616
|
"name": "EMPTY_PARAMS",
|
|
2967
3617
|
"kind": "const",
|
|
@@ -2994,6 +3644,13 @@
|
|
|
2994
3644
|
"package": "@nifrajs/web",
|
|
2995
3645
|
"signature": "export interface EnableDraftOptions {\n /** Cookie lifetime in **seconds** (default `3600` = 1h). Keep it short — draft is an editor session. */\n readonly maxAgeSeconds?: number;\n /** Cookie `Path` (default `\"/\"`). */\n readonly path?: string;\n /** Override the `Secure` attribute (defaults to `true` — secure-by-default). Pass `false` only for\n * local `http://` dev, where a `Secure` cookie isn't stored. */\n readonly secure?: boolean;\n}"
|
|
2996
3646
|
},
|
|
3647
|
+
{
|
|
3648
|
+
"name": "encode",
|
|
3649
|
+
"kind": "function",
|
|
3650
|
+
"package": "@nifrajs/core",
|
|
3651
|
+
"signature": "export declare function encode(value: unknown): Wire;",
|
|
3652
|
+
"doc": "/** Encode any supported value into a JSON-safe {@link Wire} form. */"
|
|
3653
|
+
},
|
|
2997
3654
|
{
|
|
2998
3655
|
"name": "encodeCursor",
|
|
2999
3656
|
"kind": "function",
|
|
@@ -3001,6 +3658,18 @@
|
|
|
3001
3658
|
"signature": "export declare function encodeCursor(value: unknown): string;",
|
|
3002
3659
|
"doc": "/** Encode any JSON-serializable value (e.g. the last row's sort key) into an opaque cursor string. */"
|
|
3003
3660
|
},
|
|
3661
|
+
{
|
|
3662
|
+
"name": "encodeTransportFrame",
|
|
3663
|
+
"kind": "function",
|
|
3664
|
+
"package": "@nifrajs/core",
|
|
3665
|
+
"signature": "export declare function encodeTransportFrame(value: unknown, codec?: TransportCodec): string;"
|
|
3666
|
+
},
|
|
3667
|
+
{
|
|
3668
|
+
"name": "encodeTransportResponse",
|
|
3669
|
+
"kind": "function",
|
|
3670
|
+
"package": "@nifrajs/core",
|
|
3671
|
+
"signature": "export declare function encodeTransportResponse(value: unknown, codec?: TransportCodec, init?: ResponseInit): Response;"
|
|
3672
|
+
},
|
|
3004
3673
|
{
|
|
3005
3674
|
"name": "EndObservation",
|
|
3006
3675
|
"kind": "interface",
|
|
@@ -3183,6 +3852,13 @@
|
|
|
3183
3852
|
"signature": "export interface Example {\n readonly name: string;\n /** The doc page's title, e.g. \"Nifra — Auth & sessions\". */\n readonly topic: string;\n /** The doc page slug, e.g. \"auth\" — a short, matchable tag. */\n readonly slug: string;\n readonly code: string;\n}",
|
|
3184
3853
|
"doc": "/**\n * `nifra_example` — verified, copy-pasteable code examples for agents. The corpus is `examples.json`\n * (written into this package by `bun run gen:llms`): the same doc snippets `check:docs` typechecks\n * against the live `@nifrajs/*` API. So every example this returns is GUARANTEED to compile against the\n * installed version — the antidote to an agent hallucinating a framework API from stale training.\n *\n * Keyword-scored over each example's name/topic/slug (curated identifiers, heavily weighted) and its\n * code body. No query → a grouped index of what's available (the cheap discovery call).\n */"
|
|
3185
3854
|
},
|
|
3855
|
+
{
|
|
3856
|
+
"name": "executeCapability",
|
|
3857
|
+
"kind": "function",
|
|
3858
|
+
"package": "@nifrajs/core",
|
|
3859
|
+
"signature": "export declare function executeCapability<T>(context: object, capability: string, options: CapabilityExecutionOptions, executor: CapabilityExecutor<T>): Promise<T>;",
|
|
3860
|
+
"doc": "/**\n * Execute one owned effect behind a fail-closed capability boundary. The boundary assigns a stable\n * effect id, records intent before execution, and records exactly one terminal outcome automatically.\n * The callback result and errors never enter the token-only ledger.\n */"
|
|
3861
|
+
},
|
|
3186
3862
|
{
|
|
3187
3863
|
"name": "ExecutionContext",
|
|
3188
3864
|
"kind": "interface",
|
|
@@ -3190,6 +3866,13 @@
|
|
|
3190
3866
|
"signature": "export interface ExecutionContext {\n waitUntil(promise: Promise<unknown>): void;\n}",
|
|
3191
3867
|
"doc": "/** A Cloudflare Workers-style execution context (the `fetch` 3rd arg). Structural — only\n * `waitUntil` is used; declared here so `@nifrajs/core` needs no Workers type dependency. */"
|
|
3192
3868
|
},
|
|
3869
|
+
{
|
|
3870
|
+
"name": "explainBindFailure",
|
|
3871
|
+
"kind": "const",
|
|
3872
|
+
"package": "@nifrajs/web",
|
|
3873
|
+
"signature": "export declare const explainBindFailure: (err: unknown, port: number) => Error;",
|
|
3874
|
+
"doc": "/** Map a bind failure to the port-collision explanation, leaving every other failure as itself. */"
|
|
3875
|
+
},
|
|
3193
3876
|
{
|
|
3194
3877
|
"name": "exponentialBackoff",
|
|
3195
3878
|
"kind": "function",
|
|
@@ -3373,7 +4056,7 @@
|
|
|
3373
4056
|
"name": "FetchRouteData",
|
|
3374
4057
|
"kind": "type",
|
|
3375
4058
|
"package": "@nifrajs/web",
|
|
3376
|
-
"signature": "export type FetchRouteData = (path: string, match: RouteMatch, signal?: AbortSignal) => Promise<unknown>;",
|
|
4059
|
+
"signature": "export type FetchRouteData = (path: string, match: RouteMatch, signal?: AbortSignal, navigation?: {\n readonly from: string;\n readonly retain: readonly number[];\n}) => Promise<unknown>;",
|
|
3377
4060
|
"doc": "/** How a router fetches a route's loader data on navigation. `signal` aborts a superseded fetch\n * (and its deferred stream). */"
|
|
3378
4061
|
},
|
|
3379
4062
|
{
|
|
@@ -3401,8 +4084,21 @@
|
|
|
3401
4084
|
"name": "filePathToPatterns",
|
|
3402
4085
|
"kind": "function",
|
|
3403
4086
|
"package": "@nifrajs/web",
|
|
3404
|
-
"signature": "export declare function filePathToPatterns(file: string): string[];"
|
|
3405
|
-
|
|
4087
|
+
"signature": "export declare function filePathToPatterns(file: string): string[];"
|
|
4088
|
+
},
|
|
4089
|
+
{
|
|
4090
|
+
"name": "filePathToRoutes",
|
|
4091
|
+
"kind": "function",
|
|
4092
|
+
"package": "@nifrajs/web",
|
|
4093
|
+
"signature": "export declare function filePathToRoutes(file: string): FileRoutePattern[];",
|
|
4094
|
+
"doc": "/** Expand a route file into its URL patterns, each carrying per-directory segment counts. */"
|
|
4095
|
+
},
|
|
4096
|
+
{
|
|
4097
|
+
"name": "FileRoutePattern",
|
|
4098
|
+
"kind": "interface",
|
|
4099
|
+
"package": "@nifrajs/web",
|
|
4100
|
+
"signature": "export interface FileRoutePattern {\n readonly pattern: string;\n /**\n * URL segments contributed by the first *k* path parts of the file, indexed by *k*.\n *\n * This is what makes a layout's scope derivable without turning layouts into router nodes. A layout\n * lives at a directory; the segments that directory contributes are exactly the prefix of the URL it\n * wraps, so `depths[partsIn(layoutDir)]` is how many leading pattern segments it owns - and the\n * params inside that prefix are the ones it may read.\n *\n * Per EXPANDED pattern, not per file, because the two diverge: `[[lang]]/docs/_layout` owns nothing\n * on `/docs/:slug` and `{lang}` on `/:lang/docs/:slug`. A route group contributes no segment, so\n * `(marketing)/_layout` owns nothing at all.\n */\n readonly depths: readonly number[];\n}",
|
|
4101
|
+
"doc": "/** One URL pattern a route file expands to, plus the scope information layouts need. */"
|
|
3406
4102
|
},
|
|
3407
4103
|
{
|
|
3408
4104
|
"name": "FileStorage",
|
|
@@ -3435,7 +4131,7 @@
|
|
|
3435
4131
|
"name": "Flags",
|
|
3436
4132
|
"kind": "interface",
|
|
3437
4133
|
"package": "@nifrajs/cli",
|
|
3438
|
-
"signature": "export interface Flags {\n readonly port: number;\n readonly out: string;\n readonly poll: boolean;\n /** `nifra build --target <t>`: emit a full deploy dir for this target. Defaults to `bun`. */\n readonly target: string;\n /** `nifra build --report`: print a per-chunk size + gzip table after the build. */\n readonly report: boolean;\n}"
|
|
4134
|
+
"signature": "export interface Flags {\n readonly port: number;\n readonly out: string;\n readonly poll: boolean;\n /** `nifra build --target <t>`: emit a full deploy dir for this target. Defaults to `bun`. */\n readonly target: string;\n /** `nifra build --report`: print a per-chunk size + gzip table after the build. */\n readonly report: boolean;\n /** `nifra build --vite`: force the client + server through Vite/Rollup. Without a flag the pipeline is\n * chosen per app (`chooseBuildPipeline`) - Bun unless the app's only transforms are `vitePlugins`. */\n readonly vite: boolean;\n /** `nifra dev --bun`: run the Bun-pipeline dev server (Bun.serve native HMR — including React Fast\n * Refresh with state preserved — and no Vite in the process). Default stays Vite for its plugin\n * ecosystem; `--bun` trades that for one bundler across dev and prod. Refuses CSS-Modules apps.\n *\n * `nifra build --bun`: force the Bun build. Refuses when that would drop the app's `vitePlugins`. */\n readonly bun: boolean;\n}"
|
|
3439
4135
|
},
|
|
3440
4136
|
{
|
|
3441
4137
|
"name": "FontAsset",
|
|
@@ -3529,6 +4225,20 @@
|
|
|
3529
4225
|
"signature": "export declare function formatManifestDrift(drift: ManifestDrift, manifestPath?: string): string | undefined;",
|
|
3530
4226
|
"doc": "/**\n * Format a {@link ManifestDrift} as a named, actionable error message, or `undefined` when in sync.\n * Names the exact missing/extra routes + the one fix (regenerate the manifest by re-running the build).\n * `manifestPath` is shown for the dev to locate the stale file. Pure.\n */"
|
|
3531
4227
|
},
|
|
4228
|
+
{
|
|
4229
|
+
"name": "formatNodeBuiltinLeak",
|
|
4230
|
+
"kind": "function",
|
|
4231
|
+
"package": "@nifrajs/web",
|
|
4232
|
+
"signature": "export declare function formatNodeBuiltinLeak(findings: ReadonlyArray<NodeBuiltinFinding>): string | undefined;",
|
|
4233
|
+
"doc": "/** The build-failing message for `node:` builtins that reached the client bundle. `undefined` ⇒ clean. */"
|
|
4234
|
+
},
|
|
4235
|
+
{
|
|
4236
|
+
"name": "formatServerOnlyLeak",
|
|
4237
|
+
"kind": "function",
|
|
4238
|
+
"package": "@nifrajs/web",
|
|
4239
|
+
"signature": "export declare function formatServerOnlyLeak(findings: ReadonlyArray<ServerOnlyFinding>): string | undefined;",
|
|
4240
|
+
"doc": "/** The build-failing message for `server-only`-marked modules that reached the client. `undefined` ⇒ clean. */"
|
|
4241
|
+
},
|
|
3532
4242
|
{
|
|
3533
4243
|
"name": "Formatter",
|
|
3534
4244
|
"kind": "interface",
|
|
@@ -3595,6 +4305,20 @@
|
|
|
3595
4305
|
"package": "@nifrajs/core",
|
|
3596
4306
|
"signature": "export type FrameworkName = typeof FRAMEWORK_NAME;"
|
|
3597
4307
|
},
|
|
4308
|
+
{
|
|
4309
|
+
"name": "fromBunMetafile",
|
|
4310
|
+
"kind": "function",
|
|
4311
|
+
"package": "@nifrajs/web",
|
|
4312
|
+
"signature": "export declare function fromBunMetafile(meta: BunMetafileLike | undefined): ClientModuleGraph;",
|
|
4313
|
+
"doc": "/**\n * Adapt a `Bun.build` metafile to the neutral graph.\n *\n * A total function: an absent or partial metafile yields an empty graph rather than throwing, because\n * a guard that crashes on an unexpected build shape fails the build for the wrong reason. An empty\n * graph reports no findings, which matches the existing behaviour when the metafile is missing.\n */"
|
|
4314
|
+
},
|
|
4315
|
+
{
|
|
4316
|
+
"name": "fromRollupBundle",
|
|
4317
|
+
"kind": "function",
|
|
4318
|
+
"package": "@nifrajs/web",
|
|
4319
|
+
"signature": "export declare function fromRollupBundle(bundle: RollupBundleLike, importsOf: (moduleId: string) => readonly string[]): ClientModuleGraph;",
|
|
4320
|
+
"doc": "/**\n * Adapt a Rollup/Vite output bundle to the neutral graph — the second producer the seam was built for.\n *\n * The bundle records which modules landed in which chunk (`moduleIds`) but NOT each module's import\n * edges, so those come from `importsOf`, which the caller backs with `this.getModuleInfo(id).importedIds`\n * inside a plugin hook (a test backs it with a plain map). Edges carry only the RESOLVED id — Rollup does\n * not keep the as-written specifier per edge — so `path` is set and `original` is left undefined. Both\n * guards read the resolved `path` as their fallback (a `node:` prefix, the `server-only` basename), so\n * detection is unaffected; only the human-readable chain shows resolved paths instead of as-written ones.\n *\n * Total, like {@link fromBunMetafile}: an empty bundle yields an empty graph (no findings), never a throw\n * that would fail a build for the wrong reason.\n */"
|
|
4321
|
+
},
|
|
3598
4322
|
{
|
|
3599
4323
|
"name": "fromTypeBox",
|
|
3600
4324
|
"kind": "function",
|
|
@@ -3634,7 +4358,7 @@
|
|
|
3634
4358
|
"name": "GenerateClientEntryOptions",
|
|
3635
4359
|
"kind": "interface",
|
|
3636
4360
|
"package": "@nifrajs/web",
|
|
3637
|
-
"signature": "export interface GenerateClientEntryOptions {\n
|
|
4361
|
+
"signature": "export interface GenerateClientEntryOptions {\n /**\n * Module specifier for the adapter's client runtime, e.g. `\"@nifrajs/web-solid/client\"`.\n *\n * **Contract:** the module MUST export `mountRouter({ router, routes, container })`. The generated\n * bootstrap imports the specifier and calls it — so a self-executing entry that mounts on import\n * builds cleanly and then does nothing, which is the trap this contract exists to name. The type is\n * a bare `string` because a specifier is resolved by the bundler, not the type system, so the\n * requirement is enforced by the bootstrap instead: it throws immediately, naming this module and\n * the missing export, rather than failing later as `mountRouter is not a function`.\n */\n readonly clientModule: string;\n /** Turn a route/layout source file (relative to the routes dir) into an import specifier. */\n readonly resolve: (file: string) => string;\n}"
|
|
3638
4362
|
},
|
|
3639
4363
|
{
|
|
3640
4364
|
"name": "generateLlmsTxt",
|
|
@@ -3666,7 +4390,7 @@
|
|
|
3666
4390
|
"name": "generateServerEntry",
|
|
3667
4391
|
"kind": "function",
|
|
3668
4392
|
"package": "@nifrajs/web",
|
|
3669
|
-
"signature": "export declare function generateServerEntry(options: {\n readonly target: BuildTarget;\n /** Import specifier for the module exporting `adapter` (e.g. `\"../framework.ts\"`). */\n readonly adapterImport: string;\n /** Import specifier for the module exporting `backend`, or `undefined` for a frontend-only app. */\n readonly backendImport?: string;\n /** Document `<title>` passed to `createWebApp`. */\n readonly title?: string;\n}): string;",
|
|
4393
|
+
"signature": "export declare function generateServerEntry(options: {\n readonly target: BuildTarget;\n /** Import specifier for the module exporting `adapter` (e.g. `\"../framework.ts\"`). */\n readonly adapterImport: string;\n /** Import specifier for the module exporting `backend`, or `undefined` for a frontend-only app. */\n readonly backendImport?: string;\n /** Document `<title>` passed to `createWebApp`. */\n readonly title?: string;\n /** Encoded root-relative public file paths copied into the deploy directory. */\n readonly publicFiles?: readonly string[];\n}): string;",
|
|
3670
4394
|
"doc": "/**\n * Codegen the per-target **server entry** module (source text) for `buildServer` to bundle. It imports\n * the app's `adapter` (from `framework.ts`), the optional `backend` (from `backend.ts`), and the\n * generated `{ manifest, clientEntry }` (from `./server-manifest`), builds `createWebApp`, then wires\n * the right host:\n * - `cf-pages` / `vercel`: `export default` the fetch handler (the platform serves /assets/* itself).\n * - `deno`: same fetch-handler default, plus `Deno.serve` self-host when run directly.\n * - `bun` / `node`: a self-hosting server that ALSO serves the client bundle from disk (those\n * runtimes have a filesystem; the static `/assets/*` sit next to the entry).\n * `adapterImport`/`backendImport` are the specifiers the entry uses (relative to where it's written) —\n * `buildServer` writes the entry next to `serverEntry`, so they're resolved from there. Pure (string in,\n * string out) so the generation is unit-testable without a real build.\n */"
|
|
3671
4395
|
},
|
|
3672
4396
|
{
|
|
@@ -3674,7 +4398,7 @@
|
|
|
3674
4398
|
"kind": "function",
|
|
3675
4399
|
"package": "@nifrajs/web",
|
|
3676
4400
|
"signature": "export declare function generateServerManifest(manifest: Manifest, options: GenerateServerManifestOptions): string;",
|
|
3677
|
-
"doc": "/**\n * Codegen: emit a **server manifest** module (as source) for disk-less edge runtimes (Cloudflare\n * Workers, …) — and, with a `target`, any portable server bundle. `discoverRoutes` scans `node:fs`\n * and dynamic-imports each route by a *runtime* path — neither exists on workerd. This instead emits\n * **statically-analyzable** imports of every route/layout/`_error
|
|
4401
|
+
"doc": "/**\n * Codegen: emit a **server manifest** module (as source) for disk-less edge runtimes (Cloudflare\n * Workers, …) — and, with a `target`, any portable server bundle. `discoverRoutes` scans `node:fs`\n * and dynamic-imports each route by a *runtime* path — neither exists on workerd. This instead emits\n * **statically-analyzable** imports of every route/layout/`_error`/terminal status page (so the bundler includes them) and\n * rebuilds the manifest with `buildManifest` — the SAME pure logic `discoverRoutes` feeds, so patterns\n * + layout chains are identical. Eager (`import * as`) by default; `lazy` emits `() => import(...)` so\n * a code-splitting bundler chunks per route. The emitted module exports `manifest` (consumed by\n * `createWebApp`, unchanged) + `clientEntry` (baked). Write it to a file and bundle it into the worker\n * entry (see `buildServer` in `@nifrajs/web/build`).\n */"
|
|
3678
4402
|
},
|
|
3679
4403
|
{
|
|
3680
4404
|
"name": "GenerateServerManifestOptions",
|
|
@@ -3749,6 +4473,13 @@
|
|
|
3749
4473
|
"signature": "export declare function githubDeployWorkflow(target: string, appName: string): string;",
|
|
3750
4474
|
"doc": "/**\n * Build a GitHub Actions workflow that builds on every push/PR and deploys `target` on a push to `main`.\n * Reuses the canonical `bun run build` (the deploy preset repoints it), then runs the target's official\n * deploy mechanism. Exported for unit tests. Throws on an unknown target.\n */"
|
|
3751
4475
|
},
|
|
4476
|
+
{
|
|
4477
|
+
"name": "gone",
|
|
4478
|
+
"kind": "function",
|
|
4479
|
+
"package": "@nifrajs/web",
|
|
4480
|
+
"signature": "export declare function gone(options?: StatusPageOptions): never;",
|
|
4481
|
+
"doc": "/**\n * Render a terminal page at status **410 Gone**. `throw` it from a loader for a record that existed and\n * was deliberately removed - a withdrawn listing, a deleted post.\n *\n * 410 is not a pedantic 404: it tells a crawler to **drop** the URL rather than re-fetch it for weeks\n * on the assumption the 404 was transient. Uses `_410.tsx` if the app has one, otherwise `_404`.\n */"
|
|
4482
|
+
},
|
|
3752
4483
|
{
|
|
3753
4484
|
"name": "GoogleFontOptions",
|
|
3754
4485
|
"kind": "interface",
|
|
@@ -3763,6 +4494,25 @@
|
|
|
3763
4494
|
"signature": "export declare function googleFontsCssUrl(options: GoogleFontOptions): string;",
|
|
3764
4495
|
"doc": "/** Build the Google Fonts CSS2 request URL. Pure + fully validated, so it's safe to feed a dynamic\n * family/weights/text. Exported for advanced callers who fetch + parse the stylesheet themselves. */"
|
|
3765
4496
|
},
|
|
4497
|
+
{
|
|
4498
|
+
"name": "GraphChunk",
|
|
4499
|
+
"kind": "interface",
|
|
4500
|
+
"package": "@nifrajs/web",
|
|
4501
|
+
"signature": "export interface GraphChunk {\n /** Source module this chunk is the entry for, if it is one. */\n readonly entryPoint?: string;\n /** Module ids that landed in this chunk. */\n readonly modules: readonly string[];\n}"
|
|
4502
|
+
},
|
|
4503
|
+
{
|
|
4504
|
+
"name": "GraphImport",
|
|
4505
|
+
"kind": "interface",
|
|
4506
|
+
"package": "@nifrajs/web",
|
|
4507
|
+
"signature": "export interface GraphImport {\n /** The resolved path, when the bundler resolved it. */\n readonly path?: string;\n /** The specifier as written in source - the only form that survives an unresolved import. */\n readonly original?: string;\n}",
|
|
4508
|
+
"doc": "/** One import edge, as the bundler recorded it. */"
|
|
4509
|
+
},
|
|
4510
|
+
{
|
|
4511
|
+
"name": "GraphModule",
|
|
4512
|
+
"kind": "interface",
|
|
4513
|
+
"package": "@nifrajs/web",
|
|
4514
|
+
"signature": "export interface GraphModule {\n readonly imports: readonly GraphImport[];\n}"
|
|
4515
|
+
},
|
|
3766
4516
|
{
|
|
3767
4517
|
"name": "GuardOptions",
|
|
3768
4518
|
"kind": "interface",
|
|
@@ -4075,7 +4825,7 @@
|
|
|
4075
4825
|
"name": "IdempotencyRuntime",
|
|
4076
4826
|
"kind": "interface",
|
|
4077
4827
|
"package": "@nifrajs/core",
|
|
4078
|
-
"signature": "export interface IdempotencyRuntime {\n /** Resolve a route's declared idempotency into a pinned store + defaults, or `undefined` when off. */\n resolve(schema: RouteSchema | undefined, authenticated: boolean, maxBodyBytes: number): ResolvedIdempotency | undefined;\n /** The dedupe lane: read the key, fingerprint the request, consult the store, run/replay/reject. */\n run<T>(config: ResolvedIdempotency, req: Request, platform: Platform | undefined, entry: unknown, params: Record<string, string>, search: string | undefined, wrapResponse: (response: Response) => T, host: IdempotencyHost): Promise<T>;\n}",
|
|
4828
|
+
"signature": "export interface IdempotencyRuntime {\n readonly trackEffect: (context: object, committed: boolean) => void;\n /** Resolve a route's declared idempotency into a pinned store + defaults, or `undefined` when off. */\n resolve(schema: RouteSchema | undefined, authenticated: boolean, maxBodyBytes: number): ResolvedIdempotency | undefined;\n /** The dedupe lane: read the key, fingerprint the request, consult the store, run/replay/reject. */\n run<T>(config: ResolvedIdempotency, req: Request, platform: Platform | undefined, entry: unknown, params: Record<string, string>, search: string | undefined, wrapResponse: (response: Response) => T, host: IdempotencyHost): Promise<T>;\n}",
|
|
4079
4829
|
"doc": "/** The injected idempotency implementation the kernel calls through when the plugin is installed. */"
|
|
4080
4830
|
},
|
|
4081
4831
|
{
|
|
@@ -4362,6 +5112,13 @@
|
|
|
4362
5112
|
"package": "@nifrajs/cli",
|
|
4363
5113
|
"signature": "export interface InitAgentsResult {\n readonly cwd: string;\n readonly files: readonly InitAgentsFileResult[];\n}"
|
|
4364
5114
|
},
|
|
5115
|
+
{
|
|
5116
|
+
"name": "injectStyles",
|
|
5117
|
+
"kind": "function",
|
|
5118
|
+
"package": "@nifrajs/web",
|
|
5119
|
+
"signature": "export declare function injectStyles(html: string, styles: readonly string[]): string;",
|
|
5120
|
+
"doc": "/**\n * Inject Bun's stylesheet links into an SSR'd document.\n *\n * Prefers `</head>`; falls back to prepending when a document has no head (a bare fragment from a custom\n * renderer). Never appends blindly at the end - a stylesheet after `</body>` still applies but arrives\n * after first paint, so the page flashes unstyled and dev stops resembling production.\n */"
|
|
5121
|
+
},
|
|
4365
5122
|
{
|
|
4366
5123
|
"name": "inProcessClient",
|
|
4367
5124
|
"kind": "function",
|
|
@@ -4469,6 +5226,13 @@
|
|
|
4469
5226
|
"package": "@nifrajs/middleware",
|
|
4470
5227
|
"signature": "export interface IpRestrictionOptions {\n readonly allow?: readonly IpMatcher[];\n readonly deny?: readonly IpMatcher[];\n /** Preferred extraction hook when the adapter/app knows the peer address. */\n readonly clientIp?: (request: Request) => MaybePromise<string | null | undefined>;\n /** Trusted proxy count for `X-Forwarded-For` extraction. Default: 0, so XFF is ignored. */\n readonly trustedProxies?: number;\n /** Exact trusted single-IP header, e.g. an infra-set `x-real-ip`. Not used unless configured. */\n readonly header?: string;\n readonly error?: string;\n}"
|
|
4471
5228
|
},
|
|
5229
|
+
{
|
|
5230
|
+
"name": "isAddressInUse",
|
|
5231
|
+
"kind": "const",
|
|
5232
|
+
"package": "@nifrajs/web",
|
|
5233
|
+
"signature": "export declare const isAddressInUse: (err: unknown) => boolean;",
|
|
5234
|
+
"doc": "/** True when an unknown thrown value carries the \"address already in use\" errno. */"
|
|
5235
|
+
},
|
|
4472
5236
|
{
|
|
4473
5237
|
"name": "isAllowedFontUrl",
|
|
4474
5238
|
"kind": "function",
|
|
@@ -4611,6 +5375,13 @@
|
|
|
4611
5375
|
"package": "@nifrajs/web",
|
|
4612
5376
|
"signature": "export interface ISROptions {\n readonly store: CacheStore;\n /** Default freshness window (**seconds**) for a cached page; older ⇒ stale (served, regenerated\n * behind). A route overrides it per-page via `export const revalidate` (surfaced as the\n * `x-nifra-isr-revalidate` response header). */\n readonly revalidate: number;\n /** Monotonic clock (ms) — injected for testability; production passes `() => Date.now()`. */\n readonly now: () => number;\n /** Cache key for a request. Default: `origin + pathname + search` so host-routed apps do not share\n * entries across tenants. Return `null` to bypass the cache for this request (it goes straight to the\n * app, uncached). */\n readonly key?: (req: Request) => string | null;\n /** Draft/preview secret (the same one given to `createWebApp({ draftSecret })` + `enableDraft`). When\n * set, a request carrying a valid signed draft cookie **bypasses the cache** — editors always render\n * fresh, and a draft render is never written to the store (it can't poison the public cache). */\n readonly draftSecret?: string;\n}"
|
|
4613
5377
|
},
|
|
5378
|
+
{
|
|
5379
|
+
"name": "isRouteDataEnvelope",
|
|
5380
|
+
"kind": "function",
|
|
5381
|
+
"package": "@nifrajs/web",
|
|
5382
|
+
"signature": "export declare function isRouteDataEnvelope(value: unknown): value is RouteDataEnvelope;",
|
|
5383
|
+
"doc": "/** Recognise the envelope without mistaking a plain loader object that happens to have a `data` key. */"
|
|
5384
|
+
},
|
|
4614
5385
|
{
|
|
4615
5386
|
"name": "ISRPlatform",
|
|
4616
5387
|
"kind": "interface",
|
|
@@ -4891,6 +5662,13 @@
|
|
|
4891
5662
|
"package": "@nifrajs/middleware",
|
|
4892
5663
|
"signature": "export interface LanguageOptions<L extends readonly string[]> {\n readonly supported: L;\n readonly defaultLanguage: L[number];\n /** Emit `Content-Language`. Default `true`. */\n readonly header?: boolean;\n}"
|
|
4893
5664
|
},
|
|
5665
|
+
{
|
|
5666
|
+
"name": "LAYOUT_DATA_GLOBAL",
|
|
5667
|
+
"kind": "const",
|
|
5668
|
+
"package": "@nifrajs/web",
|
|
5669
|
+
"signature": "export declare const LAYOUT_DATA_GLOBAL = \"__NIFRA_LAYOUT_DATA__\";",
|
|
5670
|
+
"doc": "/** Per-layout loader data for hydration. Emitted ONLY when some layout in the chain has a loader, so\n * a page-only app's HTML is byte-identical to before layout loaders existed. */"
|
|
5671
|
+
},
|
|
4894
5672
|
{
|
|
4895
5673
|
"name": "LayoutEntry",
|
|
4896
5674
|
"kind": "interface",
|
|
@@ -4898,6 +5676,13 @@
|
|
|
4898
5676
|
"signature": "export interface LayoutEntry {\n readonly file: string;\n readonly load: () => Promise<{\n default: unknown;\n meta?: MetaInput;\n }>;\n}",
|
|
4899
5677
|
"doc": "/** A layout (or `_404`/`_error`) entry: its source file (for client codegen) + a lazy loader.\n *\n * A `_layout.tsx` may export `meta` (static {@link Meta} or a function of the loader data + params,\n * same shape as a route's) to contribute sitewide `<head>` tags — `hreflang`/`preconnect`/etc. that\n * belong on every page under the layout. The layout chain's heads merge with the page's: arrays\n * (`meta`/`link`) concatenate outermost→innermost→page; scalars (`title`) are nearest-wins (the page\n * overrides an inner layout, which overrides an outer one). See `mergeHeads` in `@nifrajs/web`. */"
|
|
4900
5678
|
},
|
|
5679
|
+
{
|
|
5680
|
+
"name": "LeakGuardPlugin",
|
|
5681
|
+
"kind": "interface",
|
|
5682
|
+
"package": "@nifrajs/web",
|
|
5683
|
+
"signature": "export interface LeakGuardPlugin {\n readonly name: string;\n /**\n * The finding that failed the build, or `undefined` when the bundle was clean.\n *\n * Recorded as well as thrown because the throw does not reliably survive. A plugin error is handed to\n * the bundler, which builds its own error to report it, and on some Bun + rolldown combinations that\n * construction itself fails (`Error.captureStackTrace` rejecting a non-Error) - so what surfaces is an\n * internal complaint naming neither the leaked module nor its import chain. A caller that owns the\n * build can read this afterwards and raise the real message from its own code, where nothing can\n * rewrite it. A leak is the one failure that must stay legible: the whole point is naming what\n * reached the browser.\n */\n leak?: string;\n generateBundle(this: RollupPluginContext, options: unknown, bundle: RollupBundleLike): void;\n}",
|
|
5684
|
+
"doc": "/** The minimal Rollup plugin shape this returns — `generateBundle` bound to the plugin context. */"
|
|
5685
|
+
},
|
|
4901
5686
|
{
|
|
4902
5687
|
"name": "LedgerSink",
|
|
4903
5688
|
"kind": "type",
|
|
@@ -4926,6 +5711,20 @@
|
|
|
4926
5711
|
"signature": "export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n /** Same-origin destination path (e.g. `/users/7?tab=posts`). Rendered as the `<a href>`. */\n readonly to: string;\n /** Replace the current history entry instead of pushing. */\n readonly replace?: boolean;\n}",
|
|
4927
5712
|
"doc": "/** {@link Link} props: every `<a>` attribute except `href` (set from `to`), plus `to` + `replace`. */"
|
|
4928
5713
|
},
|
|
5714
|
+
{
|
|
5715
|
+
"name": "listenOrExplain",
|
|
5716
|
+
"kind": "function",
|
|
5717
|
+
"package": "@nifrajs/web",
|
|
5718
|
+
"signature": "export declare function listenOrExplain(server: ListenTarget, port: number): Promise<void>;",
|
|
5719
|
+
"doc": "/**\n * `listen`, but a bind failure becomes a readable nifra error instead of Node's raw internal throw.\n *\n * Without an `error` listener attached, Node throws from deep inside `node:events`, the new process dies\n * in the background, and nothing connects that death to the stale page in front of you.\n */"
|
|
5720
|
+
},
|
|
5721
|
+
{
|
|
5722
|
+
"name": "ListenTarget",
|
|
5723
|
+
"kind": "interface",
|
|
5724
|
+
"package": "@nifrajs/web",
|
|
5725
|
+
"signature": "export interface ListenTarget {\n listen(port: number, cb: () => void): void;\n once(event: \"error\", cb: (err: unknown) => void): void;\n removeListener(event: \"error\", cb: (err: unknown) => void): void;\n}",
|
|
5726
|
+
"doc": "/** The bits of a Node server {@link listenOrExplain} touches — structural, so a test can fake it. */"
|
|
5727
|
+
},
|
|
4929
5728
|
{
|
|
4930
5729
|
"name": "ListOptions",
|
|
4931
5730
|
"kind": "interface",
|
|
@@ -4982,7 +5781,7 @@
|
|
|
4982
5781
|
"name": "LoadedApp",
|
|
4983
5782
|
"kind": "interface",
|
|
4984
5783
|
"package": "@nifrajs/cli",
|
|
4985
|
-
"signature": "export interface LoadedApp {\n readonly cwd: string;\n readonly routesDir: string;\n /** Build output dir (also where `nifra start` reads `manifest.json` + serves `/assets/*`). */\n readonly outDir: string;\n readonly framework: NifraFramework;\n /** The `backend` export from `backend.ts`, or `undefined` if there's no `backend.ts`. */\n readonly backend: unknown;\n}"
|
|
5784
|
+
"signature": "export interface LoadedApp {\n readonly cwd: string;\n readonly routesDir: string;\n /** Build output dir (also where `nifra start` reads `manifest.json` + serves `/assets/*`). */\n readonly outDir: string;\n readonly framework: NifraFramework;\n /** Plugin thunks resolved exactly once during app loading and reused by every command phase. */\n readonly resolvedPlugins: ResolvedPlugins;\n /** The `backend` export from `backend.ts`, or `undefined` if there's no `backend.ts`. */\n readonly backend: unknown;\n}"
|
|
4986
5785
|
},
|
|
4987
5786
|
{
|
|
4988
5787
|
"name": "Loader",
|
|
@@ -5124,7 +5923,7 @@
|
|
|
5124
5923
|
"name": "Manifest",
|
|
5125
5924
|
"kind": "interface",
|
|
5126
5925
|
"package": "@nifrajs/web",
|
|
5127
|
-
"signature": "export interface Manifest {\n readonly routes: readonly RouteEntry[];\n readonly layouts: Readonly<Record<string, LayoutEntry>>;\n /** Per-segment `_error` boundary components, keyed by id (`_error`, `a/_error`, …). Always set by\n * `buildManifest` (optional only so hand-built test manifests may omit it). */\n readonly errors?: Readonly<Record<string, LayoutEntry>>;\n readonly notFound?: LayoutEntry;\n}",
|
|
5926
|
+
"signature": "export interface Manifest {\n readonly routes: readonly RouteEntry[];\n readonly layouts: Readonly<Record<string, LayoutEntry>>;\n /** Per-segment `_error` boundary components, keyed by id (`_error`, `a/_error`, …). Always set by\n * `buildManifest` (optional only so hand-built test manifests may omit it). */\n readonly errors?: Readonly<Record<string, LayoutEntry>>;\n readonly notFound?: LayoutEntry;\n /** Per-status terminal pages from `_<status>.tsx` at the routes root (`_410`, `_451`, …), keyed by\n * the status as a string. Rendered by a loader's `gone()` / `statusPage(n)`; a status with no page\n * falls back to `_404`, and then to plain text. `_404` itself stays on {@link notFound} - it is\n * reached by unmatched paths too, which these are not. */\n readonly statusPages?: Readonly<Record<string, LayoutEntry>>;\n}",
|
|
5128
5927
|
"doc": "/** The full route manifest. */"
|
|
5129
5928
|
},
|
|
5130
5929
|
{
|
|
@@ -5147,6 +5946,50 @@
|
|
|
5147
5946
|
"signature": "export declare const MAP_DEFERRED_SOURCE = \"const mapDeferred = (d) => {\\n if (!d || typeof d !== \\\"object\\\") return d\\n if (typeof d.__nifra_deferred === \\\"number\\\") return { __nifra_deferred: true, id: d.__nifra_deferred, promise: window.__nifraDeferred(d.__nifra_deferred) }\\n if (Array.isArray(d)) return d.map(mapDeferred)\\n const out = {}\\n for (const k in d) out[k] = mapDeferred(d[k])\\n return out\\n}\";",
|
|
5148
5947
|
"doc": "/**\n * Source emitted into the generated client entry: maps serialized `{__nifra_deferred: id}` placeholders\n * (at any depth — nested objects/arrays) to the registry's promises, so the component receives real\n * promises to `<Await>`. A no-op for data without placeholders (so non-deferred pages are unchanged).\n */"
|
|
5149
5948
|
},
|
|
5949
|
+
{
|
|
5950
|
+
"name": "markBeaconEffectBegan",
|
|
5951
|
+
"kind": "function",
|
|
5952
|
+
"package": "@nifrajs/core",
|
|
5953
|
+
"signature": "export declare function markBeaconEffectBegan(context: object): void;",
|
|
5954
|
+
"doc": "/** A legacy beacon cannot prove what happens after the call, so it is immediately ambiguous. */"
|
|
5955
|
+
},
|
|
5956
|
+
{
|
|
5957
|
+
"name": "markEffect",
|
|
5958
|
+
"kind": "function",
|
|
5959
|
+
"package": "@nifrajs/core",
|
|
5960
|
+
"signature": "export declare function markEffect(context: object, committed: boolean): void;"
|
|
5961
|
+
},
|
|
5962
|
+
{
|
|
5963
|
+
"name": "markEffectAmbiguous",
|
|
5964
|
+
"kind": "function",
|
|
5965
|
+
"package": "@nifrajs/core",
|
|
5966
|
+
"signature": "export declare function markEffectAmbiguous(context: object): void;"
|
|
5967
|
+
},
|
|
5968
|
+
{
|
|
5969
|
+
"name": "markEffectCommitted",
|
|
5970
|
+
"kind": "function",
|
|
5971
|
+
"package": "@nifrajs/core",
|
|
5972
|
+
"signature": "export declare function markEffectCommitted(context: object): void;"
|
|
5973
|
+
},
|
|
5974
|
+
{
|
|
5975
|
+
"name": "markEffectExecuting",
|
|
5976
|
+
"kind": "function",
|
|
5977
|
+
"package": "@nifrajs/core",
|
|
5978
|
+
"signature": "export declare function markEffectExecuting(context: object): void;"
|
|
5979
|
+
},
|
|
5980
|
+
{
|
|
5981
|
+
"name": "markIdempotencySafeToRetry",
|
|
5982
|
+
"kind": "function",
|
|
5983
|
+
"package": "@nifrajs/core",
|
|
5984
|
+
"signature": "export declare function markIdempotencySafeToRetry(context: object): void;",
|
|
5985
|
+
"doc": "/**\n * Opt a concrete 5xx response into releasing its idempotency reservation, but only while the\n * request-local effect scope still proves that no owned effect began.\n */"
|
|
5986
|
+
},
|
|
5987
|
+
{
|
|
5988
|
+
"name": "markRequestSafeToRetry",
|
|
5989
|
+
"kind": "function",
|
|
5990
|
+
"package": "@nifrajs/core",
|
|
5991
|
+
"signature": "export declare function markRequestSafeToRetry(context: object): void;"
|
|
5992
|
+
},
|
|
5150
5993
|
{
|
|
5151
5994
|
"name": "matches",
|
|
5152
5995
|
"kind": "function",
|
|
@@ -5410,6 +6253,12 @@
|
|
|
5410
6253
|
"signature": "export interface McpWidget {\n readonly uri: string;\n readonly resource: McpResource;\n readonly meta: Record<string, unknown>;\n}",
|
|
5411
6254
|
"doc": "/** A widget: the resource to register on the server, its `ui://` URI, and the `_meta` link for its tool. */"
|
|
5412
6255
|
},
|
|
6256
|
+
{
|
|
6257
|
+
"name": "MemoryApprovalStore",
|
|
6258
|
+
"kind": "class",
|
|
6259
|
+
"package": "@nifrajs/core",
|
|
6260
|
+
"signature": "export declare class MemoryApprovalStore implements ApprovalStore {\n readonly durability: \"memory\";\n private readonly records;\n create(record: ApprovalRecord): boolean;\n get(approvalId: string): ApprovalRecord | undefined;\n decide(input: Parameters<ApprovalStore[\"decide\"]>[0]): boolean;\n consume(input: Parameters<ApprovalStore[\"consume\"]>[0]): ApprovalConsumeResult;\n list(): readonly ApprovalRecord[];\n}"
|
|
6261
|
+
},
|
|
5413
6262
|
{
|
|
5414
6263
|
"name": "MemoryCache",
|
|
5415
6264
|
"kind": "class",
|
|
@@ -5441,6 +6290,19 @@
|
|
|
5441
6290
|
"package": "@nifrajs/core",
|
|
5442
6291
|
"signature": "export interface MemoryCausalityStoreOptions {\n /** Global record bound. Default 10,000. */\n readonly maxRecords?: number;\n /** In-memory evidence disappears on restart and is rejected in production unless explicitly allowed. */\n readonly allowInProduction?: boolean;\n}"
|
|
5443
6292
|
},
|
|
6293
|
+
{
|
|
6294
|
+
"name": "MemoryDurableEffectStore",
|
|
6295
|
+
"kind": "class",
|
|
6296
|
+
"package": "@nifrajs/core",
|
|
6297
|
+
"signature": "export declare class MemoryDurableEffectStore implements DurableEffectStore {\n readonly durability: \"memory\";\n private readonly records;\n private readonly byState;\n create(record: DurableEffectRecord): boolean;\n get(effectId: string): DurableEffectRecord | undefined;\n transition(input: Parameters<DurableEffectStore[\"transition\"]>[0]): boolean;\n list(): readonly DurableEffectRecord[];\n scan(input: ReconciliationScanOptions<DurableEffectState>): ReconciliationScanPage<DurableEffectRecord>;\n}"
|
|
6298
|
+
},
|
|
6299
|
+
{
|
|
6300
|
+
"name": "MemoryDurableRecordBackend",
|
|
6301
|
+
"kind": "class",
|
|
6302
|
+
"package": "@nifrajs/core",
|
|
6303
|
+
"signature": "export declare class MemoryDurableRecordBackend implements DurableRecordBackend {\n private readonly records;\n private readonly leases;\n private key;\n create(kind: DurableRecordKind, id: string, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n get<T extends {\n readonly version: number;\n }>(kind: DurableRecordKind, id: string): Promise<T | undefined>;\n compareAndSet(kind: DurableRecordKind, id: string, expectedVersion: number, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n scan<T extends {\n readonly state: string;\n readonly updatedAt: number;\n }>(kind: DurableRecordKind, input: ReconciliationScanOptions<string>): Promise<ReconciliationScanPage<T>>;\n acquireLease(input: Parameters<DurableRecordBackend[\"acquireLease\"]>[0]): Promise<ReconciliationLease | undefined>;\n renewLease(input: Parameters<DurableRecordBackend[\"renewLease\"]>[0]): Promise<boolean>;\n checkpointLease(input: Parameters<DurableRecordBackend[\"checkpointLease\"]>[0]): Promise<boolean>;\n releaseLease(input: Parameters<DurableRecordBackend[\"releaseLease\"]>[0]): Promise<boolean>;\n}",
|
|
6304
|
+
"doc": "/** Deterministic reference backend for tests and adapter conformance; not for production. */"
|
|
6305
|
+
},
|
|
5444
6306
|
{
|
|
5445
6307
|
"name": "MemoryIdempotencyStore",
|
|
5446
6308
|
"kind": "class",
|
|
@@ -5486,6 +6348,12 @@
|
|
|
5486
6348
|
"package": "@nifrajs/core",
|
|
5487
6349
|
"signature": "export interface MemoryLedgerSinkOptions {\n /** Retain at most this many sealed ledgers (oldest evicted first). Default 1000. */\n readonly maxLedgers?: number;\n}"
|
|
5488
6350
|
},
|
|
6351
|
+
{
|
|
6352
|
+
"name": "MemoryReconciliationLeaseStore",
|
|
6353
|
+
"kind": "class",
|
|
6354
|
+
"package": "@nifrajs/core",
|
|
6355
|
+
"signature": "export declare class MemoryReconciliationLeaseStore implements ReconciliationLeaseStore {\n readonly durability: \"memory\";\n private readonly records;\n acquire(input: Parameters<ReconciliationLeaseStore[\"acquire\"]>[0]): ReconciliationLease | undefined;\n renew(input: Parameters<ReconciliationLeaseStore[\"renew\"]>[0]): boolean;\n checkpoint(input: Parameters<ReconciliationLeaseStore[\"checkpoint\"]>[0]): boolean;\n release(input: Parameters<ReconciliationLeaseStore[\"release\"]>[0]): boolean;\n}"
|
|
6356
|
+
},
|
|
5489
6357
|
{
|
|
5490
6358
|
"name": "MemoryResponseCache",
|
|
5491
6359
|
"kind": "class",
|
|
@@ -5498,6 +6366,12 @@
|
|
|
5498
6366
|
"package": "@nifrajs/middleware",
|
|
5499
6367
|
"signature": "export interface MemoryResponseCacheOptions {\n /** Maximum entries retained. Default `1000`. Oldest entries are evicted first. */\n readonly maxEntries?: number;\n /** Allow in-process cache in production. Off by default because it is per-instance. */\n readonly allowInProduction?: boolean;\n}"
|
|
5500
6368
|
},
|
|
6369
|
+
{
|
|
6370
|
+
"name": "MemorySagaStore",
|
|
6371
|
+
"kind": "class",
|
|
6372
|
+
"package": "@nifrajs/core",
|
|
6373
|
+
"signature": "export declare class MemorySagaStore implements SagaStore {\n readonly durability: \"memory\";\n private readonly records;\n private readonly byState;\n create(record: SagaRecord): boolean;\n get(sagaId: string): SagaRecord | undefined;\n compareAndSet(input: Parameters<SagaStore[\"compareAndSet\"]>[0]): boolean;\n list(): readonly SagaRecord[];\n scan(input: ReconciliationScanOptions<SagaState>): ReconciliationScanPage<SagaRecord>;\n}"
|
|
6374
|
+
},
|
|
5501
6375
|
{
|
|
5502
6376
|
"name": "MemorySessionStore",
|
|
5503
6377
|
"kind": "class",
|
|
@@ -5548,7 +6422,7 @@
|
|
|
5548
6422
|
"name": "Meta",
|
|
5549
6423
|
"kind": "interface",
|
|
5550
6424
|
"package": "@nifrajs/web",
|
|
5551
|
-
"signature": "export interface Meta {\n readonly title?: string;\n readonly meta?: ReadonlyArray<Record<string, string>>;\n readonly link?: readonly LinkDescriptor[];\n /** Inert head `<script>`s (JSON-LD structured data, etc.). See {@link ScriptDescriptor}. */\n readonly script?: readonly ScriptDescriptor[];\n}",
|
|
6425
|
+
"signature": "export interface Meta {\n readonly title?: string;\n readonly meta?: ReadonlyArray<Record<string, string>>;\n readonly link?: readonly LinkDescriptor[];\n /** Inert head `<script>`s (JSON-LD structured data, etc.). See {@link ScriptDescriptor}. */\n readonly script?: readonly ScriptDescriptor[];\n /**\n * The document language — `<html lang=\"...\">`. Nearest-wins like `title`, so a localized route can\n * override a layout's default. Defaults to `\"en\"` when no head in the chain sets it.\n *\n * This is the ONLY way to set it: the shell's `<html>` is framework-owned, so a multilingual app\n * otherwise serves every URL as `lang=\"en\"` — which tells a screen reader to pronounce every locale\n * with an English voice, and suppresses the browser's translation offer.\n */\n readonly lang?: string;\n /**\n * The document writing direction — `<html dir=\"...\">`. Nearest-wins like `title`. Omitted from the\n * shell when unset, which is HTML's `ltr` default, so an LTR app's output is byte-identical.\n *\n * Required for Arabic/Hebrew/Urdu/Persian: without it the browser lays the page out left-to-right\n * and mis-orders trailing punctuation, so the text renders wrong rather than merely unstyled.\n */\n readonly dir?: \"ltr\" | \"rtl\" | \"auto\";\n}",
|
|
5552
6426
|
"doc": "/**\n * The document head a route contributes — title + `<meta>`/`<link>`/`<script>` tag sets. Returned by a\n * route/layout `meta` (statically, or from a {@link MetaArgs} function). Every value is serialized into\n * managed (`data-nifra`) head tags: attribute *names* are shape-validated and *values* HTML-escaped at\n * render (see `tagAttrs`/`headTags` in `@nifrajs/web`), and `script[].content` is breakout-escaped — so\n * loader-derived strings (LLM-authored `og:*`, user content) are XSS-safe in the head by construction.\n * Layout-chain heads merge with the page's via `mergeHeads` (arrays concat outermost→page; `title` is\n * nearest-wins). Build `og:*`/`twitter:*` with `openGraph(...)`, canonical with `canonical(...)`, and\n * JSON-LD with `jsonLd(...)` (all from `@nifrajs/web`) rather than hand-writing the records.\n */"
|
|
5553
6427
|
},
|
|
5554
6428
|
{
|
|
@@ -5625,6 +6499,20 @@
|
|
|
5625
6499
|
"signature": "export declare const MIN_DIGEST_KEY_BYTES = 16;",
|
|
5626
6500
|
"doc": "/** Minimum digest key material. A short key would make the keyed digest brute-forceable. */"
|
|
5627
6501
|
},
|
|
6502
|
+
{
|
|
6503
|
+
"name": "MixedPart",
|
|
6504
|
+
"kind": "type",
|
|
6505
|
+
"package": "@nifrajs/core",
|
|
6506
|
+
"signature": "export type MixedPart = {\n readonly t: \"lit\";\n readonly v: string;\n} | {\n readonly t: \"param\";\n readonly name: string;\n};",
|
|
6507
|
+
"doc": "/** One piece of a {@link RoutePatternSegment} of kind `mixed`, in left-to-right order. */"
|
|
6508
|
+
},
|
|
6509
|
+
{
|
|
6510
|
+
"name": "mixedSegmentSource",
|
|
6511
|
+
"kind": "function",
|
|
6512
|
+
"package": "@nifrajs/core",
|
|
6513
|
+
"signature": "export declare function mixedSegmentSource(parts: readonly MixedPart[]): string;",
|
|
6514
|
+
"doc": "/** The regex source matching one segment's worth of a mixed pattern, with a capture per parameter. */"
|
|
6515
|
+
},
|
|
5628
6516
|
{
|
|
5629
6517
|
"name": "MockableApp",
|
|
5630
6518
|
"kind": "interface",
|
|
@@ -5770,6 +6658,13 @@
|
|
|
5770
6658
|
"signature": "export declare function namedCombine(name: string, ...items: readonly Composable[]): NifraPlugin;",
|
|
5771
6659
|
"doc": "/** Compose middleware/plugins into one idempotent named bundle. */"
|
|
5772
6660
|
},
|
|
6661
|
+
{
|
|
6662
|
+
"name": "NAV_FROM_HEADER",
|
|
6663
|
+
"kind": "const",
|
|
6664
|
+
"package": "@nifrajs/web",
|
|
6665
|
+
"signature": "export declare const NAV_FROM_HEADER = \"x-nifra-from\";",
|
|
6666
|
+
"doc": "/**\n * The path a client navigation is coming FROM, sent on the data-mode GET.\n *\n * Lets the SERVER decide which layout loaders to skip: it already knows each layout's scoped params\n * (derived at build time), so given both paths it can tell whether a layout's own prefix changed.\n * Doing it server-side means the client never needs the scope table, and the decision lives next to\n * the data it is about.\n *\n * Sent only when the client actually holds layout data to retain, so a request without it is simply\n * the full-chain case.\n */"
|
|
6667
|
+
},
|
|
5773
6668
|
{
|
|
5774
6669
|
"name": "Navigate",
|
|
5775
6670
|
"kind": "function",
|
|
@@ -5830,7 +6725,7 @@
|
|
|
5830
6725
|
"name": "ndjsonStream",
|
|
5831
6726
|
"kind": "function",
|
|
5832
6727
|
"package": "@nifrajs/web",
|
|
5833
|
-
"signature": "export declare function ndjsonStream(forClient: unknown, deferred: ReadonlyArray<{\n readonly id: number;\n readonly promise: Promise<unknown>;\n}
|
|
6728
|
+
"signature": "export declare function ndjsonStream(forClient: unknown, deferred: ReadonlyArray<{\n readonly id: number;\n readonly promise: Promise<unknown>;\n}>, codec?: TransportCodec): ReadableStream<Uint8Array>;",
|
|
5834
6729
|
"doc": "/**\n * Stream a loader result as NDJSON for a client (soft) navigation: line 1 is the critical data with\n * `{__nifra_deferred: id}` placeholders (`forClient`), then one line per deferred as its promise\n * settles — `{\"i\": id, \"v\": value}` on resolve, `{\"i\": id, \"e\": \"deferred_error\"}` on reject (a\n * rejection is data, not a stream error; the opaque code never leaks the raw reason). Closes when all\n * settle. The client (`defaultFetchData`) returns the\n * data after line 1 and settles `<Await>`'s markers as the resolution lines arrive. `JSON.stringify`\n * escapes newlines in values, so each line is NDJSON-safe; no HTML escaping (this is a fetch body,\n * parsed with `JSON.parse`, never injected into markup).\n */"
|
|
5835
6730
|
},
|
|
5836
6731
|
{
|
|
@@ -5884,7 +6779,7 @@
|
|
|
5884
6779
|
"name": "NifraFramework",
|
|
5885
6780
|
"kind": "interface",
|
|
5886
6781
|
"package": "@nifrajs/cli",
|
|
5887
|
-
"signature": "export interface NifraFramework {\n /** The render adapter, e.g. `reactAdapter` from `@nifrajs/web-react`. */\n readonly adapter: unknown;\n /** The client runtime module providing `mountRouter`, e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Vite plugins for `nifra dev`'s HMR, e.g. `[react()]` / `() => import(\"@vitejs/plugin-vue\")…`. */\n readonly vitePlugins?: PluginsField;\n /** Bun build plugins that compile routes for the CLIENT bundle (`nifra build`), e.g.\n * `[vueBunPlugin(\"dom\")]`. React/Preact JSX is Bun-native → none. */\n readonly clientPlugins?: PluginsField;\n /** Bun runtime plugins that compile routes for SSR — `nifra dev` (Bun-native route import) and\n * `nifra start` register them via `Bun.plugin`, e.g. `[vueBunPlugin(\"ssr\")]`. React/Preact → none. */\n readonly serverPlugins?: PluginsField;\n /** Extra Bun.build / Vite resolve conditions, e.g. Solid's `[\"solid\"]`. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements, e.g. Vue's `__VUE_*` flags. */\n readonly define?: Readonly<Record<string, string>>;\n}",
|
|
6782
|
+
"signature": "export interface NifraFramework {\n /** The render adapter, e.g. `reactAdapter` from `@nifrajs/web-react`. */\n readonly adapter: unknown;\n /** The client runtime module providing `mountRouter`, e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Vite plugins for `nifra dev`'s HMR, e.g. `[react()]` / `() => import(\"@vitejs/plugin-vue\")…`. */\n readonly vitePlugins?: PluginsField;\n /** Bun build plugins that compile routes for the CLIENT bundle (`nifra build`), e.g.\n * `[vueBunPlugin(\"dom\")]`. React/Preact JSX is Bun-native → none. */\n readonly clientPlugins?: PluginsField;\n /** Bun runtime plugins that compile routes for SSR — `nifra dev` (Bun-native route import) and\n * `nifra start` register them via `Bun.plugin`, e.g. `[vueBunPlugin(\"ssr\")]`. React/Preact → none. */\n readonly serverPlugins?: PluginsField;\n /** Extra Bun.build / Vite resolve conditions, e.g. Solid's `[\"solid\"]`. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements, e.g. Vue's `__VUE_*` flags. */\n readonly define?: Readonly<Record<string, string>>;\n /** Static files directory. Defaults to `<app>/public`; `false` disables it. */\n readonly publicDir?: string | false;\n /** Client-visible environment prefix (default `\"PUBLIC_\"`; empty disables exposure). */\n readonly publicEnvPrefix?: string;\n}",
|
|
5888
6783
|
"doc": "/**\n * The CLI's framework wiring — exported from `nifra.config.ts` (or `framework.ts` as a fallback).\n * `create-nifra` generates it. Only `adapter` + `clientModule` are required; the plugin/condition\n * fields are framework-specific extras (Vue/Svelte/Solid need them; React/Preact don't).\n */"
|
|
5889
6784
|
},
|
|
5890
6785
|
{
|
|
@@ -6030,6 +6925,13 @@
|
|
|
6030
6925
|
"package": "@nifrajs/node",
|
|
6031
6926
|
"signature": "export interface NodeServer {\n /** The bound port (resolved when `port: 0` is requested). */\n readonly port: number;\n /**\n * Stop accepting connections, let in-flight requests drain (up to `drainMs`), then\n * force-close stragglers + idle keep-alives. Mirrors nifra's Bun `stop()`.\n */\n stop(options?: {\n drainMs?: number;\n }): Promise<void>;\n}"
|
|
6032
6927
|
},
|
|
6928
|
+
{
|
|
6929
|
+
"name": "normalizeEffectMetadata",
|
|
6930
|
+
"kind": "function",
|
|
6931
|
+
"package": "@nifrajs/core",
|
|
6932
|
+
"signature": "export declare function normalizeEffectMetadata(input: EffectMetadata): EffectMetadata;",
|
|
6933
|
+
"doc": "/** Validate, copy, and freeze token-only effect metadata before it reaches a ledger or policy hook. */"
|
|
6934
|
+
},
|
|
6033
6935
|
{
|
|
6034
6936
|
"name": "normalizeRolldownPlugins",
|
|
6035
6937
|
"kind": "function",
|
|
@@ -6043,6 +6945,13 @@
|
|
|
6043
6945
|
"package": "@nifrajs/core",
|
|
6044
6946
|
"signature": "export declare function normalizeRouteCapabilities(values: readonly string[] | undefined): readonly string[];"
|
|
6045
6947
|
},
|
|
6948
|
+
{
|
|
6949
|
+
"name": "notFound",
|
|
6950
|
+
"kind": "function",
|
|
6951
|
+
"package": "@nifrajs/web",
|
|
6952
|
+
"signature": "export declare function notFound(options?: StatusPageOptions): never;",
|
|
6953
|
+
"doc": "/**\n * Render the nearest `_404` page at status **404**. `throw` it from a loader when the record does not\n * exist.\n *\n * This is the fix for the soft 404: a matched route whose loader finds nothing has otherwise no way to\n * answer 404, so the path of least resistance is to return empty data and render \"not found\" inside a\n * **200**. That looks correct in a browser and is invisible in review, which is why it ships and stays\n * shipped - while search engines penalise it and keep the dead URL indexed.\n *\n * Returns `never`: these throw, so a loader narrows without a redundant `return`, and the type states\n * the thing the \"loaders `throw` redirect, actions `return` it\" rule already trips people on.\n */"
|
|
6954
|
+
},
|
|
6046
6955
|
{
|
|
6047
6956
|
"name": "number",
|
|
6048
6957
|
"kind": "function",
|
|
@@ -6235,6 +7144,24 @@
|
|
|
6235
7144
|
"signature": "export type OutputOf<H extends (...args: never[]) => unknown> = Exclude<Awaited<ReturnType<H>>, Response>;",
|
|
6236
7145
|
"doc": "/** The client-visible output of a handler: its awaited return, minus raw `Response`. */"
|
|
6237
7146
|
},
|
|
7147
|
+
{
|
|
7148
|
+
"name": "OwnedEffectContext",
|
|
7149
|
+
"kind": "interface",
|
|
7150
|
+
"package": "@nifrajs/core",
|
|
7151
|
+
"signature": "export interface OwnedEffectContext extends EffectMetadata {\n readonly effectId: string;\n readonly capability: string;\n readonly stage: Exclude<EffectLifecycleStage, \"admission\" | \"reconciliation\">;\n readonly signal: AbortSignal;\n readonly attempt?: number;\n}"
|
|
7152
|
+
},
|
|
7153
|
+
{
|
|
7154
|
+
"name": "OwnedEffectRunOptions",
|
|
7155
|
+
"kind": "interface",
|
|
7156
|
+
"package": "@nifrajs/core",
|
|
7157
|
+
"signature": "export interface OwnedEffectRunOptions<T> extends EffectMetadata {\n readonly effectId?: string;\n readonly capability: string;\n readonly stage?: Exclude<EffectLifecycleStage, \"admission\" | \"reconciliation\">;\n readonly signal?: AbortSignal;\n readonly attempt?: number;\n readonly trace?: EffectTraceParent;\n /** Per-run observers, combined with the scope's observers. */\n readonly observers?: readonly EffectLifecycleObserver[];\n /** Optional admission boundary executed before the effect is marked as begun. */\n readonly admit?: (context: OwnedEffectContext) => void | PromiseLike<void>;\n readonly transitions?: OwnedEffectTransitions<T>;\n readonly errorCode?: string | ((error: unknown, began: boolean) => string);\n /** Classify a caught execution failure when the caller can prove it is terminal. */\n readonly failurePhase?: (error: unknown, began: boolean) => \"failed\" | \"ambiguous\";\n}"
|
|
7158
|
+
},
|
|
7159
|
+
{
|
|
7160
|
+
"name": "OwnedEffectTransitions",
|
|
7161
|
+
"kind": "interface",
|
|
7162
|
+
"package": "@nifrajs/core",
|
|
7163
|
+
"signature": "export interface OwnedEffectTransitions<T> {\n intent?(context: OwnedEffectContext): void | PromiseLike<void>;\n executing?(context: OwnedEffectContext): void | PromiseLike<void>;\n committed?(context: OwnedEffectContext, result: T): void | PromiseLike<void>;\n failed?(context: OwnedEffectContext, input: {\n readonly began: boolean;\n readonly errorCode: string;\n readonly error: unknown;\n }): void | PromiseLike<void>;\n}"
|
|
7164
|
+
},
|
|
6238
7165
|
{
|
|
6239
7166
|
"name": "packageOf",
|
|
6240
7167
|
"kind": "function",
|
|
@@ -6283,6 +7210,13 @@
|
|
|
6283
7210
|
"package": "@nifrajs/core",
|
|
6284
7211
|
"signature": "export type Params<Path extends string> = Prettify<RawParams<Path>>;"
|
|
6285
7212
|
},
|
|
7213
|
+
{
|
|
7214
|
+
"name": "parse",
|
|
7215
|
+
"kind": "function",
|
|
7216
|
+
"package": "@nifrajs/core",
|
|
7217
|
+
"signature": "export declare function parse(text: string, limits?: WireDecodeLimits): unknown;",
|
|
7218
|
+
"doc": "/** `JSON.parse` + `decode` in one call - the rich-type equivalent of `JSON.parse`. */"
|
|
7219
|
+
},
|
|
6286
7220
|
{
|
|
6287
7221
|
"name": "parseArgs",
|
|
6288
7222
|
"kind": "function",
|
|
@@ -6343,6 +7277,20 @@
|
|
|
6343
7277
|
"signature": "export declare function parseDeadlineHeader(headers: Headers): DeadlineHeaderResult;",
|
|
6344
7278
|
"doc": "/** Parse the canonical deadline header without trusting or clamping it. */"
|
|
6345
7279
|
},
|
|
7280
|
+
{
|
|
7281
|
+
"name": "parseDevEntry",
|
|
7282
|
+
"kind": "function",
|
|
7283
|
+
"package": "@nifrajs/web",
|
|
7284
|
+
"signature": "export declare function parseDevEntry(html: string): DevEntryMatch | undefined;",
|
|
7285
|
+
"doc": "/**\n * Find the bundled client-entry URL in a page Bun's dev server rendered. Pure - the whole format\n * dependency lives in this function, which is what makes it testable against captured real output.\n *\n * Returns `undefined` rather than throwing so the caller can attach the context a useful error needs\n * (which URL was probed, what the server returned).\n */"
|
|
7286
|
+
},
|
|
7287
|
+
{
|
|
7288
|
+
"name": "parseDevStyles",
|
|
7289
|
+
"kind": "function",
|
|
7290
|
+
"package": "@nifrajs/web",
|
|
7291
|
+
"signature": "export declare function parseDevStyles(html: string): string[];",
|
|
7292
|
+
"doc": "/** Every stylesheet URL linked from a document, in source order. */"
|
|
7293
|
+
},
|
|
6346
7294
|
{
|
|
6347
7295
|
"name": "ParsedFontFace",
|
|
6348
7296
|
"kind": "interface",
|
|
@@ -6402,7 +7350,7 @@
|
|
|
6402
7350
|
"name": "parseNdjsonData",
|
|
6403
7351
|
"kind": "function",
|
|
6404
7352
|
"package": "@nifrajs/web",
|
|
6405
|
-
"signature": "export declare function parseNdjsonData(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): Promise<unknown>;",
|
|
7353
|
+
"signature": "export declare function parseNdjsonData(stream: ReadableStream<Uint8Array>, signal?: AbortSignal, codec?: TransportCodec): Promise<unknown>;",
|
|
6406
7354
|
"doc": "/**\n * Client side of {@link ndjsonStream} (used by the router's `defaultFetchData` on a soft nav): read\n * the NDJSON body into a data object whose deferred markers settle as resolution lines arrive.\n * Returns after **line 1** so the router can apply the critical data + render immediately; the\n * markers' promises settle/reject in the background. If the stream ends (or `signal` aborts) with\n * markers unsettled, they reject — so `<Await>` never hangs.\n */"
|
|
6407
7355
|
},
|
|
6408
7356
|
{
|
|
@@ -6473,6 +7421,32 @@
|
|
|
6473
7421
|
"signature": "export declare function pinSweepText(text: string, rules: readonly {\n match: string;\n to: string;\n}[]): {\n text: string;\n changes: Array<Omit<PinChange, \"file\">>;\n};",
|
|
6474
7422
|
"doc": "/**\n * Apply pin rules to one package.json's TEXT (format-preserving — targeted string replaces, never a\n * JSON re-serialize that would reorder keys or drop comments-as-formatting). Returns the new text and\n * the changes made.\n */"
|
|
6475
7423
|
},
|
|
7424
|
+
{
|
|
7425
|
+
"name": "PipelineDecision",
|
|
7426
|
+
"kind": "interface",
|
|
7427
|
+
"package": "@nifrajs/cli",
|
|
7428
|
+
"signature": "export interface PipelineDecision {\n readonly pipeline: BuildPipeline;\n /**\n * Why this pipeline, for the `nifra build` log line - so an auto-selected Vite build never looks\n * like the user got the default. `undefined` when the choice was the plain default or was forced.\n */\n readonly reason?: string;\n}"
|
|
7429
|
+
},
|
|
7430
|
+
{
|
|
7431
|
+
"name": "PipelineMismatch",
|
|
7432
|
+
"kind": "interface",
|
|
7433
|
+
"package": "@nifrajs/cli",
|
|
7434
|
+
"signature": "export interface PipelineMismatch {\n readonly slot: PipelineSlot;\n /** The plugin's `name`, or a positional label when it has none. */\n readonly plugin: string;\n /** The pipeline the slot feeds. */\n readonly expected: \"vite\" | \"bun\";\n /** The pipeline the plugin's hooks say it belongs to. */\n readonly actual: \"vite\" | \"bun\";\n readonly fix: string;\n}"
|
|
7435
|
+
},
|
|
7436
|
+
{
|
|
7437
|
+
"name": "PipelineSlot",
|
|
7438
|
+
"kind": "type",
|
|
7439
|
+
"package": "@nifrajs/cli",
|
|
7440
|
+
"signature": "export type PipelineSlot = \"vitePlugins\" | \"clientPlugins\" | \"serverPlugins\";",
|
|
7441
|
+
"doc": "/** Which pipeline a slot belongs to. */"
|
|
7442
|
+
},
|
|
7443
|
+
{
|
|
7444
|
+
"name": "PipelineSlots",
|
|
7445
|
+
"kind": "interface",
|
|
7446
|
+
"package": "@nifrajs/cli",
|
|
7447
|
+
"signature": "export interface PipelineSlots {\n readonly vitePlugins?: readonly unknown[];\n readonly clientPlugins?: readonly unknown[];\n readonly serverPlugins?: readonly unknown[];\n}",
|
|
7448
|
+
"doc": "/** The plugin slots a decision reads, already resolved. */"
|
|
7449
|
+
},
|
|
6476
7450
|
{
|
|
6477
7451
|
"name": "pipeWebBodyToNode",
|
|
6478
7452
|
"kind": "function",
|
|
@@ -6480,6 +7454,12 @@
|
|
|
6480
7454
|
"signature": "export declare function pipeWebBodyToNode(body: ReadableStream<Uint8Array> | null, res: NodeResLike): Promise<void>;",
|
|
6481
7455
|
"doc": "/**\n * Stream a Web `Response` body to a Node response chunk-by-chunk. Buffering the whole body (e.g.\n * `arrayBuffer()`) waits for the stream to END — which an open-ended SSE (`text/event-stream`) body never\n * does, so it hung `nifra dev` (the Bun production server streamed it fine). This flushes each chunk as it\n * arrives and cancels the reader if the client disconnects; a finite body just streams its chunk(s) + ends.\n */"
|
|
6482
7456
|
},
|
|
7457
|
+
{
|
|
7458
|
+
"name": "plainJsonCodec",
|
|
7459
|
+
"kind": "const",
|
|
7460
|
+
"package": "@nifrajs/core",
|
|
7461
|
+
"signature": "export declare const plainJsonCodec: TransportCodec;"
|
|
7462
|
+
},
|
|
6483
7463
|
{
|
|
6484
7464
|
"name": "Platform",
|
|
6485
7465
|
"kind": "interface",
|
|
@@ -6515,6 +7495,13 @@
|
|
|
6515
7495
|
"signature": "export interface PortBlock {\n readonly feature: FeatureId;\n readonly verdict: Extract<Verdict, \"unsupported\" | \"caveat\">;\n readonly reason: string;\n readonly evidence: readonly string[];\n}",
|
|
6516
7496
|
"doc": "/** One blocking finding: a detected feature unsupported on the resolved target, with its fix. */"
|
|
6517
7497
|
},
|
|
7498
|
+
{
|
|
7499
|
+
"name": "portInUseMessage",
|
|
7500
|
+
"kind": "function",
|
|
7501
|
+
"package": "@nifrajs/web",
|
|
7502
|
+
"signature": "export declare function portInUseMessage(port: number): string;",
|
|
7503
|
+
"doc": "/** The `EADDRINUSE` explanation. Exported so tests pin the exact text a user will read. */"
|
|
7504
|
+
},
|
|
6518
7505
|
{
|
|
6519
7506
|
"name": "PortJson",
|
|
6520
7507
|
"kind": "interface",
|
|
@@ -6562,6 +7549,30 @@
|
|
|
6562
7549
|
"signature": "export type PostcssProcessor = (plugins?: readonly unknown[]) => {\n process(css: string, options: {\n readonly from?: string;\n readonly to?: string;\n }): PromiseLike<{\n readonly css: string;\n }>;\n};",
|
|
6563
7550
|
"doc": "/** The subset of the `postcss` API this plugin uses (structural, so no hard dependency on its types). */"
|
|
6564
7551
|
},
|
|
7552
|
+
{
|
|
7553
|
+
"name": "PostgresClient",
|
|
7554
|
+
"kind": "interface",
|
|
7555
|
+
"package": "@nifrajs/core",
|
|
7556
|
+
"signature": "export interface PostgresClient {\n query(sql: string, values?: readonly unknown[]): Promise<PostgresQueryResult>;\n}"
|
|
7557
|
+
},
|
|
7558
|
+
{
|
|
7559
|
+
"name": "PostgresDurableExecutionAdapter",
|
|
7560
|
+
"kind": "class",
|
|
7561
|
+
"package": "@nifrajs/core",
|
|
7562
|
+
"signature": "export declare class PostgresDurableExecutionAdapter implements DurableExecutionAdapter {\n readonly effects: DurableEffectStore;\n readonly approvals: ApprovalStore;\n readonly sagas: SagaStore;\n readonly leases: ReconciliationLeaseStore;\n readonly backend: PostgresDurableRecordBackend;\n constructor(client: PostgresClient, options?: {\n readonly tablePrefix?: string;\n });\n migrate(): Promise<void>;\n}"
|
|
7563
|
+
},
|
|
7564
|
+
{
|
|
7565
|
+
"name": "PostgresDurableRecordBackend",
|
|
7566
|
+
"kind": "class",
|
|
7567
|
+
"package": "@nifrajs/core",
|
|
7568
|
+
"signature": "export declare class PostgresDurableRecordBackend implements DurableRecordBackend {\n private readonly client;\n readonly recordsTable: string;\n readonly leasesTable: string;\n constructor(client: PostgresClient, options?: {\n readonly tablePrefix?: string;\n });\n migrate(): Promise<void>;\n create(kind: DurableRecordKind, id: string, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n get<T extends {\n readonly version: number;\n }>(kind: DurableRecordKind, id: string): Promise<T | undefined>;\n compareAndSet(kind: DurableRecordKind, id: string, expectedVersion: number, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n scan<T extends {\n readonly state: string;\n readonly updatedAt: number;\n }>(kind: DurableRecordKind, input: ReconciliationScanOptions<string>): Promise<ReconciliationScanPage<T>>;\n acquireLease(input: Parameters<DurableRecordBackend[\"acquireLease\"]>[0]): Promise<ReconciliationLease | undefined>;\n renewLease(input: Parameters<DurableRecordBackend[\"renewLease\"]>[0]): Promise<boolean>;\n checkpointLease(input: Parameters<DurableRecordBackend[\"checkpointLease\"]>[0]): Promise<boolean>;\n releaseLease(input: Parameters<DurableRecordBackend[\"releaseLease\"]>[0]): Promise<boolean>;\n}"
|
|
7569
|
+
},
|
|
7570
|
+
{
|
|
7571
|
+
"name": "PostgresQueryResult",
|
|
7572
|
+
"kind": "interface",
|
|
7573
|
+
"package": "@nifrajs/core",
|
|
7574
|
+
"signature": "export interface PostgresQueryResult {\n readonly rows: readonly Record<string, unknown>[];\n readonly rowCount?: number;\n}"
|
|
7575
|
+
},
|
|
6565
7576
|
{
|
|
6566
7577
|
"name": "poweredBy",
|
|
6567
7578
|
"kind": "function",
|
|
@@ -6703,6 +7714,20 @@
|
|
|
6703
7714
|
"package": "@nifrajs/middleware",
|
|
6704
7715
|
"signature": "export interface PrettyJsonOptions {\n /** JSON indentation spaces. Default `2`. */\n readonly spaces?: number;\n /** Maximum response bytes to inspect. Default `1_000_000`; larger responses pass through. */\n readonly maxBytes?: number;\n /** Append a final newline. Default `true`. */\n readonly newline?: boolean;\n /** Optional query toggle. When set, pretty printing runs only when the parameter is present. */\n readonly query?: string | false;\n /** Only pretty-print matching requests. Default `true`. */\n readonly enabled?: boolean | ((request: Request) => boolean);\n}"
|
|
6705
7716
|
},
|
|
7717
|
+
{
|
|
7718
|
+
"name": "previewEndpoint",
|
|
7719
|
+
"kind": "function",
|
|
7720
|
+
"package": "@nifrajs/web",
|
|
7721
|
+
"signature": "export declare function previewEndpoint(options: PreviewEndpointOptions): (request: Request) => Promise<Response>;",
|
|
7722
|
+
"doc": "/**\n * A **preview / draft-mode entry point** — a `fetch` handler that checks a preview token, turns draft\n * mode on, and redirects the editor to the page they wanted. `GET` with `?token=<secret>&to=/some/path`;\n * mount it on a nifra route, e.g. `app.get(\"/api/preview\", (c) => handler(c.req))`.\n *\n * This is the link-borne sibling of `revalidateEndpoint`. It exists because the alternative — telling\n * you to gate the route yourself — means hand-rolling two checks that are easy to get subtly wrong and\n * that fail silently when you do: the token compare must not exit early on the first wrong character,\n * and the `?to=` destination must not be allowed to point off-site. Both are handled here.\n *\n * A CMS \"Preview\" button is a plain link, so the token has to ride the query string. That has a cost\n * no endpoint can remove — the secret lands in server logs, the `Referer` header, and browser history.\n * Use a preview token minted for that purpose, rotate it, and never reuse a token that grants anything\n * beyond draft mode.\n *\n * Wrong or missing token → `401`; an off-site `to` → `400`; success → `302` with the signed cookie and\n * `Cache-Control: no-store`, so no shared cache can ever replay one editor's draft session to a visitor.\n */"
|
|
7723
|
+
},
|
|
7724
|
+
{
|
|
7725
|
+
"name": "PreviewEndpointOptions",
|
|
7726
|
+
"kind": "interface",
|
|
7727
|
+
"package": "@nifrajs/web",
|
|
7728
|
+
"signature": "export interface PreviewEndpointOptions {\n /** Shared secret the preview link must carry. Compared in **constant time**. */\n readonly secret: string;\n /** Secret that **signs** the draft cookie — the same one passed to `createWebApp({ draftSecret })`\n * and `withISR({ draftSecret })`. Keep it distinct from {@link secret}: that one travels in URLs\n * (logs, `Referer`, browser history), this one never leaves the server. */\n readonly draftSecret: string;\n /** Query parameter carrying the token. Default `\"token\"`. */\n readonly tokenParam?: string;\n /** Query parameter carrying the destination. Default `\"to\"`. */\n readonly redirectParam?: string;\n /** Where to send the editor when the destination parameter is absent. Default `\"/\"`. Must be\n * site-relative; a non-relative value throws at construction rather than at request time. */\n readonly fallbackPath?: string;\n /** Cookie lifetime/path/secure overrides, exactly as {@link enableDraft} takes them. */\n readonly cookie?: EnableDraftOptions;\n}",
|
|
7729
|
+
"doc": "/** Config for {@link previewEndpoint}. */"
|
|
7730
|
+
},
|
|
6706
7731
|
{
|
|
6707
7732
|
"name": "Principal",
|
|
6708
7733
|
"kind": "interface",
|
|
@@ -6811,6 +7836,13 @@
|
|
|
6811
7836
|
"signature": "export declare const PROTOCOL_VERSION = \"2024-11-05\";",
|
|
6812
7837
|
"doc": "/**\n * The pure MCP (Model Context Protocol) JSON-RPC dispatch — no I/O, no `Bun.*`, no side effects, so it\n * unit-tests cleanly. A transport (stdio in `@nifrajs/cli`'s `mcp.ts`, Streamable-HTTP in {@link ./http.ts})\n * wires this to a byte stream; the tools/resources are injected, so the protocol logic is exercised\n * without spawning or reading streams.\n *\n * Beyond base MCP this also implements the server half of **MCP Apps (SEP-1865)** — interactive `ui://`\n * widgets: a tool links a UI resource via `_meta.ui.resourceUri`, `tools/call` returns `structuredContent`\n * for the widget to render, and `initialize` advertises the `io.modelcontextprotocol/ui` extension. All of\n * it is additive — a tool whose handler returns a plain `string` behaves exactly as before.\n */"
|
|
6813
7838
|
},
|
|
7839
|
+
{
|
|
7840
|
+
"name": "PublicDirCache",
|
|
7841
|
+
"kind": "interface",
|
|
7842
|
+
"package": "@nifrajs/web",
|
|
7843
|
+
"signature": "export interface PublicDirCache {\n /** `cache-control` for content-hashed assets (default immutable, one year). */\n readonly hashed?: string;\n /** `cache-control` for everything else under `public/` (default one day). */\n readonly assets?: string;\n}",
|
|
7844
|
+
"doc": "/** How long each subtree may be cached. Content-hashed bundle output can be immutable; a\n * user-authored file keeps its name across deploys, so it gets a day and a revalidation. */"
|
|
7845
|
+
},
|
|
6814
7846
|
{
|
|
6815
7847
|
"name": "publicDocsTools",
|
|
6816
7848
|
"kind": "function",
|
|
@@ -7085,6 +8117,78 @@
|
|
|
7085
8117
|
"signature": "export declare const recipe: UpgradeRecipe;",
|
|
7086
8118
|
"doc": "/**\n * Upgrade recipe for nifra 1.8.0.\n *\n * 1.8.0 is a fixed-group bump: every `@nifrajs/*` package moves in lockstep. The pin sweep sets them\n * all to 1.8.0 (preserving each spec's `^`/`~`/exact style). 1.8.0 introduced no breaking import moves\n * in the public packages — the new surfaces (route assurance, adversarial testing, `@nifrajs/events`)\n * are additive — so `importMoves` is empty. The notes flag the additive follow-ups a bump can't do for\n * you (wiring the new assurance config), keeping the runner honest about what it did and didn't touch.\n */"
|
|
7087
8119
|
},
|
|
8120
|
+
{
|
|
8121
|
+
"name": "reconcileEffects",
|
|
8122
|
+
"kind": "function",
|
|
8123
|
+
"package": "@nifrajs/core",
|
|
8124
|
+
"signature": "export declare function reconcileEffects(store: DurableEffectStore, options: {\n readonly staleBefore: number;\n readonly observer?: EffectLifecycleObserver;\n}): Promise<readonly EffectReconciliationFinding[]>;"
|
|
8125
|
+
},
|
|
8126
|
+
{
|
|
8127
|
+
"name": "reconcileEffectsPage",
|
|
8128
|
+
"kind": "function",
|
|
8129
|
+
"package": "@nifrajs/core",
|
|
8130
|
+
"signature": "export declare function reconcileEffectsPage(store: DurableEffectStore, options: {\n readonly staleBefore: number;\n readonly observer?: EffectLifecycleObserver;\n readonly cursor?: string;\n readonly limit?: number;\n}): Promise<ReconciliationPage<EffectReconciliationFinding>>;"
|
|
8131
|
+
},
|
|
8132
|
+
{
|
|
8133
|
+
"name": "reconcileSagas",
|
|
8134
|
+
"kind": "function",
|
|
8135
|
+
"package": "@nifrajs/core",
|
|
8136
|
+
"signature": "export declare function reconcileSagas(store: SagaStore, options: {\n readonly staleBefore: number;\n}): Promise<readonly SagaReconciliationFinding[]>;"
|
|
8137
|
+
},
|
|
8138
|
+
{
|
|
8139
|
+
"name": "reconcileSagasPage",
|
|
8140
|
+
"kind": "function",
|
|
8141
|
+
"package": "@nifrajs/core",
|
|
8142
|
+
"signature": "export declare function reconcileSagasPage(store: SagaStore, options: {\n readonly staleBefore: number;\n readonly cursor?: string;\n readonly limit?: number;\n}): Promise<ReconciliationPage<SagaReconciliationFinding>>;"
|
|
8143
|
+
},
|
|
8144
|
+
{
|
|
8145
|
+
"name": "ReconciliationLease",
|
|
8146
|
+
"kind": "interface",
|
|
8147
|
+
"package": "@nifrajs/core",
|
|
8148
|
+
"signature": "export interface ReconciliationLease {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n readonly expiresAt: number;\n readonly cursor?: string;\n}"
|
|
8149
|
+
},
|
|
8150
|
+
{
|
|
8151
|
+
"name": "ReconciliationLeaseStore",
|
|
8152
|
+
"kind": "interface",
|
|
8153
|
+
"package": "@nifrajs/core",
|
|
8154
|
+
"signature": "export interface ReconciliationLeaseStore {\n readonly durability?: \"memory\" | \"durable\";\n acquire(input: {\n readonly name: string;\n readonly owner: string;\n readonly now: number;\n readonly leaseMs: number;\n }): ReconciliationLease | undefined | Promise<ReconciliationLease | undefined>;\n renew(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n readonly now: number;\n readonly leaseMs: number;\n }): boolean | Promise<boolean>;\n checkpoint(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n readonly cursor?: string;\n }): boolean | Promise<boolean>;\n release(input: {\n readonly name: string;\n readonly owner: string;\n readonly token: string;\n }): boolean | Promise<boolean>;\n}"
|
|
8155
|
+
},
|
|
8156
|
+
{
|
|
8157
|
+
"name": "ReconciliationPage",
|
|
8158
|
+
"kind": "interface",
|
|
8159
|
+
"package": "@nifrajs/core",
|
|
8160
|
+
"signature": "export interface ReconciliationPage<Finding> {\n readonly findings: readonly Finding[];\n readonly cursor?: string;\n}"
|
|
8161
|
+
},
|
|
8162
|
+
{
|
|
8163
|
+
"name": "ReconciliationScanOptions",
|
|
8164
|
+
"kind": "interface",
|
|
8165
|
+
"package": "@nifrajs/core",
|
|
8166
|
+
"signature": "export interface ReconciliationScanOptions<State extends string> {\n readonly states: readonly State[];\n readonly updatedBefore?: number;\n readonly cursor?: string;\n readonly limit: number;\n}"
|
|
8167
|
+
},
|
|
8168
|
+
{
|
|
8169
|
+
"name": "ReconciliationScanPage",
|
|
8170
|
+
"kind": "interface",
|
|
8171
|
+
"package": "@nifrajs/core",
|
|
8172
|
+
"signature": "export interface ReconciliationScanPage<Record> {\n readonly records: readonly Record[];\n readonly cursor?: string;\n}"
|
|
8173
|
+
},
|
|
8174
|
+
{
|
|
8175
|
+
"name": "ReconciliationWorkerEvent",
|
|
8176
|
+
"kind": "type",
|
|
8177
|
+
"package": "@nifrajs/core",
|
|
8178
|
+
"signature": "export type ReconciliationWorkerEvent = {\n readonly type: \"acquired\" | \"released\" | \"lease-lost\";\n readonly name: string;\n} | {\n readonly type: \"page\" | \"checkpoint\";\n readonly name: string;\n readonly scanned: number;\n readonly handled: number;\n} | {\n readonly type: \"failed\";\n readonly name: string;\n readonly errorCode: \"scan\" | \"handle\";\n};"
|
|
8179
|
+
},
|
|
8180
|
+
{
|
|
8181
|
+
"name": "ReconciliationWorkerOptions",
|
|
8182
|
+
"kind": "interface",
|
|
8183
|
+
"package": "@nifrajs/core",
|
|
8184
|
+
"signature": "export interface ReconciliationWorkerOptions<Finding> {\n readonly name: string;\n readonly owner: string;\n readonly leases: ReconciliationLeaseStore;\n readonly leaseMs?: number;\n readonly batchSize?: number;\n readonly maxPages?: number;\n readonly concurrency?: number;\n readonly signal?: AbortSignal;\n readonly now?: () => number;\n readonly scan: (input: {\n readonly cursor?: string;\n readonly limit: number;\n readonly signal: AbortSignal;\n }) => {\n readonly findings: readonly Finding[];\n readonly cursor?: string;\n } | Promise<{\n readonly findings: readonly Finding[];\n readonly cursor?: string;\n }>;\n readonly filter?: (finding: Finding) => boolean;\n readonly handle: (finding: Finding, signal: AbortSignal) => void | PromiseLike<void>;\n readonly observe?: (event: ReconciliationWorkerEvent) => void;\n}"
|
|
8185
|
+
},
|
|
8186
|
+
{
|
|
8187
|
+
"name": "ReconciliationWorkerResult",
|
|
8188
|
+
"kind": "interface",
|
|
8189
|
+
"package": "@nifrajs/core",
|
|
8190
|
+
"signature": "export interface ReconciliationWorkerResult {\n readonly acquired: boolean;\n readonly pages: number;\n readonly scanned: number;\n readonly handled: number;\n}"
|
|
8191
|
+
},
|
|
7088
8192
|
{
|
|
7089
8193
|
"name": "recordCapabilityOutcome",
|
|
7090
8194
|
"kind": "function",
|
|
@@ -7174,6 +8278,12 @@
|
|
|
7174
8278
|
"signature": "export declare function reflectSchema(value: unknown): SchemaReflection;",
|
|
7175
8279
|
"doc": "/**\n * Reflect a Standard Schema, Nifra/TypeBox schema carrier, or raw JSON Schema. Never throws.\n * Validation-only schemas have `standard` but no `jsonSchema`; raw JSON Schema has the reverse.\n */"
|
|
7176
8280
|
},
|
|
8281
|
+
{
|
|
8282
|
+
"name": "RegisteredCapabilityInterceptor",
|
|
8283
|
+
"kind": "interface",
|
|
8284
|
+
"package": "@nifrajs/core",
|
|
8285
|
+
"signature": "export interface RegisteredCapabilityInterceptor {\n readonly interceptor: CapabilityInterceptor;\n readonly timeoutMs: number;\n}"
|
|
8286
|
+
},
|
|
7177
8287
|
{
|
|
7178
8288
|
"name": "registerFormat",
|
|
7179
8289
|
"kind": "function",
|
|
@@ -7270,6 +8380,13 @@
|
|
|
7270
8380
|
"signature": "export declare function renderInitAgents(result: InitAgentsResult): string;",
|
|
7271
8381
|
"doc": "/** Format the retrofit result for the terminal. */"
|
|
7272
8382
|
},
|
|
8383
|
+
{
|
|
8384
|
+
"name": "RenderMode",
|
|
8385
|
+
"kind": "type",
|
|
8386
|
+
"package": "@nifrajs/web",
|
|
8387
|
+
"signature": "export type RenderMode = \"static\" | \"isr\" | \"ssr\";",
|
|
8388
|
+
"doc": "/**\n * How a route produces its HTML.\n *\n * - `static` - prerendered at build; served as a file, no server render at request time.\n * - `isr` - server-rendered, then cached and revalidated on a timer (`export const revalidate`).\n * - `ssr` - server-rendered per request. The default, and the only mode that needs a live server.\n */"
|
|
8389
|
+
},
|
|
7273
8390
|
{
|
|
7274
8391
|
"name": "renderOpenApi",
|
|
7275
8392
|
"kind": "function",
|
|
@@ -7288,7 +8405,7 @@
|
|
|
7288
8405
|
"name": "RenderPageOptions",
|
|
7289
8406
|
"kind": "interface",
|
|
7290
8407
|
"package": "@nifrajs/web",
|
|
7291
|
-
"signature": "export interface RenderPageOptions {\n readonly adapter: RenderAdapter;\n /** The layout chain to render — outermost layout → page (opaque; the adapter renders it). */\n readonly chain: readonly unknown[];\n /** The loader output for this request. */\n readonly data: unknown;\n /** An action's data return (POST only) — surfaced to the page as `actionData` + serialized\n * for the client so post-POST hydration matches. Omit on GETs. */\n readonly actionData?: unknown;\n /** URL of the built client entry (loaded as a module script). */\n readonly clientEntry: string;\n /** Chunk URLs for the **matched** route (its layout chain + own chunk) to `modulepreload` in the\n * shell — so the route code downloads in parallel with the entry instead of after it\n * (`buildClient`'s per-route map). Empty/omitted ⇒ only the entry is preloaded (unchanged). */\n readonly preload?: readonly string[];\n /** Stylesheet URLs for the **matched** route (its layout chain + own CSS, from `buildClient`'s\n * `BuildManifest.css`) — injected as `<link rel=\"stylesheet\">` in `<head>` so styles arrive with the\n * first paint (no FOUC). Rendered even on non-hydrated pages. Empty/omitted ⇒ none (unchanged). */\n readonly styles?: readonly string[];\n /** SSG: the prerendered-path set, serialized to `window.__NIFRA_PRERENDERED__` so the client fetches\n * a static `_data.json` on soft-nav into a prerendered route. Empty/omitted ⇒ not injected. */\n readonly prerenderedPaths?: readonly string[];\n /** ISR: route freshness in seconds, emitted as the `x-nifra-isr-revalidate` header for a `withISR`\n * wrapper to read. Omit ⇒ no header (the wrapper's default TTL applies). */\n readonly revalidate?: number;\n /** Matched route id; written to `window.__NIFRA_ROUTE__` so the client hydrates this chain. */\n readonly routeId?: string;\n /** The matched route's decoded path params — surfaced to the page as `params` (via {@link RenderProps})\n * so an adapter's `useParams` is SSR-correct. Omit ⇒ `{}` (a route with no dynamic segments, or an\n * error/404 render). */\n readonly params?: Readonly<Record<string, string>>;\n /** The request's `pathname + search` — surfaced as `path` (via {@link RenderProps}) so an adapter's\n * `useLocation`/`useSearchParams` render the right URL server-side and hydrate without drift. Omit ⇒\n * `\"\"`. */\n readonly path?: string;\n /** HTTP status for the response (default 200; e.g. 404 for a not-found page). */\n readonly status?: number;\n /** Document title (fallback when `head.title` is unset). */\n readonly title?: string;\n /** Resolved route head — `title` overrides `title` above; `meta`/`link` render as managed\n * (`data-nifra`) tags the client updates on navigation.\n *\n * **Head contract (the layout chain contributes).** `createWebApp` resolves this via\n * {@link mergeHeads}: a route's head is its **layout chain's** `meta`/`head` exports merged with the\n * page's. A `_layout.tsx` may `export const meta` (or `export function meta(args)`) — its tags land\n * on every page below it (the home for `hreflang`, `preconnect`, a section-default `<title>`). The\n * merge is **nearest-wins for scalars** (the page's `title` overrides an inner layout's, which\n * overrides an outer one; an undefined page title keeps the layout's) and **concatenated for the\n * `meta`/`link` arrays** (outermost layout first, page last). `<link>` attributes are name-validated\n * (any letter/digit/hyphen name — covers `rel`/`href`/`hreflang`/`crossorigin`/`media`/`sizes`/`as`/\n * `integrity`/`fetchpriority`/…) and value-escaped against XSS. */\n readonly head?: Meta;\n /** Id of the container wrapping the app markup (default `\"root\"`). */\n readonly rootId?: string;\n /** When `false`, emit a complete but **non-hydrated** document — no client entry script, data\n * globals, or modulepreloads. Used for server-rendered `_error` pages: a terminal state that needs no\n * client takeover, and it sidesteps an SSR/hydrate mismatch (the server rendered the boundary, not\n * the page the client manifest maps this route id to). Default `true`. */\n readonly hydrate?: boolean;\n /** Island client bundles (`@nifrajs/web/islands`) to load as `<script type=\"module\">` in the document\n * tail — emitted **regardless of `hydrate`**, so a static (`hydrate: false`) page can still mount\n * no-framework islands. URLs are attribute-escaped. Empty/omitted ⇒ none (unchanged output). */\n readonly islandScripts?: readonly string[];\n}"
|
|
8408
|
+
"signature": "export interface RenderPageOptions {\n readonly adapter: RenderAdapter;\n /** The layout chain to render — outermost layout → page (opaque; the adapter renders it). */\n readonly chain: readonly unknown[];\n /** The loader output for this request. */\n readonly data: unknown;\n /** An action's data return (POST only) — surfaced to the page as `actionData` + serialized\n * for the client so post-POST hydration matches. Omit on GETs. */\n readonly actionData?: unknown;\n /** URL of the built client entry (loaded as a module script). */\n readonly clientEntry: string;\n /** Chunk URLs for the **matched** route (its layout chain + own chunk) to `modulepreload` in the\n * shell — so the route code downloads in parallel with the entry instead of after it\n * (`buildClient`'s per-route map). Empty/omitted ⇒ only the entry is preloaded (unchanged). */\n readonly preload?: readonly string[];\n /** Stylesheet URLs for the **matched** route (its layout chain + own CSS, from `buildClient`'s\n * `BuildManifest.css`) — injected as `<link rel=\"stylesheet\">` in `<head>` so styles arrive with the\n * first paint (no FOUC). Rendered even on non-hydrated pages. Empty/omitted ⇒ none (unchanged). */\n readonly styles?: readonly string[];\n /** SSG: the prerendered-path set, serialized to `window.__NIFRA_PRERENDERED__` so the client fetches\n * a static `_data.json` on soft-nav into a prerendered route. Empty/omitted ⇒ not injected. */\n readonly prerenderedPaths?: readonly string[];\n /** ISR: route freshness in seconds, emitted as the `x-nifra-isr-revalidate` header for a `withISR`\n * wrapper to read. Omit ⇒ no header (the wrapper's default TTL applies). */\n readonly revalidate?: number;\n /** Matched route id; written to `window.__NIFRA_ROUTE__` so the client hydrates this chain. */\n readonly routeId?: string;\n /** The matched route's decoded path params — surfaced to the page as `params` (via {@link RenderProps})\n * so an adapter's `useParams` is SSR-correct. Omit ⇒ `{}` (a route with no dynamic segments, or an\n * error/404 render). */\n readonly params?: Readonly<Record<string, string>>;\n /** The request's `pathname + search` — surfaced as `path` (via {@link RenderProps}) so an adapter's\n * `useLocation`/`useSearchParams` render the right URL server-side and hydrate without drift. Omit ⇒\n * `\"\"`. */\n readonly path?: string;\n /** Per-layout loader data, forwarded to the adapter as `RenderProps.layoutData`. Aligned with the\n * chain's layout prefix; omitted when no layout in the chain has a loader. */\n readonly layoutData?: readonly unknown[];\n /** HTTP status for the response (default 200; e.g. 404 for a not-found page). */\n readonly status?: number;\n /** Extra response headers - e.g. the `cache-control` a terminal status page wants. `content-type`\n * is ignored (the document is always HTML) and the ISR freshness header is applied after these,\n * so neither can be overridden from here. */\n readonly headers?: HeadersLike;\n /** Document title (fallback when `head.title` is unset). */\n readonly title?: string;\n /** Resolved route head — `title` overrides `title` above; `meta`/`link` render as managed\n * (`data-nifra`) tags the client updates on navigation.\n *\n * **Head contract (the layout chain contributes).** `createWebApp` resolves this via\n * {@link mergeHeads}: a route's head is its **layout chain's** `meta`/`head` exports merged with the\n * page's. A `_layout.tsx` may `export const meta` (or `export function meta(args)`) — its tags land\n * on every page below it (the home for `hreflang`, `preconnect`, a section-default `<title>`). The\n * merge is **nearest-wins for scalars** (the page's `title` overrides an inner layout's, which\n * overrides an outer one; an undefined page title keeps the layout's) and **concatenated for the\n * `meta`/`link` arrays** (outermost layout first, page last). `<link>` attributes are name-validated\n * (any letter/digit/hyphen name — covers `rel`/`href`/`hreflang`/`crossorigin`/`media`/`sizes`/`as`/\n * `integrity`/`fetchpriority`/…) and value-escaped against XSS. */\n readonly head?: Meta;\n /** Id of the container wrapping the app markup (default `\"root\"`). */\n readonly rootId?: string;\n /** When `false`, emit a complete but **non-hydrated** document — no client entry script, data\n * globals, or modulepreloads. Used for server-rendered `_error` pages: a terminal state that needs no\n * client takeover, and it sidesteps an SSR/hydrate mismatch (the server rendered the boundary, not\n * the page the client manifest maps this route id to). Default `true`. */\n readonly hydrate?: boolean;\n /** Island client bundles (`@nifrajs/web/islands`) to load as `<script type=\"module\">` in the document\n * tail — emitted **regardless of `hydrate`**, so a static (`hydrate: false`) page can still mount\n * no-framework islands. URLs are attribute-escaped. Empty/omitted ⇒ none (unchanged output). */\n readonly islandScripts?: readonly string[];\n}"
|
|
7292
8409
|
},
|
|
7293
8410
|
{
|
|
7294
8411
|
"name": "renderPageResult",
|
|
@@ -7307,7 +8424,7 @@
|
|
|
7307
8424
|
"name": "RenderProps",
|
|
7308
8425
|
"kind": "interface",
|
|
7309
8426
|
"package": "@nifrajs/web",
|
|
7310
|
-
"signature": "export interface RenderProps {\n readonly data: unknown;\n readonly actionData?: unknown;\n /** True while a client navigation or submit is in flight (client-only; absent/false on SSR). */\n readonly pending?: boolean;\n /** The path a client navigation is transitioning TO while `pending` (client-only; absent on SSR and\n * when idle). Lets an adapter tell a `NavLink` whether its own target is the one loading. */\n readonly pendingPath?: string;\n /** The in-flight client submit, for optimistic UI (client-only; absent on SSR + when idle). */\n readonly submission?: Submission;\n /** The matched route's decoded path params (`/users/:id` → `{ id: \"7\" }`). Threaded identically on\n * SSR (from the request match) and on client navigation (from router state) so an adapter's\n * `useParams` reads the same value on both, with no hydration mismatch. Absent ⇒ no params (`{}`). */\n readonly params?: Readonly<Record<string, string>>;\n /** The current URL's `pathname + search` (no hash — the hash never reaches the server). Threaded on\n * SSR and client alike so an adapter's `useLocation`/`useSearchParams` hydrate consistently. Absent\n * on adapters/callers that don't supply it (treated as `\"\"`). */\n readonly path?: string;\n}",
|
|
8427
|
+
"signature": "export interface RenderProps {\n readonly data: unknown;\n /**\n * Per-layout loader data, aligned index-for-index with the layout prefix of `chain`.\n *\n * Absent when no layout in the chain exports a `loader`, so a page-only app is byte-identical to\n * before. An adapter that does not read it renders exactly as it did; one that does passes\n * `layoutData[i]` to `chain[i]`.\n */\n readonly layoutData?: readonly unknown[];\n readonly actionData?: unknown;\n /** True while a client navigation or submit is in flight (client-only; absent/false on SSR). */\n readonly pending?: boolean;\n /** The path a client navigation is transitioning TO while `pending` (client-only; absent on SSR and\n * when idle). Lets an adapter tell a `NavLink` whether its own target is the one loading. */\n readonly pendingPath?: string;\n /** The in-flight client submit, for optimistic UI (client-only; absent on SSR + when idle). */\n readonly submission?: Submission;\n /** The matched route's decoded path params (`/users/:id` → `{ id: \"7\" }`). Threaded identically on\n * SSR (from the request match) and on client navigation (from router state) so an adapter's\n * `useParams` reads the same value on both, with no hydration mismatch. Absent ⇒ no params (`{}`). */\n readonly params?: Readonly<Record<string, string>>;\n /** The current URL's `pathname + search` (no hash — the hash never reaches the server). Threaded on\n * SSR and client alike so an adapter's `useLocation`/`useSearchParams` hydrate consistently. Absent\n * on adapters/callers that don't supply it (treated as `\"\"`). */\n readonly path?: string;\n}",
|
|
7311
8428
|
"doc": "/** The data handed to a route component. Opaque to the core. `actionData` is the return of a\n * route `action` after a POST (absent on plain GETs). `pending` + `submission` are client-only\n * (absent on SSR): they drive **optimistic UI** — render from `submission.formData` while `pending`. */"
|
|
7312
8429
|
},
|
|
7313
8430
|
{
|
|
@@ -7317,6 +8434,13 @@
|
|
|
7317
8434
|
"signature": "export declare function renderReport(result: PortResult, opts: {\n readonly strict?: boolean;\n}): string;",
|
|
7318
8435
|
"doc": "/** Render the feature × target matrix + evidence + summary as a readable report. */"
|
|
7319
8436
|
},
|
|
8437
|
+
{
|
|
8438
|
+
"name": "renderRouteManifest",
|
|
8439
|
+
"kind": "function",
|
|
8440
|
+
"package": "@nifrajs/web",
|
|
8441
|
+
"signature": "export declare function renderRouteManifest(manifest: RouteManifest): string;",
|
|
8442
|
+
"doc": "/** Render the manifest as a readable report - the `nifra routes --modes` output. */"
|
|
8443
|
+
},
|
|
7320
8444
|
{
|
|
7321
8445
|
"name": "renderRouteTable",
|
|
7322
8446
|
"kind": "function",
|
|
@@ -7342,7 +8466,7 @@
|
|
|
7342
8466
|
"name": "renderTypesResult",
|
|
7343
8467
|
"kind": "function",
|
|
7344
8468
|
"package": "@nifrajs/cli",
|
|
7345
|
-
"signature": "export declare function renderTypesResult(types: readonly TypeEntry[], name: string | undefined, query: string | undefined, limit: number): string;",
|
|
8469
|
+
"signature": "export declare function renderTypesResult(types: readonly TypeEntry[], name: string | undefined, query: string | undefined, limit: number, full?: boolean): string;",
|
|
7346
8470
|
"doc": "/**\n * Render the tool result. `name` → the exact declaration(s); else `query` → the top matches; else a\n * per-package index of type names. The signatures are authoritative (generated from the built `.d.ts`),\n * so this is the complete answer — there is no need to read a `.d.ts` file.\n */"
|
|
7347
8471
|
},
|
|
7348
8472
|
{
|
|
@@ -7378,6 +8502,24 @@
|
|
|
7378
8502
|
"package": "@nifrajs/core",
|
|
7379
8503
|
"signature": "export declare class RequestContext implements RawContext {\n params: Record<string, string>;\n body: unknown;\n private searchValue;\n private signalValue;\n private budgetValue;\n private platformValue;\n private setValue;\n private queryValue;\n private queryReady;\n private cookiesValue;\n private readonly source;\n private readonly maxBodyBytes;\n constructor(source: RequestSource, params: Record<string, string>, maxBodyBytes: number);\n constructor(source: RequestSource, params: Record<string, string>, search: string | undefined, signal: AbortSignal, budget: RequestBudget, platform: Platform | undefined, maxBodyBytes: number);\n static native(source: RequestSource, params: Record<string, string>, maxBodyBytes: number): RequestContext;\n [CONTEXT_SET](): CtxSet | undefined;\n get [CONTEXT_SEARCH](): string;\n get set(): CtxSet;\n get signal(): AbortSignal;\n get budget(): RequestBudget;\n get env(): unknown;\n get clientIp(): string | undefined;\n get waitUntil(): (promise: Promise<unknown>) => void;\n get req(): Request;\n get request(): Request;\n json(body: unknown, init?: ResponseInit | number): Response;\n text(body: string, init?: ResponseInit | number): Response;\n get query(): unknown;\n set query(v: unknown);\n get cookies(): Readonly<Record<string, string>>;\n boundedBody(maxBytes?: number): Promise<Uint8Array>;\n boundedJson<T = unknown>(maxBytes?: number): Promise<T>;\n}"
|
|
7380
8504
|
},
|
|
8505
|
+
{
|
|
8506
|
+
"name": "requestEffectEvidence",
|
|
8507
|
+
"kind": "function",
|
|
8508
|
+
"package": "@nifrajs/core",
|
|
8509
|
+
"signature": "export declare function requestEffectEvidence(request: Request): RequestEffectEvidence;"
|
|
8510
|
+
},
|
|
8511
|
+
{
|
|
8512
|
+
"name": "RequestEffectEvidence",
|
|
8513
|
+
"kind": "type",
|
|
8514
|
+
"package": "@nifrajs/core",
|
|
8515
|
+
"signature": "export type RequestEffectEvidence = EffectScopeEvidence;"
|
|
8516
|
+
},
|
|
8517
|
+
{
|
|
8518
|
+
"name": "requestEffectScope",
|
|
8519
|
+
"kind": "function",
|
|
8520
|
+
"package": "@nifrajs/core",
|
|
8521
|
+
"signature": "export declare function requestEffectScope(request: Request): EffectEvidenceScope | undefined;"
|
|
8522
|
+
},
|
|
7381
8523
|
{
|
|
7382
8524
|
"name": "requestId",
|
|
7383
8525
|
"kind": "function",
|
|
@@ -7391,6 +8533,12 @@
|
|
|
7391
8533
|
"package": "@nifrajs/middleware",
|
|
7392
8534
|
"signature": "export interface RequestIdOptions {\n /** Header read for an inbound id (trace propagation) + echoed on the response. Default `\"x-request-id\"`. */\n readonly header?: string;\n /** Generate an id when the inbound header is absent. Default `crypto.randomUUID()`. */\n readonly generate?: () => string;\n}"
|
|
7393
8535
|
},
|
|
8536
|
+
{
|
|
8537
|
+
"name": "requestIsSafeToRetry",
|
|
8538
|
+
"kind": "function",
|
|
8539
|
+
"package": "@nifrajs/core",
|
|
8540
|
+
"signature": "export declare function requestIsSafeToRetry(request: Request): boolean;"
|
|
8541
|
+
},
|
|
7394
8542
|
{
|
|
7395
8543
|
"name": "RequestLedger",
|
|
7396
8544
|
"kind": "interface",
|
|
@@ -7513,6 +8661,19 @@
|
|
|
7513
8661
|
"signature": "export interface ResolvedEffectLedger {\n readonly sink: EffectLedgerOptions[\"sink\"];\n readonly maxEntries: number;\n readonly chain: boolean;\n /** The registered route pattern - what the sealed ledger names (never the concrete URL). */\n readonly method: string;\n readonly path: string;\n /** The route's declared capability tokens, surfaced on the sealed ledger. */\n readonly declared: readonly string[];\n}",
|
|
7514
8662
|
"doc": "/** Registration-resolved effect-ledger wiring for one capability-declaring route. */"
|
|
7515
8663
|
},
|
|
8664
|
+
{
|
|
8665
|
+
"name": "resolveDevEntry",
|
|
8666
|
+
"kind": "function",
|
|
8667
|
+
"package": "@nifrajs/web",
|
|
8668
|
+
"signature": "export declare function resolveDevEntry(server: ServedOn, options: ResolveDevEntryOptions): Promise<DevEntryMatch>;",
|
|
8669
|
+
"doc": "/**\n * Ask Bun's dev server for the current bundled entry URL. One loopback request against a route the app\n * never exposes.\n *\n * **The answer expires.** The URL is a content hash over the whole client graph, so editing any file it\n * reaches - a route, a component, a stylesheet - re-hashes it. Caching the startup value and injecting it\n * forever produces a spectacular failure: Bun answers a superseded chunk URL with a 104-byte\n * `location.reload()` stub under a 405, so the page reloads, gets the same dead URL from SSR, and reloads\n * again, forever. No console output survives the loop to explain it. Callers must re-resolve rather than\n * remember - see how `@nifrajs/web/dev` serves a stable URL that redirects here per request.\n */"
|
|
8670
|
+
},
|
|
8671
|
+
{
|
|
8672
|
+
"name": "ResolveDevEntryOptions",
|
|
8673
|
+
"kind": "interface",
|
|
8674
|
+
"package": "@nifrajs/web",
|
|
8675
|
+
"signature": "export interface ResolveDevEntryOptions {\n /** Path of the throwaway route serving Bun's bundled HTML (e.g. `/__nifra/entry`). */\n readonly probePath: string;\n /** Injected for tests; defaults to global `fetch`. */\n readonly fetchImpl?: typeof fetch;\n}"
|
|
8676
|
+
},
|
|
7516
8677
|
{
|
|
7517
8678
|
"name": "ResolvedIdempotency",
|
|
7518
8679
|
"kind": "interface",
|
|
@@ -7526,6 +8687,12 @@
|
|
|
7526
8687
|
"package": "@nifrajs/image",
|
|
7527
8688
|
"signature": "export interface ResolvedImage {\n readonly src: string;\n readonly srcSet?: string;\n readonly sizes?: string;\n readonly width: number;\n readonly height: number;\n readonly alt: string;\n readonly loading: \"lazy\" | \"eager\";\n readonly decoding: \"async\";\n readonly fetchPriority?: \"high\";\n}"
|
|
7528
8689
|
},
|
|
8690
|
+
{
|
|
8691
|
+
"name": "ResolvedPlugins",
|
|
8692
|
+
"kind": "interface",
|
|
8693
|
+
"package": "@nifrajs/cli",
|
|
8694
|
+
"signature": "export interface ResolvedPlugins {\n readonly vitePlugins: readonly unknown[];\n readonly clientPlugins: readonly unknown[];\n readonly serverPlugins: readonly unknown[];\n}"
|
|
8695
|
+
},
|
|
7529
8696
|
{
|
|
7530
8697
|
"name": "ResolvedTarget",
|
|
7531
8698
|
"kind": "interface",
|
|
@@ -7560,6 +8727,13 @@
|
|
|
7560
8727
|
"signature": "export declare function resolveProjectDir(root: string, dir: string | undefined): string | null;",
|
|
7561
8728
|
"doc": "/**\n * Resolve an optional `dir` tool argument — a subdirectory of the project root the caller wants to scope a\n * check/test to (e.g. `nifra check` on `app/` when the MCP server's root is a monorepo). Returns the\n * absolute target, or `null` if `dir` escapes the root (a path-traversal guard: no `..` out, no absolute\n * path elsewhere). `undefined`/empty → the root itself.\n */"
|
|
7562
8729
|
},
|
|
8730
|
+
{
|
|
8731
|
+
"name": "resolvePublicPath",
|
|
8732
|
+
"kind": "function",
|
|
8733
|
+
"package": "@nifrajs/web",
|
|
8734
|
+
"signature": "export declare function resolvePublicPath(root: string, pathname: string): string | undefined;",
|
|
8735
|
+
"doc": "/**\n * Resolve a URL pathname to an absolute path **confined** to `root`, or `undefined` if it escapes.\n *\n * This is a user-path-to-filesystem sink, which makes it the one part of this feature with a security\n * consequence. Decode first (`%2e%2e%2f` is `../`), then normalize, then verify the result is still\n * under `root` by prefix - checking the *resolved* path rather than scanning the input for `..`,\n * because a blocklist over encodings is exactly the kind of check that gets bypassed.\n */"
|
|
8736
|
+
},
|
|
7563
8737
|
{
|
|
7564
8738
|
"name": "resolveServerOnlyChains",
|
|
7565
8739
|
"kind": "function",
|
|
@@ -7668,6 +8842,13 @@
|
|
|
7668
8842
|
"signature": "export declare function resyncServerManifestSource(source: string, manifest: Parameters<typeof generateServerManifest>[0], routesPrefix: string): string;",
|
|
7669
8843
|
"doc": "/**\n * Re-emit a committed server-manifest from a freshly-discovered route tree, PRESERVING its baked\n * client-asset references (`clientEntry` / `styles` / `routeStyles`) and its eager-vs-lazy shape. This is\n * what makes `nifra sync-manifest` a route-table refresh (renamed / added / removed routes) that does NOT\n * need a full build. It deliberately does NOT rebuild the client bundle: a brand-new HYDRATING route still\n * needs a full build so its client chunk exists - this only re-syncs the server manifest's route table.\n * Pure: `source` + the discovered `manifest` in, new source out.\n */"
|
|
7670
8844
|
},
|
|
8845
|
+
{
|
|
8846
|
+
"name": "RETAIN_HEADER",
|
|
8847
|
+
"kind": "const",
|
|
8848
|
+
"package": "@nifrajs/web",
|
|
8849
|
+
"signature": "export declare const RETAIN_HEADER = \"x-nifra-retain\";",
|
|
8850
|
+
"doc": "/**\n * Layout indices a client navigation is asking the server NOT to re-run, comma separated.\n *\n * The client owns the decision because it holds both the old and new match plus each layout's scoped\n * params. The server treats it as a hint and refuses to skip a `gate` regardless - a guard that runs\n * only when the client says so is not a guard.\n */"
|
|
8851
|
+
},
|
|
7671
8852
|
{
|
|
7672
8853
|
"name": "RetryPolicy",
|
|
7673
8854
|
"kind": "interface",
|
|
@@ -7715,6 +8896,18 @@
|
|
|
7715
8896
|
"signature": "export declare function rewriteVersionSpec(spec: string, toVersion: string): string | null;",
|
|
7716
8897
|
"doc": "/**\n * Rewrite a dependency version spec to `toVersion`, preserving the range operator (`^`, `~`, …).\n * Returns null when the spec is not a plain semver spec (→ skip it) or already equals the target.\n */"
|
|
7717
8898
|
},
|
|
8899
|
+
{
|
|
8900
|
+
"name": "richWireCodec",
|
|
8901
|
+
"kind": "function",
|
|
8902
|
+
"package": "@nifrajs/core",
|
|
8903
|
+
"signature": "export declare function richWireCodec(options?: RichWireCodecOptions): TransportCodec;"
|
|
8904
|
+
},
|
|
8905
|
+
{
|
|
8906
|
+
"name": "RichWireCodecOptions",
|
|
8907
|
+
"kind": "interface",
|
|
8908
|
+
"package": "@nifrajs/core",
|
|
8909
|
+
"signature": "export interface RichWireCodecOptions {\n readonly limits?: WireDecodeLimits;\n}"
|
|
8910
|
+
},
|
|
7718
8911
|
{
|
|
7719
8912
|
"name": "robots",
|
|
7720
8913
|
"kind": "function",
|
|
@@ -7734,6 +8927,19 @@
|
|
|
7734
8927
|
"package": "@nifrajs/core",
|
|
7735
8928
|
"signature": "export interface RobotsRule {\n /** A single user-agent token (`\"*\"`, `\"Googlebot\"`, …) or several sharing the same directives. */\n readonly userAgent: string | readonly string[];\n readonly allow?: readonly string[];\n readonly disallow?: readonly string[];\n /** Seconds between requests (honored by some crawlers). */\n readonly crawlDelay?: number;\n}"
|
|
7736
8929
|
},
|
|
8930
|
+
{
|
|
8931
|
+
"name": "RollupBundleLike",
|
|
8932
|
+
"kind": "type",
|
|
8933
|
+
"package": "@nifrajs/web",
|
|
8934
|
+
"signature": "export type RollupBundleLike = Readonly<Record<string, RollupChunkLike>>;"
|
|
8935
|
+
},
|
|
8936
|
+
{
|
|
8937
|
+
"name": "RollupChunkLike",
|
|
8938
|
+
"kind": "interface",
|
|
8939
|
+
"package": "@nifrajs/web",
|
|
8940
|
+
"signature": "export interface RollupChunkLike {\n /** `\"chunk\"` for JS output, `\"asset\"` for CSS/static — assets have no module graph. */\n readonly type?: string;\n /** The entry module id this chunk was built for, if it is an entry. Rollup's `facadeModuleId`. */\n readonly facadeModuleId?: string | null;\n /** Every module id that landed in this chunk. Rollup's `moduleIds`. */\n readonly moduleIds?: readonly string[];\n}",
|
|
8941
|
+
"doc": "/**\n * The slice of a Rollup/Vite output bundle this seam consumes. `OutputBundle` is\n * `Record<fileName, OutputChunk | OutputAsset>`; only chunks carry a module graph. Typed structurally\n * (no `rollup`/`vite` type dependency) — the fields are stable Rollup output API.\n */"
|
|
8942
|
+
},
|
|
7737
8943
|
{
|
|
7738
8944
|
"name": "ROUTE_GLOBAL",
|
|
7739
8945
|
"kind": "const",
|
|
@@ -7748,6 +8954,13 @@
|
|
|
7748
8954
|
"signature": "export type RouteBody<App, Path extends string, Method extends string> = Path extends keyof RegistryOf<App> ? Uppercase<Method> extends keyof RegistryOf<App>[Path] ? (RegistryOf<App>[Path][Uppercase<Method>] & RouteInfo)[\"body\"] : never : never;",
|
|
7749
8955
|
"doc": "/** The body object type of `App`'s `Method Path` route (`never` when the route declares no body). */"
|
|
7750
8956
|
},
|
|
8957
|
+
{
|
|
8958
|
+
"name": "RouteCapability",
|
|
8959
|
+
"kind": "type",
|
|
8960
|
+
"package": "@nifrajs/web",
|
|
8961
|
+
"signature": "export type RouteCapability = \"server\" | \"revalidation\";",
|
|
8962
|
+
"doc": "/** What a route needs from its host in order to behave as declared. */"
|
|
8963
|
+
},
|
|
7751
8964
|
{
|
|
7752
8965
|
"name": "RouteCapabilityEvidence",
|
|
7753
8966
|
"kind": "interface",
|
|
@@ -7781,6 +8994,13 @@
|
|
|
7781
8994
|
"signature": "export type RouteConfigErrorCode = \"DUPLICATE_ROUTE\" | \"DUPLICATE_PARAM\" | \"PARAM_NAME_CONFLICT\" | \"INVALID_PATH\" | \"INVALID_PARAM_NAME\" | \"WILDCARD_NOT_LAST\" | \"INVALID_METHOD\" | \"INVALID_ASSURANCE\" | \"INVALID_IDEMPOTENCY\";",
|
|
7782
8995
|
"doc": "/** Stable codes for boot-time (L2) route configuration failures. */"
|
|
7783
8996
|
},
|
|
8997
|
+
{
|
|
8998
|
+
"name": "RouteDataEnvelope",
|
|
8999
|
+
"kind": "interface",
|
|
9000
|
+
"package": "@nifrajs/web",
|
|
9001
|
+
"signature": "export interface RouteDataEnvelope {\n readonly v: 1;\n readonly data: unknown;\n readonly layoutData?: readonly unknown[];\n /** Indices whose loader was SKIPPED because the layout's own params did not change. The client\n * keeps its existing value at each of these, so an unchanged layout is neither refetched nor lost. */\n readonly retained?: readonly number[];\n /** Terminal status signalled by a loader. Added by the browser transport after reading\n * `X-Nifra-Status`; old servers and static data files simply omit it. */\n readonly status?: number;\n}",
|
|
9002
|
+
"doc": "/**\n * The data-mode payload once a chain can carry layout data.\n *\n * Versioned because a prerendered `_data.json` is a static file on a CDN and outlives the deploy that\n * wrote it: a browser running new client code can be handed an envelope written by the previous\n * build. The reader therefore accepts BOTH the bare pre-envelope value and this shape, and decides by\n * structure rather than by assuming the deploy was atomic.\n */"
|
|
9003
|
+
},
|
|
7784
9004
|
{
|
|
7785
9005
|
"name": "RouteDescriptor",
|
|
7786
9006
|
"kind": "interface",
|
|
@@ -7792,7 +9012,7 @@
|
|
|
7792
9012
|
"name": "RouteEntry",
|
|
7793
9013
|
"kind": "interface",
|
|
7794
9014
|
"package": "@nifrajs/web",
|
|
7795
|
-
"signature": "export interface RouteEntry {\n readonly id: string;\n readonly pattern: string;\n readonly layoutIds: readonly string[];\n /** `_error` boundary ids in this route's ancestor chain (outermost → innermost). The last is the\n * **nearest** boundary, rendered when the route's loader throws. Always set by `buildManifest`\n * (optional only so hand-built test manifests may omit it); absent/empty ⇒ no boundary (error 500s). */\n readonly errorIds?: readonly string[];\n readonly file: string;\n readonly load: () => Promise<RouteModule>;\n}",
|
|
9015
|
+
"signature": "export interface RouteEntry {\n readonly id: string;\n readonly pattern: string;\n readonly layoutIds: readonly string[];\n /**\n * Param names each layout in {@link layoutIds} owns, aligned by index.\n *\n * A layout wraps a URL prefix, so these are the params it may read and the ones whose change should\n * re-run its loader - everything deeper belongs to routes beneath it. Derived per (route, layout)\n * pair rather than per layout, because one layout can own different params on different expanded\n * patterns: `[[lang]]/docs/_layout` owns nothing on `/docs/:slug` and `{lang}` on `/:lang/docs/:slug`.\n * Optional only so hand-built test manifests may omit it.\n */\n readonly layoutParams?: ReadonlyArray<readonly string[]>;\n /** `_error` boundary ids in this route's ancestor chain (outermost → innermost). The last is the\n * **nearest** boundary, rendered when the route's loader throws. Always set by `buildManifest`\n * (optional only so hand-built test manifests may omit it); absent/empty ⇒ no boundary (error 500s). */\n readonly errorIds?: readonly string[];\n readonly file: string;\n readonly load: () => Promise<RouteModule>;\n}",
|
|
7796
9016
|
"doc": "/** One matched route: pattern, nested layout ids (outermost → innermost), source file, loader. */"
|
|
7797
9017
|
},
|
|
7798
9018
|
{
|
|
@@ -7851,6 +9071,27 @@
|
|
|
7851
9071
|
"signature": "export interface RouteLike {\n readonly method: string;\n readonly path: string;\n readonly schema?: {\n readonly body?: unknown;\n readonly query?: unknown;\n readonly response?: unknown;\n } | undefined;\n}",
|
|
7852
9072
|
"doc": "/** A registered route as seen by {@link buildOpenApiDocument} — structurally a `@nifrajs/core`\n * `RouteDescriptor` (so `app.routes()` is passed straight through). */"
|
|
7853
9073
|
},
|
|
9074
|
+
{
|
|
9075
|
+
"name": "RouteManifest",
|
|
9076
|
+
"kind": "interface",
|
|
9077
|
+
"package": "@nifrajs/web",
|
|
9078
|
+
"signature": "export interface RouteManifest {\n /** The deploy target this was resolved against, when one was given. */\n readonly target?: string;\n readonly routes: readonly RouteManifestEntry[];\n readonly conflicts: readonly RouteManifestConflict[];\n /** Route counts by mode - the summary a report leads with. */\n readonly totals: Readonly<Record<RenderMode, number>>;\n}",
|
|
9079
|
+
"doc": "/** The whole artifact: every route's behaviour, plus anything the target cannot honour. */"
|
|
9080
|
+
},
|
|
9081
|
+
{
|
|
9082
|
+
"name": "RouteManifestConflict",
|
|
9083
|
+
"kind": "interface",
|
|
9084
|
+
"package": "@nifrajs/web",
|
|
9085
|
+
"signature": "export interface RouteManifestConflict {\n readonly id: string;\n readonly pattern: string;\n readonly capability: RouteCapability;\n /** What goes wrong on this target - the consequence, not the rule that was broken. */\n readonly consequence: string;\n}",
|
|
9086
|
+
"doc": "/** A route whose declaration the chosen target cannot honour, and what actually happens if it ships. */"
|
|
9087
|
+
},
|
|
9088
|
+
{
|
|
9089
|
+
"name": "RouteManifestEntry",
|
|
9090
|
+
"kind": "interface",
|
|
9091
|
+
"package": "@nifrajs/web",
|
|
9092
|
+
"signature": "export interface RouteManifestEntry {\n /** The route's id (its key in the build manifest and in `routes`). */\n readonly id: string;\n /** The matching pattern, e.g. `/blog/:slug`. */\n readonly pattern: string;\n readonly mode: RenderMode;\n /** Whether the full-document client is shipped. `false` means the page loads no framework JS. */\n readonly hydrate: boolean;\n /** Revalidation window in seconds. Present only for `isr`. */\n readonly revalidate?: number;\n /**\n * Concrete paths prerendered at build. Present for `static` routes: a single path for a static route,\n * one per `getStaticPaths` entry for a dynamic one. Absent means \"no path was enumerated\", which for a\n * dynamic route is exactly the condition that makes it unprerenderable.\n */\n readonly prerenderedPaths?: readonly string[];\n /** What this route needs from the host to behave as declared. */\n readonly requires: readonly RouteCapability[];\n}",
|
|
9093
|
+
"doc": "/** One route's resolved behaviour. */"
|
|
9094
|
+
},
|
|
7854
9095
|
{
|
|
7855
9096
|
"name": "RouteMatch",
|
|
7856
9097
|
"kind": "interface",
|
|
@@ -7896,7 +9137,7 @@
|
|
|
7896
9137
|
"name": "RoutePatternSegment",
|
|
7897
9138
|
"kind": "type",
|
|
7898
9139
|
"package": "@nifrajs/core",
|
|
7899
|
-
"signature": "export type RoutePatternSegment = {\n readonly kind: \"static\";\n readonly value: string;\n} | {\n readonly kind: \"param\";\n readonly name: string;\n} | {\n readonly kind: \"wildcard\";\n readonly name: string;\n};"
|
|
9140
|
+
"signature": "export type RoutePatternSegment = {\n readonly kind: \"static\";\n readonly value: string;\n} | {\n readonly kind: \"param\";\n readonly name: string;\n} | {\n readonly kind: \"wildcard\";\n readonly name: string;\n}\n/** A segment that is part literal, part parameter: `:key.txt`, `feed.:format`, `v:major.:minor`. */\n | {\n readonly kind: \"mixed\";\n readonly parts: readonly MixedPart[];\n};"
|
|
7900
9141
|
},
|
|
7901
9142
|
{
|
|
7902
9143
|
"name": "Router",
|
|
@@ -7930,7 +9171,7 @@
|
|
|
7930
9171
|
"name": "RouterState",
|
|
7931
9172
|
"kind": "interface",
|
|
7932
9173
|
"package": "@nifrajs/web",
|
|
7933
|
-
"signature": "export interface RouterState {\n readonly routeId: string;\n readonly params: Record<string, string>;\n /** The current URL path (used to revalidate the active loader after an action). */\n readonly path: string;\n readonly data: unknown;\n /** An action's data return after a client-side submit (cleared on navigation). */\n readonly actionData?: unknown;\n /** True while a navigation or submit is in flight (drives loading UI). */\n readonly pending: boolean;\n /** The path a navigation is transitioning TO while `pending` (cleared when it settles). Lets a\n * `NavLink` know whether its own `to` is the one loading; `undefined` when idle. */\n readonly pendingPath?: string | undefined;\n /** The in-flight submit (set during a `submit`, cleared when it settles) — for optimistic UI. */\n readonly submission?: Submission;\n}",
|
|
9174
|
+
"signature": "export interface RouterState {\n readonly routeId: string;\n readonly params: Record<string, string>;\n /** The current URL path (used to revalidate the active loader after an action). */\n readonly path: string;\n readonly data: unknown;\n /** Per-layout loader data, aligned with the matched chain's leading layout prefix. Absent when no\n * layout in that chain has a loader. */\n readonly layoutData?: readonly unknown[] | undefined;\n /** An action's data return after a client-side submit (cleared on navigation). */\n readonly actionData?: unknown;\n /** True while a navigation or submit is in flight (drives loading UI). */\n readonly pending: boolean;\n /** The path a navigation is transitioning TO while `pending` (cleared when it settles). Lets a\n * `NavLink` know whether its own `to` is the one loading; `undefined` when idle. */\n readonly pendingPath?: string | undefined;\n /** The in-flight submit (set during a `submit`, cleared when it settles) — for optimistic UI. */\n readonly submission?: Submission;\n}",
|
|
7934
9175
|
"doc": "/** The router's observable state. A new object is published on every transition. */"
|
|
7935
9176
|
},
|
|
7936
9177
|
{
|
|
@@ -8067,6 +9308,19 @@
|
|
|
8067
9308
|
"signature": "export declare function runDoctor(cwd: string, opts?: {\n readonly json?: boolean;\n readonly autoFix?: boolean;\n}): Promise<boolean>;",
|
|
8068
9309
|
"doc": "/** Run doctor; print a report (`--json` for machine output) and return whether it passed. */"
|
|
8069
9310
|
},
|
|
9311
|
+
{
|
|
9312
|
+
"name": "runDurableExecutionAdapterConformance",
|
|
9313
|
+
"kind": "function",
|
|
9314
|
+
"package": "@nifrajs/core",
|
|
9315
|
+
"signature": "export declare function runDurableExecutionAdapterConformance(adapter: DurableExecutionAdapter): Promise<DurableExecutionConformanceResult>;",
|
|
9316
|
+
"doc": "/** Runtime-independent conformance suite reusable by adapter authors and CI. */"
|
|
9317
|
+
},
|
|
9318
|
+
{
|
|
9319
|
+
"name": "runEffectReconciliationWorker",
|
|
9320
|
+
"kind": "function",
|
|
9321
|
+
"package": "@nifrajs/core",
|
|
9322
|
+
"signature": "export declare function runEffectReconciliationWorker(store: DurableEffectStore, options: SpecializedWorkerOptions<EffectReconciliationFinding>): Promise<ReconciliationWorkerResult>;"
|
|
9323
|
+
},
|
|
8070
9324
|
{
|
|
8071
9325
|
"name": "runFailureScenario",
|
|
8072
9326
|
"kind": "function",
|
|
@@ -8147,6 +9401,12 @@
|
|
|
8147
9401
|
"package": "@nifrajs/mcp-db",
|
|
8148
9402
|
"signature": "export interface RunQueryOptions {\n /**\n * REQUIRED. Authorize each `run_query` call at the transport boundary (inspect the inbound\n * Request's auth). Return false to reject with a JSON-RPC error. There is no unauthenticated\n * mode — schema tools are the anonymous surface. Note: `run_query` is therefore HTTP-only;\n * direct `handle()` dispatch rejects it (no Request to authorize — fails closed).\n */\n readonly authorize: (context: McpDbAuthorizeContext) => boolean | Promise<boolean>;\n /** Max rows returned per query (default 100). */\n readonly maxRows?: number;\n /** Max serialized result size in bytes (default 100 KB). */\n readonly maxResultBytes?: number;\n}"
|
|
8149
9403
|
},
|
|
9404
|
+
{
|
|
9405
|
+
"name": "runReconciliationWorker",
|
|
9406
|
+
"kind": "function",
|
|
9407
|
+
"package": "@nifrajs/core",
|
|
9408
|
+
"signature": "export declare function runReconciliationWorker<Finding>(options: ReconciliationWorkerOptions<Finding>): Promise<ReconciliationWorkerResult>;"
|
|
9409
|
+
},
|
|
8150
9410
|
{
|
|
8151
9411
|
"name": "runRequest",
|
|
8152
9412
|
"kind": "function",
|
|
@@ -8161,6 +9421,12 @@
|
|
|
8161
9421
|
"signature": "export interface RunResult {\n readonly label?: string;\n readonly method: string;\n readonly path: string;\n /** `true` when the app returned a 2xx response. `false` for non-2xx, or when `app.fetch` threw. */\n readonly ok: boolean;\n /** HTTP status — present when the app returned a response (absent when it threw). */\n readonly status?: number;\n readonly statusText?: string;\n readonly headers?: Readonly<Record<string, string>>;\n /** Parsed JSON when the response is JSON; otherwise the (possibly truncated) text. */\n readonly body?: unknown;\n /** The response body as text, truncated to `maxBodyChars`. */\n readonly bodyText?: string;\n /** `true` when `bodyText` was cut to the cap. */\n readonly truncated?: boolean;\n /** Wall-clock time for this request, milliseconds. */\n readonly durationMs: number;\n /** Set when `app.fetch` threw (the app crashed) rather than returning a response. */\n readonly error?: {\n readonly name: string;\n readonly message: string;\n readonly stack?: string;\n };\n}",
|
|
8162
9422
|
"doc": "/** The captured outcome of one request. */"
|
|
8163
9423
|
},
|
|
9424
|
+
{
|
|
9425
|
+
"name": "runSagaReconciliationWorker",
|
|
9426
|
+
"kind": "function",
|
|
9427
|
+
"package": "@nifrajs/core",
|
|
9428
|
+
"signature": "export declare function runSagaReconciliationWorker(store: SagaStore, options: SpecializedWorkerOptions<SagaReconciliationFinding>): Promise<ReconciliationWorkerResult>;"
|
|
9429
|
+
},
|
|
8164
9430
|
{
|
|
8165
9431
|
"name": "runSnapshot",
|
|
8166
9432
|
"kind": "function",
|
|
@@ -8200,6 +9466,13 @@
|
|
|
8200
9466
|
"package": "@nifrajs/middleware",
|
|
8201
9467
|
"signature": "export declare const SAFE_METHODS: Set<string>;"
|
|
8202
9468
|
},
|
|
9469
|
+
{
|
|
9470
|
+
"name": "safeEqual",
|
|
9471
|
+
"kind": "function",
|
|
9472
|
+
"package": "@nifrajs/core",
|
|
9473
|
+
"signature": "export declare function safeEqual(a: string | undefined, b: string | undefined): boolean;",
|
|
9474
|
+
"doc": "/**\n * Constant-time string comparison for credential-shaped values - lease tokens, token hashes, and\n * binding digests.\n *\n * `a !== b` returns as soon as it finds a differing character, so how long it takes reveals how much\n * of a guess was correct. That is only exploitable when an attacker can submit guesses and measure,\n * which is not the case on every path here - but these values are credentials, the comparison is on\n * the verification path, and doing it correctly costs nothing. Doing it inconsistently is what makes\n * the one place that matters easy to miss.\n *\n * Length is compared first, so a length difference is still observable. Every value compared through\n * this helper is fixed-width by construction (a UUID, a SHA-256 hex/base64url digest), so length\n * carries no secret. Content comparison always visits every character.\n *\n * Synchronous on purpose: the callers are store transitions and lease checks that are themselves\n * synchronous. A hash-then-compare variant (which would also hide length) is available as\n * `timingSafeEqualString` in `@nifrajs/middleware`, but it is async and would force those paths async.\n */"
|
|
9475
|
+
},
|
|
8203
9476
|
{
|
|
8204
9477
|
"name": "safeJoin",
|
|
8205
9478
|
"kind": "function",
|
|
@@ -8207,6 +9480,109 @@
|
|
|
8207
9480
|
"signature": "export declare function safeJoin(cwd: string, rel: string): string;",
|
|
8208
9481
|
"doc": "/** Confine a project-relative path under `cwd` and return the absolute path. Rejects a spec that escapes\n * the root (defense-in-depth — these specs are constants, but the cwd-confinement invariant is enforced\n * at the seam, not assumed). Exported so the invariant is directly testable. */"
|
|
8209
9482
|
},
|
|
9483
|
+
{
|
|
9484
|
+
"name": "SagaAmbiguityResolution",
|
|
9485
|
+
"kind": "type",
|
|
9486
|
+
"package": "@nifrajs/core",
|
|
9487
|
+
"signature": "export type SagaAmbiguityResolution = {\n readonly kind: \"execution\";\n readonly step: string;\n readonly effectId: string;\n readonly outcome: \"committed\";\n /** Provider-confirmed result required by later saga steps. */\n readonly result: unknown;\n} | {\n readonly kind: \"execution\";\n readonly step: string;\n readonly effectId: string;\n readonly outcome: \"not-committed\";\n readonly errorCode?: string;\n} | {\n readonly kind: \"compensation\";\n readonly step: string;\n readonly effectId: string;\n readonly outcome: \"compensated\" | \"not-compensated\";\n};"
|
|
9488
|
+
},
|
|
9489
|
+
{
|
|
9490
|
+
"name": "SagaAmbiguousStepError",
|
|
9491
|
+
"kind": "class",
|
|
9492
|
+
"package": "@nifrajs/core",
|
|
9493
|
+
"signature": "export declare class SagaAmbiguousStepError extends Error {\n readonly sagaId: string;\n readonly step: string;\n readonly effectId: string;\n constructor(sagaId: string, step: string, effectId: string);\n}"
|
|
9494
|
+
},
|
|
9495
|
+
{
|
|
9496
|
+
"name": "SagaCompensationContext",
|
|
9497
|
+
"kind": "interface",
|
|
9498
|
+
"package": "@nifrajs/core",
|
|
9499
|
+
"signature": "export interface SagaCompensationContext {\n readonly effectId: string;\n readonly sagaId: string;\n readonly attempt: number;\n readonly signal: AbortSignal;\n}"
|
|
9500
|
+
},
|
|
9501
|
+
{
|
|
9502
|
+
"name": "SagaConcurrencyError",
|
|
9503
|
+
"kind": "class",
|
|
9504
|
+
"package": "@nifrajs/core",
|
|
9505
|
+
"signature": "export declare class SagaConcurrencyError extends Error {\n readonly sagaId: string;\n constructor(sagaId: string);\n}"
|
|
9506
|
+
},
|
|
9507
|
+
{
|
|
9508
|
+
"name": "SagaDefinition",
|
|
9509
|
+
"kind": "interface",
|
|
9510
|
+
"package": "@nifrajs/core",
|
|
9511
|
+
"signature": "export interface SagaDefinition<I, C extends Record<string, unknown>> {\n readonly name: string;\n readonly capability?: string;\n readonly run: (context: SagaRunContext<C>, input: I) => void | PromiseLike<void>;\n readonly compensators: {\n readonly [K in keyof C]: (args: C[K], context: SagaCompensationContext) => void | PromiseLike<void>;\n };\n readonly retry?: {\n readonly maxAttempts?: number;\n readonly backoffMs?: (attempt: number) => number;\n };\n}"
|
|
9512
|
+
},
|
|
9513
|
+
{
|
|
9514
|
+
"name": "SagaEngine",
|
|
9515
|
+
"kind": "interface",
|
|
9516
|
+
"package": "@nifrajs/core",
|
|
9517
|
+
"signature": "export interface SagaEngine {\n execute<I, C extends Record<string, unknown>>(definition: SagaDefinition<I, C>, sagaId: string, input: I, options?: {\n readonly signal?: AbortSignal;\n }): Promise<SagaRecord>;\n resume<I, C extends Record<string, unknown>>(definition: SagaDefinition<I, C>, sagaId: string, options?: {\n readonly signal?: AbortSignal;\n }): Promise<SagaRecord>;\n compensate<I, C extends Record<string, unknown>>(definition: SagaDefinition<I, C>, sagaId: string, options?: {\n readonly signal?: AbortSignal;\n }): Promise<SagaRecord>;\n /**\n * Apply a provider/operator-confirmed outcome to an ambiguous durable transition. The supplied\n * effect id must match the stored execution/compensation id, preventing a stale review from\n * resolving a later operation. The caller remains responsible for authenticating and authorizing\n * the operator. Call `resume` or `compensate` after the resolution.\n */\n resolveAmbiguity<I, C extends Record<string, unknown>>(definition: SagaDefinition<I, C>, sagaId: string, resolution: SagaAmbiguityResolution): Promise<SagaRecord>;\n}"
|
|
9518
|
+
},
|
|
9519
|
+
{
|
|
9520
|
+
"name": "SagaEngineOptions",
|
|
9521
|
+
"kind": "interface",
|
|
9522
|
+
"package": "@nifrajs/core",
|
|
9523
|
+
"signature": "export interface SagaEngineOptions {\n readonly store: SagaStore;\n readonly now?: () => number;\n readonly observer?: EffectLifecycleObserver;\n /** Tests/local development only. Production sagas require a durable store. */\n readonly allowMemoryStore?: boolean;\n}"
|
|
9524
|
+
},
|
|
9525
|
+
{
|
|
9526
|
+
"name": "SagaReconciliationFinding",
|
|
9527
|
+
"kind": "interface",
|
|
9528
|
+
"package": "@nifrajs/core",
|
|
9529
|
+
"signature": "export interface SagaReconciliationFinding {\n readonly sagaId: string;\n readonly state: SagaState;\n readonly step?: string;\n readonly effectId?: string;\n readonly reason: \"stale-running\" | \"ambiguous-execution\" | \"ambiguous-compensation\" | \"manual-review\";\n}"
|
|
9530
|
+
},
|
|
9531
|
+
{
|
|
9532
|
+
"name": "SagaRecord",
|
|
9533
|
+
"kind": "interface",
|
|
9534
|
+
"package": "@nifrajs/core",
|
|
9535
|
+
"signature": "export interface SagaRecord {\n readonly sagaId: string;\n readonly definition: string;\n readonly state: SagaState;\n readonly input: unknown;\n readonly steps: readonly SagaStepRecord[];\n readonly createdAt: number;\n readonly updatedAt: number;\n readonly version: number;\n}"
|
|
9536
|
+
},
|
|
9537
|
+
{
|
|
9538
|
+
"name": "SagaResolutionError",
|
|
9539
|
+
"kind": "class",
|
|
9540
|
+
"package": "@nifrajs/core",
|
|
9541
|
+
"signature": "export declare class SagaResolutionError extends Error {\n readonly sagaId: string;\n readonly step: string;\n constructor(sagaId: string, step: string, message: string);\n}"
|
|
9542
|
+
},
|
|
9543
|
+
{
|
|
9544
|
+
"name": "SagaRunContext",
|
|
9545
|
+
"kind": "interface",
|
|
9546
|
+
"package": "@nifrajs/core",
|
|
9547
|
+
"signature": "export interface SagaRunContext<C extends Record<string, unknown>> {\n step<K extends keyof C & string, T>(name: K, compensationArgs: C[K], execute: (context: SagaStepExecutionContext) => T | PromiseLike<T>): Promise<T>;\n}"
|
|
9548
|
+
},
|
|
9549
|
+
{
|
|
9550
|
+
"name": "SagaState",
|
|
9551
|
+
"kind": "type",
|
|
9552
|
+
"package": "@nifrajs/core",
|
|
9553
|
+
"signature": "export type SagaState = \"running\" | \"compensating\" | \"completed\" | \"compensated\" | \"manual-review\";"
|
|
9554
|
+
},
|
|
9555
|
+
{
|
|
9556
|
+
"name": "SagaStepExecutionContext",
|
|
9557
|
+
"kind": "interface",
|
|
9558
|
+
"package": "@nifrajs/core",
|
|
9559
|
+
"signature": "export interface SagaStepExecutionContext {\n readonly effectId: string;\n readonly signal: AbortSignal;\n}"
|
|
9560
|
+
},
|
|
9561
|
+
{
|
|
9562
|
+
"name": "SagaStepNotCommittedError",
|
|
9563
|
+
"kind": "class",
|
|
9564
|
+
"package": "@nifrajs/core",
|
|
9565
|
+
"signature": "export declare class SagaStepNotCommittedError extends Error {\n readonly code: string;\n constructor(code?: string);\n}",
|
|
9566
|
+
"doc": "/** Throw this only when a provider conclusively proves that no effect committed. */"
|
|
9567
|
+
},
|
|
9568
|
+
{
|
|
9569
|
+
"name": "SagaStepRecord",
|
|
9570
|
+
"kind": "interface",
|
|
9571
|
+
"package": "@nifrajs/core",
|
|
9572
|
+
"signature": "export interface SagaStepRecord {\n readonly name: string;\n readonly effectId: string;\n readonly compensationEffectId: string;\n readonly state: SagaStepState;\n readonly compensationArgs: unknown;\n readonly result?: unknown;\n readonly attempts: number;\n readonly nextAttemptAt?: number;\n readonly errorCode?: string;\n}"
|
|
9573
|
+
},
|
|
9574
|
+
{
|
|
9575
|
+
"name": "SagaStepState",
|
|
9576
|
+
"kind": "type",
|
|
9577
|
+
"package": "@nifrajs/core",
|
|
9578
|
+
"signature": "export type SagaStepState = \"executing\" | \"committed\" | \"failed\" | \"ambiguous\" | \"compensating\" | \"compensation-failed\" | \"compensated\";"
|
|
9579
|
+
},
|
|
9580
|
+
{
|
|
9581
|
+
"name": "SagaStore",
|
|
9582
|
+
"kind": "interface",
|
|
9583
|
+
"package": "@nifrajs/core",
|
|
9584
|
+
"signature": "export interface SagaStore {\n readonly durability?: \"memory\" | \"durable\";\n create(record: SagaRecord): boolean | Promise<boolean>;\n get(sagaId: string): SagaRecord | undefined | Promise<SagaRecord | undefined>;\n /** Atomic version compare-and-set; this is the saga engine's crash/concurrency boundary. */\n compareAndSet(input: {\n readonly sagaId: string;\n readonly version: number;\n readonly record: SagaRecord;\n }): boolean | Promise<boolean>;\n /** Bounded operational scan. Transition-only stores do not need to implement reconciliation. */\n scan?(input: ReconciliationScanOptions<SagaState>): ReconciliationScanPage<SagaRecord> | Promise<ReconciliationScanPage<SagaRecord>>;\n /** @deprecated Compatibility fallback; production reconciliation should implement `scan`. */\n list?(): readonly SagaRecord[] | Promise<readonly SagaRecord[]>;\n}"
|
|
9585
|
+
},
|
|
8210
9586
|
{
|
|
8211
9587
|
"name": "sanitizeOutputNames",
|
|
8212
9588
|
"kind": "function",
|
|
@@ -8286,6 +9662,13 @@
|
|
|
8286
9662
|
"signature": "export declare function scanProject(cwd: string): Promise<SourceFinding[]>;",
|
|
8287
9663
|
"doc": "/** Collect own-API `fetch()` findings across the project. */"
|
|
8288
9664
|
},
|
|
9665
|
+
{
|
|
9666
|
+
"name": "scanRemovedImports",
|
|
9667
|
+
"kind": "function",
|
|
9668
|
+
"package": "@nifrajs/cli",
|
|
9669
|
+
"signature": "export declare function scanRemovedImports(file: string, content: string): SourceFinding[];",
|
|
9670
|
+
"doc": "/** Flag an import of a specifier that no longer exists. Pure; matches the exact specifier or a subpath\n * of it, so `@nifrajs/budget/x` is caught alongside `@nifrajs/budget`. */"
|
|
9671
|
+
},
|
|
8289
9672
|
{
|
|
8290
9673
|
"name": "scanResponseRoutes",
|
|
8291
9674
|
"kind": "function",
|
|
@@ -8554,12 +9937,32 @@
|
|
|
8554
9937
|
"package": "@nifrajs/mcp-db",
|
|
8555
9938
|
"signature": "export interface ServeDatabaseAsMcpOptions {\n /**\n * REQUIRED allowlist of tables the MCP surface may see. `list_tables`/`describe_table` are\n * restricted to it and `run_query` plans are verified against it. Empty array → construction\n * throws; expose nothing by accident, ever.\n */\n readonly tables: readonly string[];\n /** Enable the `run_query` tool. Omitted → schema tools only. */\n readonly runQuery?: RunQueryOptions;\n /** MCP server identity (defaults: name `nifra-db`, version `1.0.0`). */\n readonly name?: string;\n readonly version?: string;\n /**\n * Set `PRAGMA query_only = ON` on the connection at construction (default true). Disable ONLY\n * when the same connection must also serve writes elsewhere in the app — with it disabled,\n * `run_query` still gates on SELECT/WITH + plan verification, but the engine-level guarantee is\n * yours to provide (e.g. open a second, read-only connection for the MCP mount — preferred).\n */\n readonly enforceQueryOnly?: boolean;\n}"
|
|
8556
9939
|
},
|
|
9940
|
+
{
|
|
9941
|
+
"name": "ServedOn",
|
|
9942
|
+
"kind": "interface",
|
|
9943
|
+
"package": "@nifrajs/web",
|
|
9944
|
+
"signature": "export interface ServedOn {\n readonly port: number;\n}",
|
|
9945
|
+
"doc": "/** Structural slice of a running server this needs: just the port it bound. */"
|
|
9946
|
+
},
|
|
8557
9947
|
{
|
|
8558
9948
|
"name": "ServeOptions",
|
|
8559
9949
|
"kind": "interface",
|
|
8560
9950
|
"package": "@nifrajs/node",
|
|
8561
9951
|
"signature": "export interface ServeOptions {\n readonly port: number;\n readonly hostname?: string;\n /**\n * Protocol used when the adapter constructs `Request.url`.\n *\n * `@nifrajs/node` creates a plain Node `http` server, so the safe default is `\"http\"`. Deployments behind\n * TLS termination can set `\"https\"` (or a trusted infra-aware function) so app code that reads\n * `request.url` sees the public scheme. Forwarded headers are not trusted implicitly.\n */\n readonly protocol?: RequestProtocolOption;\n /**\n * Install SIGTERM/SIGINT handlers that call `stop()` for a graceful drain on\n * `docker stop` / Ctrl-C. Off by default — taking over process signals is opt-in,\n * mirroring nifra's Bun `listen({ gracefulSignals })`.\n *\n * The app-level request timeout (`server({ requestTimeoutMs })` → 503) and body cap\n * are *not* set here — they live inside `app.fetch`, so they already apply through\n * this adapter. Slow-client protection is Node's built-in `requestTimeout` (300s) /\n * `headersTimeout` (60s) defaults.\n */\n readonly signals?: boolean;\n /**\n * Serve static files from disk for matching GET/HEAD requests *before* the app runs — non-matching\n * requests fall through to `app.fetch` with the node-direct fast path intact (no perf regression on\n * SSR/API routes). Replaces the hand-rolled `/assets/*` reader in self-hosted entries.\n */\n readonly static?: ServeStaticOptions;\n}"
|
|
8562
9952
|
},
|
|
9953
|
+
{
|
|
9954
|
+
"name": "servePublicDir",
|
|
9955
|
+
"kind": "function",
|
|
9956
|
+
"package": "@nifrajs/web",
|
|
9957
|
+
"signature": "export declare function servePublicDir(options: ServePublicDirOptions): (request: Request) => Promise<Response | undefined>;",
|
|
9958
|
+
"doc": "/**\n * Build a static-file handler for `dir`.\n *\n * Returns `undefined` on any miss so the caller **falls through to routing** - a static probe must\n * never shadow a route. That ordering is also why a `routes/robots.txt.tsx` beats a\n * `public/robots.txt` only if the caller checks routes first; the documented precedence is that the\n * static probe runs first, so `public/` wins, and an app wanting the route should not ship both.\n */"
|
|
9959
|
+
},
|
|
9960
|
+
{
|
|
9961
|
+
"name": "ServePublicDirOptions",
|
|
9962
|
+
"kind": "interface",
|
|
9963
|
+
"package": "@nifrajs/web",
|
|
9964
|
+
"signature": "export interface ServePublicDirOptions {\n /** Absolute path of the directory to serve. */\n readonly dir: string;\n /** URL prefix whose files are content-hashed and may be cached immutably (default `\"/assets/\"`). */\n readonly hashedPrefix?: string;\n readonly cache?: PublicDirCache;\n /** Optional encoded URL-path allowlist. When present, route misses avoid a filesystem probe. */\n readonly files?: ReadonlySet<string>;\n}"
|
|
9965
|
+
},
|
|
8563
9966
|
{
|
|
8564
9967
|
"name": "server",
|
|
8565
9968
|
"kind": "function",
|
|
@@ -8571,7 +9974,7 @@
|
|
|
8571
9974
|
"name": "Server",
|
|
8572
9975
|
"kind": "class",
|
|
8573
9976
|
"package": "@nifrajs/core",
|
|
8574
|
-
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly catalog;\n /** WebSocket routes, matched separately at upgrade time (a GET + `Upgrade: websocket`). */\n private readonly wsRouter;\n private wsRouteCount;\n /** In-process pub/sub backing `ws.subscribe(topic)` + `app.publish(topic, data)` (single-instance).\n * Created by the first `app.ws()` via the `@nifrajs/core/ws` runtime — `undefined` until then, so a\n * no-WebSocket app never constructs (or bundles) it. */\n private topics;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n /** Opt-in caller-IP trust declaration; `undefined` = socket peer only, no forwarded header believed. */\n private readonly clientIpTrust;\n private readonly acceptInboundDeadlines;\n private readonly maxInboundDeadlineMs;\n private readonly deadlineAdmissionOptions;\n private readonly gracefulSignals;\n /** Capacity-admission gate; `undefined` = off (the request path pays nothing). */\n private readonly capacityGate;\n private readonly onCapabilityUse;\n /** The installed effect-ledger runtime (owns the sink + per-route resolution + settle), or\n * `undefined` when the effect-ledger plugin is not installed. */\n private effectLedgerRuntime;\n /** The installed idempotency runtime (owns the app-wide default store + the dedupe lane), or\n * `undefined` when the idempotency plugin is not installed. */\n private idempotencyRuntime;\n /** Installed opt-in runtime for `.tool()`/`.resource()`/`.prompt()`; `undefined` until `.use(mcp())`. */\n private mcpRuntime;\n /** Installed Node-direct renderer for direct `resolveNode()` callers; `undefined` until `.use(nodeDirect())`. */\n private nodeOutcomeRuntime;\n /** Installed streaming runtime for `.sse()` routes; `undefined` until `.use(streaming())`. */\n private sseRuntime;\n /** Installed WebSocket runtime for `.ws()` routes; `undefined` until `.use(websocket())`. */\n private wsRuntime;\n private readonly logger;\n /** App-wide validation-error fallback; a route's own `schema.onValidationError` takes precedence. */\n private readonly defaultOnValidationError?;\n private bunServer;\n private sealed;\n private readonly derives;\n private readonly decorations;\n private readonly beforeHandleHooks;\n private readonly afterHandleHooks;\n private readonly onErrorHooks;\n private readonly aroundHooks;\n private readonly onRequestHooks;\n private readonly onResponseHooks;\n private readonly onResponseFinalizedHooks;\n private readonly responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\n /** Order-scoped evidence captured by routes registered after an assured plugin. */\n private readonly activeAssurance;\n /** App-wide evidence from global hooks; applies retroactively to every route. */\n private readonly globalAssurance;\n /** App-declared MCP resources / prompts (via {@link resource} / {@link prompt}), read by `nifra mcp`. */\n private readonly mcpResourceList;\n private readonly mcpPromptList;\n constructor(options?: ServerOptions);\n private assertConfigurable;\n /** Add a per-request, computed context extension for subsequent routes. */\n derive<D extends object>(fn: (context: Context & Ctx) => MaybePromise<D>): Server<R, Ctx & D>;\n /** Add a static context value for subsequent routes. */\n decorate<const K extends string, V>(key: K, value: V): Server<R, Ctx & Record<K, V>>;\n /**\n * Run before routing on the raw request. Return a `Response` to short-circuit, or a replacement\n * `Request` to continue routing with a rewritten method/URL/headers. Global.\n */\n onRequest(fn: (req: Request, platform?: Platform<EnvOf<Ctx>>) => MaybePromise<OnRequestResult>): this;\n /** Run after validation, before the handler; a non-`undefined` return short-circuits. Order-scoped. */\n beforeHandle(fn: (context: Context & Ctx) => MaybePromise<unknown>): this;\n /**\n * Wrap the matched route lifecycle for subsequent routes. This is intentionally generic over the\n * route output, so wrappers like async context storage do not force Node's direct JSON path through\n * a Web `Response`. The first registered wrapper is outermost.\n */\n around(fn: <T>(context: Context & Ctx, next: () => MaybePromise<T>) => MaybePromise<T>): this;\n /** Transform the handler's result before it is serialized. Order-scoped. */\n afterHandle(fn: (result: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Handle a thrown error; a non-`undefined` return becomes the response (else the default 500). Order-scoped. */\n onError(fn: (error: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Transform every outgoing response — success, error, 404, 405, short-circuit. Global. */\n onResponse(fn: (response: Response, req: Request) => MaybePromise<Response>): this;\n /** Observe the terminal response after all transformations. Observers are ordered and fail-open. */\n onResponseFinalized(fn: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>): this;\n /**\n * Apply a type-**identity** plugin ({@link IdentityPlugin}, from {@link defineIdentityPlugin}) — it\n * registers routes/hooks but doesn't change the types, so this returns `this` with the route registry\n * and context fully intact. This overload exists specifically so a *named* identity plugin (e.g.\n * `@nifrajs/better-auth`) threads the registry: its `& { pluginName }` intersection would otherwise\n * defeat the generic inference of the transforming overload below and collapse the result to `any`.\n */\n use(plugin: IdentityPlugin): this;\n /**\n * Apply a **plugin function** — `(app) => app`, typically built with {@link definePlugin}. It's\n * called with `this` and its result is returned, so an inline plugin's `derive`/`decorate` thread\n * the added context to handlers defined after `use` (the overload is generic over the concrete\n * `this`). A named plugin already applied is skipped (idempotent dedupe).\n */\n use<Out extends AnyServer>(plugin: (app: this) => Out): Out;\n /**\n * Apply a {@link Middleware} bundle — wire each hook it provides to its lifecycle point. Returns\n * `this` (no context-type merging); call it before the routes its `beforeHandle`/`afterHandle`\n * should cover (those are order-scoped; `onRequest`/`onResponse` are global). A named bundle already\n * applied is skipped (idempotent).\n */\n use(mw: Middleware): this;\n get<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n get<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Register a **typed SSE route** — a GET endpoint streaming `text/event-stream` whose event\n * payloads are contracted by `schema.sse`. The handler receives the validated context plus a\n * {@link TypedSSEStream}: `stream.send(event)` is compile-time-checked against the schema and\n * JSON-serialized into the SSE `data:` field. The typed client sees the marker and grows a\n * `.subscribe(onEvent)` for the route with the same payload type — end-to-end typed streaming.\n *\n * import { streaming } from \"@nifrajs/core/sse\" // .use(streaming()) enables .sse()\n * const app = server().use(streaming()).sse(\"/feed\", { sse: t.object({ id: t.integer(), title: t.string() }) },\n * async (c, stream) => {\n * stream.send({ id: 1, title: \"hello\" }) // typed\n * await waitForDisconnect(stream.signal)\n * },\n * { keepAlive: 15_000 })\n *\n * // client: const off = api.feed.subscribe((post) => console.log(post.title))\n *\n * `init` passes through to the underlying {@link sse} helper (`keepAlive`, extra headers). The\n * connection closes when the handler resolves, `stream.close()` runs, or the client disconnects\n * (`stream.signal`). Query/body schemas validate exactly as on any other route.\n */\n sse<Path extends string, S extends RouteSchema & {\n sse: StandardSchemaV1;\n }>(path: Path, schema: S, run: (context: Context<Path, S> & Ctx, stream: TypedSSEStream<InferOutput<S[\"sse\"]>>) => void | Promise<void>, init?: SSEInit): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, Response>>, Ctx>;\n post<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n post<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n put<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n put<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n patch<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n patch<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n delete<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n delete<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Declare an **MCP tool** an agent can call (via `nifra mcp`, or a mounted MCP endpoint): a typed\n * `POST /_nifra/tool/<name>` route whose `input`/`output` schemas contract the call and surface in\n * `tools/list`. Requires `.use(mcp())` - without it, `.tool()` is a registration error, so an\n * ordinary HTTP app never bundles the MCP wiring. Siblings: {@link resource}, {@link prompt}.\n *\n * import { mcp } from \"@nifrajs/core/mcp\"\n * const app = server().use(mcp()).tool(\n * \"search\",\n * { description: \"Search posts\", input: t.object({ q: t.string() }) },\n * ({ q }) => findPosts(q),\n * )\n */\n tool<Name extends string, S extends {\n description: string;\n input: StandardSchemaV1;\n output?: StandardSchemaV1;\n annotations?: ToolAnnotations;\n }, H extends (input: InferOutput<S[\"input\"]>, ctx: Context & Ctx) => MaybePromise<S[\"output\"] extends StandardSchemaV1 ? InferOutput<S[\"output\"]> : unknown>>(name: Name, config: S, handler: H): Server<AddRoute<R, \"POST\", `/_nifra/tool/${Name}`, RouteInfoFor<`/_nifra/tool/${Name}`, S[\"output\"] extends StandardSchemaV1 ? {\n body: S[\"input\"];\n response: S[\"output\"];\n } : {\n body: S[\"input\"];\n }, OutputOf<H>>>, Ctx>;\n /**\n * Declare an MCP **resource** — read-only data an agent can fetch through `nifra mcp` (app config, a\n * generated document, …). `read` runs in the app process, so capture whatever app state it needs in the\n * closure. `uri` is the MCP resource identifier (e.g. `\"myapp://config\"`). The sibling of {@link tool}\n * for the resource half of MCP.\n */\n resource(uri: string, config: {\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n }, read: McpResourceDescriptor[\"read\"]): Server<R, Ctx>;\n /**\n * Declare an MCP **prompt** — a reusable prompt template an agent can fetch through `nifra mcp`.\n * `handler` receives the caller's arguments and returns the rendered messages.\n */\n prompt(name: string, config: {\n readonly description: string;\n readonly arguments?: readonly PromptArgument[];\n }, handler: McpPromptDescriptor[\"handler\"]): Server<R, Ctx>;\n /** The MCP resources declared via {@link resource} — enumerated by `nifra mcp`. */\n mcpResources(): readonly McpResourceDescriptor[];\n /** The MCP prompts declared via {@link prompt} — enumerated by `nifra mcp`. */\n mcpPrompts(): readonly McpPromptDescriptor[];\n /**\n * Register a **WebSocket** route. The connection upgrades on a `GET` to `path` carrying\n * `Upgrade: websocket`; the optional `handler.upgrade(c)` runs in the request context first and may\n * reject (return a `Response`) or seed per-connection `ws.data`. WebSockets are served by the\n * adapter (`listen()`, `@nifrajs/node`, `@nifrajs/deno`, `toFetchHandler`) — not by bare `app.fetch`, which\n * has no socket (a WS path through `app.fetch` is a normal HTTP response).\n *\n * The route also enters the type-level registry (under the pseudo-method `\"WS\"`), so the typed\n * client grows a `.ws()` handle for it: `messageSchema` types what the client may `send`,\n * `sendSchema` types the frames it receives. Passing explicit type arguments (`ws<MyData>(…)`)\n * defeats path-literal inference and skips the registry entry - the route still serves, it is just\n * invisible to `client<App>`; prefer typing `data` via `upgrade()`'s return.\n *\n * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined, Send extends StandardSchemaV1 | undefined = undefined, Path extends string = string>(path: Path, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema, Send>): string extends Path ? Server<R, Ctx> : Server<AddRoute<R, \"WS\", Path, WsRouteInfoFor<Path, Schema, Send>>, Ctx>;\n /**\n * Broadcast `data` to every WebSocket connection subscribed to `topic` (via `ws.subscribe(topic)`).\n * In-process and **single-instance** (see {@link TopicRegistry}) — a multi-instance deploy must bridge\n * an external fan-out (Redis, a Durable Object) to this. A no-op when nobody is subscribed.\n */\n publish(topic: string, data: string | ArrayBufferView | ArrayBuffer): void;\n private route;\n /**\n * Low-level route registration shared by the inline builder and `implement()`.\n * Captures the server's current `derive`/`decorate` chain into the route — this\n * is the \"compiled\", order-scoped per-route chain.\n */\n register(method: Method, path: string, schema: RouteSchema | undefined, handler: (context: never) => unknown): void;\n /** Register a contract/group route batch atomically. Every route captures the same current chain it\n * would capture through {@link register}; no route becomes visible unless the full batch validates. */\n registerBatch(routes: readonly {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n readonly handler: (context: never) => unknown;\n }[]): void;\n private prepareRoute;\n /** Collapse route-invariant lifecycle decisions into one runner at registration. The request path\n * performs no eligibility ladder: it supplies request state to this already-selected plan. */\n private compileExecutionPlan;\n /** The idempotency lane's bridge back into the normal matched lanes, resolved to a concrete Response\n * (the lane buffers the body, then replays it through the route's real validation + handler). */\n private idempotencyRunLanes;\n /** @internal Symbol-keyed install seam for the `idempotency()` plugin. Off the public typed surface. */\n [INSTALL_IDEMPOTENCY](runtime: IdempotencyRuntime): void;\n /** @internal Symbol-keyed install seam for the `mcp()` plugin. Off the public typed surface. */\n [INSTALL_MCP](runtime: McpRuntime): void;\n /** @internal Symbol-keyed install seam for the `nodeDirect()` plugin. Off the public typed surface. */\n [INSTALL_NODE_DIRECT](runtime: NodeOutcomeRuntime): void;\n /** @internal Symbol-keyed install seam for the `streaming()` plugin. Off the public typed surface. */\n [INSTALL_SSE](runtime: SseRuntime): void;\n /** @internal Symbol-keyed install seam for the `websocket()` plugin. Off the public typed surface. */\n [INSTALL_WS](runtime: WsRuntime): void;\n /**\n * Merge another server's routes into this one — the composition escape hatch for large apps.\n *\n * WHY: the fluent chain accumulates one type-alias level per route, and TypeScript resolves\n * that stack in one recursion — a single chain hits TS2589 at ~95 routes. Groups keep every\n * chain short: build each domain (`listings`, `agents`, …) as its own `server()` (its registry\n * resolves independently), then `app.merge(listings).merge(agents)` — each merge adds ONE level\n * regardless of group size. 300+ routes stay fully typed (see many-routes.test-d.ts). The\n * other escape hatch is contract-first `implement()`, whose registry is a single object type.\n *\n * Semantics: merged routes keep the chains captured where they were DEFINED — the group's\n * `derive`/`decorate`/`beforeHandle`/`afterHandle`/`onError`/`around` apply to its routes\n * exactly as they did standalone, so a group wires its own plugins. The group's request-level\n * hooks (`onRequest`/`onResponse`/`onResponseFinalized`) are appended to this server's. This\n * server's route-scoped chains do NOT retroactively wrap merged routes (order-scoped, like\n * routes registered before a `derive`). Fail closed: a path+method collision throws\n * `RouteConfigError` at merge time, and a group with WebSocket routes is refused (register\n * those on the parent).\n */\n merge<R2 extends Registry, Ctx2>(other: Server<R2, Ctx2>): Server<R & R2, Ctx>;\n /** A fused renderer closes over runtime services to keep its seven-argument JSC fast path. Merging\n * rebinds that closure once to the executing server; generic plans already receive the runtime. */\n private bindFusedRuntime;\n /**\n * Enumerate the registered routes (method, path, input schemas), in registration\n * order. Powers `toOpenAPI` and other introspection; the router trie itself no\n * longer holds the original patterns.\n */\n routes(): ReadonlyArray<RouteDescriptor>;\n /**\n * Resolve a `Request` to a `Response` — the whole lifecycle, testable without a port. The\n * optional `platform` carries edge inputs (`env`, `waitUntil`); edge adapters pass it, and\n * Bun/Node/Deno omit it (then `c.env` is `undefined` and `c.waitUntil` runs fire-and-forget).\n */\n fetch(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<Response>;\n private fetchSource;\n private fetchSourceInner;\n /** Web response path when Bun already matched the route. The lifecycle and response hooks remain\n * exactly the same as {@link fetchSource}; only portable URL scanning + trie lookup are skipped. */\n private fetchMatched;\n private fetchMatchedInner;\n /**\n * Run `produce` under the capacity gate: admit → run → release exactly once when the response is\n * produced (or the run throws). Only reached when {@link capacityGate} is set, so the off path pays\n * nothing. The slot is held for the duration of handler execution, not the streaming of the body —\n * capacity here bounds concurrent *work*, matching how in-flight is counted.\n */\n private admitGated;\n private runAdmitted;\n /**\n * Like {@link fetch}, but renders a plain-data result **without** building a Web `Response` — the\n * `@nifrajs/node` adapter serializes the returned primitives straight to the socket, skipping the undici\n * `Response` build + body drain (the bulk of the Node bridge cost, measured ≈4µs/req). A handler that\n * returns a `Response`, an error/short-circuit, or any registered `onResponse` hook falls back to the\n * full Web path (`{ kind: \"response\" }`), so behavior is identical — only the common JSON-data case is\n * faster. Same lifecycle as {@link fetch} (body cap, validation, hooks all run); only the final\n * render differs.\n */\n resolveNode(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n resolveNodeSource(source: RequestSource, platform?: Platform<EnvOf<Ctx>>, suppliedRuntime?: NodeOutcomeRuntime): MaybePromise<NodeServeOutcome>;\n /**\n * Resolve a WebSocket upgrade — the seam every serving adapter uses. Returns `pass` (not a WS\n * upgrade for a registered route → handle as normal HTTP), `reject` (a WS route matched but\n * `upgrade()` rejected, or the path was malformed → return `response`), or `upgrade` (perform the\n * runtime upgrade, then dispatch the native socket's events to `handler`, seeding `ws.data` with\n * `data`). Runs the route's `upgrade(c)` guard in a real request context. Synchronous unless\n * `upgrade()` is async; a throw rejects with a flat 500 (no detail leaked).\n */\n resolveWebSocketUpgrade(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<WebSocketUpgradeOutcome>;\n /** Bun `fetch` when WS routes exist: try a WS upgrade first, else run the normal HTTP lifecycle.\n * `undefined` ⇒ Bun owns the upgraded socket; a `Response` ⇒ a normal reply or a rejected upgrade.\n * (The socket dispatch itself lives in `ws-bun.ts`, loaded via `@nifrajs/core/ws`.) */\n private bunFetchWithWebSocket;\n /**\n * The shared lifecycle, generic over how the final value is rendered: `finalize` turns a handler's\n * result + `set` into the output `T` (`toResponse` → a Web `Response`; `toNodeOutcome` → node-direct\n * primitives), `wrapResponse` lifts an early/error `Response` into that same `T`, and `onTimeout`\n * produces the 503. The Web `fetch` and `resolveNode` are thin callers over this one routing +\n * context + lifecycle implementation — no duplication across the trust boundary.\n */\n /** Apply the `clientIp` trust declaration to the adapter's raw socket peer, returning a platform\n * whose `clientIp` is the derived caller. Only called when a trust declaration is configured. */\n private deriveClientIp;\n private dispatch;\n /**\n * onRequest short-circuit path. Synchronous as long as every hook returns synchronously (the\n * common case — e.g. CORS returning `undefined` for a non-preflight request): an `async` version\n * here put EVERY request of any app with one onRequest hook onto the promise machinery, profiled\n * at ~13% of a realistic request. The first hook that returns a Promise hands the REMAINING\n * hooks to the async continuation; behavior is identical.\n */\n private runWithOnRequest;\n /** Async tail of {@link runWithOnRequest}: applies the first awaited hook's outcome, then runs\n * the remaining hooks (awaiting freely — we're already async here). */\n private continueOnRequest;\n private takeResponseRequest;\n /**\n * Route → build context → run. Synchronous through to the handler for a **bare** route\n * (selected by its compiled plan), so a sync handler produces its result with zero promise allocations;\n * routes with validation/hooks keep the full async {@link runLifecycle}, unchanged.\n */\n private routeAndRun;\n /** Run a route that has already been matched by the runtime or Nifra's portable router. */\n private runMatched;\n /** Supply request-specific deadline state to the route's precompiled execution plan. */\n private runMatchedLanes;\n /** @internal Symbol-keyed install seam for the `effectLedger()` plugin. Off the public typed surface. */\n [INSTALL_EFFECT_LEDGER](runtime: EffectLedgerRuntime): void;\n /** The narrowest bare route: a syntactic `() => ...` handler cannot observe the context argument, so\n * successful requests can skip allocating `RequestContext`. Errors still allocate one for logging. */\n private runContextlessBare;\n private contextlessBareError;\n /**\n * The synchronous fast path selected by a route's execution plan: apply static decorations, call the\n * handler, render the result — **no `await`** unless the handler itself returns a promise. It mirrors\n * the bare slice of {@link runLifecycle} (which a bare route would otherwise no-op through) and shares\n * {@link logRequestError}; a bare route has no `onError` hooks, so error handling is fully synchronous\n * (a thrown `Response` is control flow; anything else is a logged flat 500). This is where nifra skips\n * the per-request async-frame tax — the same win codegen routers get, but without `eval`.\n */\n private runBare;\n /** Bare-route error rendering — identical to {@link runLifecycle}'s catch minus the (absent) onError\n * loop: a thrown `Response` is returned as deliberate control flow; anything else is logged + 500. */\n /**\n * Build a route's fused Web renderer. Composition happens once at\n * registration; the returned closure is what every request to the route runs. Behavior is\n * byte-identical to the generic `runBare`/`runContextlessBare` + `toResponse` pair — same\n * decoration order, same error routing (thrown `Response` = control flow; anything else logs and\n * 500s), same respond semantics (the lifecycle parity suite pins it).\n */\n private buildFusedWeb;\n private bareError;\n private runWithAround;\n private runAround;\n private runBodyOnly;\n /** Validate + run the handler for the bodyOnly path — shared by the inline fast path and the\n * streaming fallback. A method (not per-request closures) so the hot path allocates nothing\n * beyond the one `.then` continuation. */\n private finishBodyOnly;\n private executeHandler;\n private handleValidationErrorRecovery;\n private applyBodyValidation;\n private runQueryOnly;\n /** Validate-result → set `ctx.query` → run handler. A method (not a per-request closure), the\n * query analogue of {@link applyBodyValidation}. */\n private applyQueryValidation;\n /**\n * Thread the response through each global `onResponse` hook. Stays SYNCHRONOUS until a hook\n * actually returns a Promise — an `async` version forced a promise + microtask on EVERY response\n * of any app with an onResponse hook (cors/securityHeaders/etag/timing all use onResponse), the\n * same ~13%/req tax the onRequest walk was de-async'd to avoid. The first async hook hands the\n * rest to {@link continueOnResponse}.\n */\n private applyOnResponse;\n private applyOnResponseAndFinalize;\n private completeResponseFinalization;\n private failResponseFinalization;\n /** Notify terminal observers in order while isolating both sync and async failures. */\n private notifyResponseFinalized;\n /** Async tail of {@link applyOnResponse}: runs the remaining hooks once one has gone async. */\n private continueOnResponse;\n /**\n * Bound the response time. On timeout we abort `ctx.signal` (so cancellation-aware\n * handlers can bail) and return 503; the in-flight work keeps running but its\n * result is discarded — JS can't forcibly cancel a promise.\n */\n private withTimeout;\n /**\n * The post-match lifecycle: validate → derive → beforeHandle → handler → afterHandle, with onError.\n * Generic over the render: a success value goes through `finalize(result, set)` (a Web `Response`, or\n * node-direct primitives); an early/error `Response` (validation, thrown, 500) through `wrapResponse`.\n */\n private runLifecycle;\n private handleLifecycleError;\n /** Log an unhandled request error to the (redacting) logger — shared by {@link runLifecycle} and the\n * bare fast path ({@link bareError}) so both record the same fields. Never throws; never leaks. */\n private logRequestError;\n private readAndValidateBody;\n /** Apply validation and its recovery hook on the generic lifecycle lane. Recovery is completed\n * before derives/beforeHandle run, matching the body-only and query-only execution lanes. */\n private applyLifecycleValidation;\n /**\n * Read the body as text, capped at `maxBodyBytes`. Rejects (`null`) on a\n * `Content-Length` over the cap *before* buffering, and aborts mid-stream once the\n * running byte count exceeds it — so a lying or absent length can't force us to\n * buffer an oversized payload.\n *\n * Fast path: when a non-chunked request carries a `Content-Length` within the cap,\n * a native `req.json()` is already bounded — under HTTP/1.1 + HTTP/2 framing the\n * runtime delivers at most `Content-Length` bytes — so we skip the manual stream\n * loop and a separate text decode. It trusts the wire\n * *framing*, not the header value: nifra only ever receives framed Requests from the\n * runtime's HTTP server, never a hand-built one with a mismatched length. Chunked or\n * length-less bodies fall through to the streaming byte-cap guard below.\n */\n private readBoundedJson;\n /** Adapt one route's compiled execution plan to Bun's already-matched request shape. Route\n * semantics remain in the plan; this closure only supplies native params and deadline fallback. */\n private compileBunNativeHandler;\n /** Compile portable route registrations into Bun's native route table. Apps with request-rewrite\n * hooks or WebSockets retain the single portable dispatcher because those features must run before\n * route selection/upgrade. Named wildcards also stay on the fallback until Bun exposes their raw\n * capture semantics; static and `:param` routes take the native lane. */\n private buildBunNativeRoutes;\n /**\n * Start a `Bun.serve` instance bound to `port` (use `0` for an ephemeral port).\n *\n * `reusePort` sets `SO_REUSEPORT` so **multiple processes can bind the same port** and the kernel\n * load-balances connections across them — the standard way to use every core (Bun is\n * single-threaded per process). Spawn one process per core, each calling\n * `app.listen(PORT, { reusePort: true })`; see `examples/cluster.ts`. Every process must opt in,\n * and all of them must be the same app. Linux balances ~evenly; macOS accepts the flag but may\n * favor one socket (fine for dev, measure on Linux for production numbers).\n *\n * `hostname` is the bind address, defaulting to Bun's `0.0.0.0` (every interface). Pass\n * `\"127.0.0.1\"` to bind loopback only - an admin surface, a sidecar, or anything that must not be\n * reachable off the box. Omitting it when you meant to restrict is a real exposure, so it is a\n * first-class option rather than something a caller has to drop down to `Bun.serve` for.\n */\n listen(port: number, options?: {\n readonly reusePort?: boolean;\n readonly hostname?: string;\n }): RunningServer;\n /**\n * Gracefully stop: wait for in-flight requests to finish (up to `drainMs`), then\n * issue a single terminal stop — graceful if everything drained, forced if\n * stragglers remain. Safe to call when not listening.\n *\n * The Bun semantics: poll `pendingRequests` (awaiting\n * `stop()`'s promise drops in-flight requests), and decide graceful-vs-forced in\n * ONE call (Bun can't escalate an already-graceful `stop()` to a forced close).\n * New connections may be accepted during the drain window; in a real deploy the\n * load balancer has already stopped routing here, and `drainMs` bounds it.\n */\n stop({ drainMs }?: {\n drainMs?: number;\n }): Promise<void>;\n private installSignalHandlers;\n}",
|
|
9977
|
+
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly catalog;\n /** WebSocket routes, matched separately at upgrade time (a GET + `Upgrade: websocket`). */\n private readonly wsRouter;\n private wsRouteCount;\n /** In-process pub/sub backing `ws.subscribe(topic)` + `app.publish(topic, data)` (single-instance).\n * Created by the first `app.ws()` via the `@nifrajs/core/ws` runtime — `undefined` until then, so a\n * no-WebSocket app never constructs (or bundles) it. */\n private topics;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n /** Opt-in caller-IP trust declaration; `undefined` = socket peer only, no forwarded header believed. */\n private readonly clientIpTrust;\n private readonly acceptInboundDeadlines;\n private readonly maxInboundDeadlineMs;\n private readonly deadlineAdmissionOptions;\n private readonly gracefulSignals;\n /** Capacity-admission gate; `undefined` = off (the request path pays nothing). */\n private readonly capacityGate;\n private readonly onCapabilityUse;\n private readonly capabilityInterceptors;\n private readonly capabilityObservers;\n /** The installed effect-ledger runtime (owns the sink + per-route resolution + settle), or\n * `undefined` when the effect-ledger plugin is not installed. */\n private effectLedgerRuntime;\n /** The installed idempotency runtime (owns the app-wide default store + the dedupe lane), or\n * `undefined` when the idempotency plugin is not installed. */\n private idempotencyRuntime;\n /** Installed opt-in runtime for `.tool()`/`.resource()`/`.prompt()`; `undefined` until `.use(mcp())`. */\n private mcpRuntime;\n /** Installed Node-direct renderer for direct `resolveNode()` callers; `undefined` until `.use(nodeDirect())`. */\n private nodeOutcomeRuntime;\n /** Installed streaming runtime for `.sse()` routes; `undefined` until `.use(streaming())`. */\n private sseRuntime;\n /** Installed WebSocket runtime for `.ws()` routes; `undefined` until `.use(websocket())`. */\n private wsRuntime;\n private readonly logger;\n /** App-wide validation-error fallback; a route's own `schema.onValidationError` takes precedence. */\n private readonly defaultOnValidationError?;\n private bunServer;\n private sealed;\n private readonly derives;\n private readonly decorations;\n private readonly beforeHandleHooks;\n private readonly afterHandleHooks;\n private readonly onErrorHooks;\n private readonly aroundHooks;\n private readonly onRequestHooks;\n private readonly onResponseHooks;\n private readonly onResponseFinalizedHooks;\n private readonly responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\n /** Order-scoped evidence captured by routes registered after an assured plugin. */\n private readonly activeAssurance;\n /** App-wide evidence from global hooks; applies retroactively to every route. */\n private readonly globalAssurance;\n /** App-declared MCP resources / prompts (via {@link resource} / {@link prompt}), read by `nifra mcp`. */\n private readonly mcpResourceList;\n private readonly mcpPromptList;\n constructor(options?: ServerOptions);\n private assertConfigurable;\n /** Add a per-request, computed context extension for subsequent routes. */\n derive<D extends object>(fn: (context: Context & Ctx) => MaybePromise<D>): Server<R, Ctx & D>;\n /** Add a static context value for subsequent routes. */\n decorate<const K extends string, V>(key: K, value: V): Server<R, Ctx & Record<K, V>>;\n /**\n * Run before routing on the raw request. Return a `Response` to short-circuit, or a replacement\n * `Request` to continue routing with a rewritten method/URL/headers. Global.\n */\n onRequest(fn: (req: Request, platform?: Platform<EnvOf<Ctx>>) => MaybePromise<OnRequestResult>): this;\n /** Run after validation, before the handler; a non-`undefined` return short-circuits. Order-scoped. */\n beforeHandle(fn: (context: Context & Ctx) => MaybePromise<unknown>): this;\n /**\n * Wrap the matched route lifecycle for subsequent routes. This is intentionally generic over the\n * route output, so wrappers like async context storage do not force Node's direct JSON path through\n * a Web `Response`. The first registered wrapper is outermost.\n */\n around(fn: <T>(context: Context & Ctx, next: () => MaybePromise<T>) => MaybePromise<T>): this;\n /**\n * Asynchronously admit each subsequent `executeCapability()` call before its owned effect runs.\n * Interceptors receive token-only metadata plus an abort signal and must call `next()` exactly once\n * to admit. Returning without `next()`, timing out, aborting, or throwing fails the effect closed.\n */\n aroundCapability(interceptor: CapabilityInterceptor, options?: AroundCapabilityOptions): this;\n /** Observe token-only admission/execution lifecycle events for subsequent capability routes. */\n observeCapability(observer: EffectLifecycleObserver): this;\n /** Transform the handler's result before it is serialized. Order-scoped. */\n afterHandle(fn: (result: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Handle a thrown error; a non-`undefined` return becomes the response (else the default 500). Order-scoped. */\n onError(fn: (error: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Transform every outgoing response — success, error, 404, 405, short-circuit. Global. */\n onResponse(fn: (response: Response, req: Request) => MaybePromise<Response>): this;\n /** Observe the terminal response after all transformations. Observers are ordered and fail-open. */\n onResponseFinalized(fn: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>): this;\n /**\n * Apply a type-**identity** plugin ({@link IdentityPlugin}, from {@link defineIdentityPlugin}) — it\n * registers routes/hooks but doesn't change the types, so this returns `this` with the route registry\n * and context fully intact. This overload exists specifically so a *named* identity plugin (e.g.\n * `@nifrajs/better-auth`) threads the registry: its `& { pluginName }` intersection would otherwise\n * defeat the generic inference of the transforming overload below and collapse the result to `any`.\n */\n use(plugin: IdentityPlugin): this;\n /**\n * Apply a **plugin function** — `(app) => app`, typically built with {@link definePlugin}. It's\n * called with `this` and its result is returned, so an inline plugin's `derive`/`decorate` thread\n * the added context to handlers defined after `use` (the overload is generic over the concrete\n * `this`). A named plugin already applied is skipped (idempotent dedupe).\n */\n use<Out extends AnyServer>(plugin: (app: this) => Out): Out;\n /**\n * Apply a {@link Middleware} bundle — wire each hook it provides to its lifecycle point. Returns\n * `this` (no context-type merging); call it before the routes its `beforeHandle`/`afterHandle`\n * should cover (those are order-scoped; `onRequest`/`onResponse` are global). A named bundle already\n * applied is skipped (idempotent).\n */\n use(mw: Middleware): this;\n get<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n get<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Register a **typed SSE route** — a GET endpoint streaming `text/event-stream` whose event\n * payloads are contracted by `schema.sse`. The handler receives the validated context plus a\n * {@link TypedSSEStream}: `stream.send(event)` is compile-time-checked against the schema and\n * JSON-serialized into the SSE `data:` field. The typed client sees the marker and grows a\n * `.subscribe(onEvent)` for the route with the same payload type — end-to-end typed streaming.\n *\n * import { streaming } from \"@nifrajs/core/sse\" // .use(streaming()) enables .sse()\n * const app = server().use(streaming()).sse(\"/feed\", { sse: t.object({ id: t.integer(), title: t.string() }) },\n * async (c, stream) => {\n * stream.send({ id: 1, title: \"hello\" }) // typed\n * await waitForDisconnect(stream.signal)\n * },\n * { keepAlive: 15_000 })\n *\n * // client: const off = api.feed.subscribe((post) => console.log(post.title))\n *\n * `init` passes through to the underlying {@link sse} helper (`keepAlive`, extra headers). The\n * connection closes when the handler resolves, `stream.close()` runs, or the client disconnects\n * (`stream.signal`). Query/body schemas validate exactly as on any other route.\n */\n sse<Path extends string, S extends RouteSchema & {\n sse: StandardSchemaV1;\n }>(path: Path, schema: S, run: (context: Context<Path, S> & Ctx, stream: TypedSSEStream<InferOutput<S[\"sse\"]>>) => void | Promise<void>, init?: SSEInit): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, Response>>, Ctx>;\n post<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n post<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n put<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n put<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n patch<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n patch<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n delete<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n delete<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Declare an **MCP tool** an agent can call (via `nifra mcp`, or a mounted MCP endpoint): a typed\n * `POST /_nifra/tool/<name>` route whose `input`/`output` schemas contract the call and surface in\n * `tools/list`. Requires `.use(mcp())` - without it, `.tool()` is a registration error, so an\n * ordinary HTTP app never bundles the MCP wiring. Siblings: {@link resource}, {@link prompt}.\n *\n * import { mcp } from \"@nifrajs/core/mcp\"\n * const app = server().use(mcp()).tool(\n * \"search\",\n * { description: \"Search posts\", input: t.object({ q: t.string() }) },\n * ({ q }) => findPosts(q),\n * )\n */\n tool<Name extends string, S extends {\n description: string;\n input: StandardSchemaV1;\n output?: StandardSchemaV1;\n annotations?: ToolAnnotations;\n }, H extends (input: InferOutput<S[\"input\"]>, ctx: Context & Ctx) => MaybePromise<S[\"output\"] extends StandardSchemaV1 ? InferOutput<S[\"output\"]> : unknown>>(name: Name, config: S, handler: H): Server<AddRoute<R, \"POST\", `/_nifra/tool/${Name}`, RouteInfoFor<`/_nifra/tool/${Name}`, S[\"output\"] extends StandardSchemaV1 ? {\n body: S[\"input\"];\n response: S[\"output\"];\n } : {\n body: S[\"input\"];\n }, OutputOf<H>>>, Ctx>;\n /**\n * Declare an MCP **resource** — read-only data an agent can fetch through `nifra mcp` (app config, a\n * generated document, …). `read` runs in the app process, so capture whatever app state it needs in the\n * closure. `uri` is the MCP resource identifier (e.g. `\"myapp://config\"`). The sibling of {@link tool}\n * for the resource half of MCP.\n */\n resource(uri: string, config: {\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n }, read: McpResourceDescriptor[\"read\"]): Server<R, Ctx>;\n /**\n * Declare an MCP **prompt** — a reusable prompt template an agent can fetch through `nifra mcp`.\n * `handler` receives the caller's arguments and returns the rendered messages.\n */\n prompt(name: string, config: {\n readonly description: string;\n readonly arguments?: readonly PromptArgument[];\n }, handler: McpPromptDescriptor[\"handler\"]): Server<R, Ctx>;\n /** The MCP resources declared via {@link resource} — enumerated by `nifra mcp`. */\n mcpResources(): readonly McpResourceDescriptor[];\n /** The MCP prompts declared via {@link prompt} — enumerated by `nifra mcp`. */\n mcpPrompts(): readonly McpPromptDescriptor[];\n /**\n * Register a **WebSocket** route. The connection upgrades on a `GET` to `path` carrying\n * `Upgrade: websocket`; the optional `handler.upgrade(c)` runs in the request context first and may\n * reject (return a `Response`) or seed per-connection `ws.data`. WebSockets are served by the\n * adapter (`listen()`, `@nifrajs/node`, `@nifrajs/deno`, `toFetchHandler`) — not by bare `app.fetch`, which\n * has no socket (a WS path through `app.fetch` is a normal HTTP response).\n *\n * The route also enters the type-level registry (under the pseudo-method `\"WS\"`), so the typed\n * client grows a `.ws()` handle for it: `messageSchema` types what the client may `send`,\n * `sendSchema` types the frames it receives. Passing explicit type arguments (`ws<MyData>(…)`)\n * defeats path-literal inference and skips the registry entry - the route still serves, it is just\n * invisible to `client<App>`; prefer typing `data` via `upgrade()`'s return.\n *\n * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined, Send extends StandardSchemaV1 | undefined = undefined, Path extends string = string>(path: Path, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema, Send>): string extends Path ? Server<R, Ctx> : Server<AddRoute<R, \"WS\", Path, WsRouteInfoFor<Path, Schema, Send>>, Ctx>;\n /**\n * Broadcast `data` to every WebSocket connection subscribed to `topic` (via `ws.subscribe(topic)`).\n * In-process and **single-instance** (see {@link TopicRegistry}) — a multi-instance deploy must bridge\n * an external fan-out (Redis, a Durable Object) to this. A no-op when nobody is subscribed.\n */\n publish(topic: string, data: string | ArrayBufferView | ArrayBuffer): void;\n private route;\n /**\n * Low-level route registration shared by the inline builder and `implement()`.\n * Captures the server's current `derive`/`decorate` chain into the route — this\n * is the \"compiled\", order-scoped per-route chain.\n */\n register(method: Method, path: string, schema: RouteSchema | undefined, handler: (context: never) => unknown): void;\n /** Register a contract/group route batch atomically. Every route captures the same current chain it\n * would capture through {@link register}; no route becomes visible unless the full batch validates. */\n registerBatch(routes: readonly {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n readonly handler: (context: never) => unknown;\n }[]): void;\n private prepareRoute;\n /** Collapse route-invariant lifecycle decisions into one runner at registration. The request path\n * performs no eligibility ladder: it supplies request state to this already-selected plan. */\n private compileExecutionPlan;\n /** The idempotency lane's bridge back into the normal matched lanes, resolved to a concrete Response\n * (the lane buffers the body, then replays it through the route's real validation + handler). */\n private idempotencyRunLanes;\n /** @internal Symbol-keyed install seam for the `idempotency()` plugin. Off the public typed surface. */\n [INSTALL_IDEMPOTENCY](runtime: IdempotencyRuntime): void;\n /** @internal Symbol-keyed install seam for the `mcp()` plugin. Off the public typed surface. */\n [INSTALL_MCP](runtime: McpRuntime): void;\n /** @internal Symbol-keyed install seam for the `nodeDirect()` plugin. Off the public typed surface. */\n [INSTALL_NODE_DIRECT](runtime: NodeOutcomeRuntime): void;\n /** @internal Symbol-keyed install seam for the `streaming()` plugin. Off the public typed surface. */\n [INSTALL_SSE](runtime: SseRuntime): void;\n /** @internal Symbol-keyed install seam for the `websocket()` plugin. Off the public typed surface. */\n [INSTALL_WS](runtime: WsRuntime): void;\n /**\n * Merge another server's routes into this one — the composition escape hatch for large apps.\n *\n * WHY: the fluent chain accumulates one type-alias level per route, and TypeScript resolves\n * that stack in one recursion — a single chain hits TS2589 at ~95 routes. Groups keep every\n * chain short: build each domain (`listings`, `agents`, …) as its own `server()` (its registry\n * resolves independently), then `app.merge(listings).merge(agents)` — each merge adds ONE level\n * regardless of group size. 300+ routes stay fully typed (see many-routes.test-d.ts). The\n * other escape hatch is contract-first `implement()`, whose registry is a single object type.\n *\n * Semantics: merged routes keep the chains captured where they were DEFINED — the group's\n * `derive`/`decorate`/`beforeHandle`/`afterHandle`/`onError`/`around` apply to its routes\n * exactly as they did standalone, so a group wires its own plugins. The group's request-level\n * hooks (`onRequest`/`onResponse`/`onResponseFinalized`) are appended to this server's. This\n * server's route-scoped chains do NOT retroactively wrap merged routes (order-scoped, like\n * routes registered before a `derive`). Fail closed: a path+method collision throws\n * `RouteConfigError` at merge time, and a group with WebSocket routes is refused (register\n * those on the parent).\n */\n merge<R2 extends Registry, Ctx2>(other: Server<R2, Ctx2>): Server<R & R2, Ctx>;\n /** A fused renderer closes over runtime services to keep its seven-argument JSC fast path. Merging\n * rebinds that closure once to the executing server; generic plans already receive the runtime. */\n private bindFusedRuntime;\n /**\n * Enumerate the registered routes (method, path, input schemas), in registration\n * order. Powers `toOpenAPI` and other introspection; the router trie itself no\n * longer holds the original patterns.\n */\n routes(): ReadonlyArray<RouteDescriptor>;\n /**\n * Resolve a `Request` to a `Response` — the whole lifecycle, testable without a port. The\n * optional `platform` carries edge inputs (`env`, `waitUntil`); edge adapters pass it, and\n * Bun/Node/Deno omit it (then `c.env` is `undefined` and `c.waitUntil` runs fire-and-forget).\n */\n fetch(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<Response>;\n private fetchSource;\n private fetchSourceInner;\n /** Web response path when Bun already matched the route. The lifecycle and response hooks remain\n * exactly the same as {@link fetchSource}; only portable URL scanning + trie lookup are skipped. */\n private fetchMatched;\n private fetchMatchedInner;\n /**\n * Run `produce` under the capacity gate: admit → run → release exactly once when the response is\n * produced (or the run throws). Only reached when {@link capacityGate} is set, so the off path pays\n * nothing. The slot is held for the duration of handler execution, not the streaming of the body —\n * capacity here bounds concurrent *work*, matching how in-flight is counted.\n */\n private admitGated;\n private runAdmitted;\n /**\n * Like {@link fetch}, but renders a plain-data result **without** building a Web `Response` — the\n * `@nifrajs/node` adapter serializes the returned primitives straight to the socket, skipping the undici\n * `Response` build + body drain (the bulk of the Node bridge cost, measured ≈4µs/req). A handler that\n * returns a `Response`, an error/short-circuit, or any registered `onResponse` hook falls back to the\n * full Web path (`{ kind: \"response\" }`), so behavior is identical — only the common JSON-data case is\n * faster. Same lifecycle as {@link fetch} (body cap, validation, hooks all run); only the final\n * render differs.\n */\n resolveNode(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n resolveNodeSource(source: RequestSource, platform?: Platform<EnvOf<Ctx>>, suppliedRuntime?: NodeOutcomeRuntime): MaybePromise<NodeServeOutcome>;\n /**\n * Resolve a WebSocket upgrade — the seam every serving adapter uses. Returns `pass` (not a WS\n * upgrade for a registered route → handle as normal HTTP), `reject` (a WS route matched but\n * `upgrade()` rejected, or the path was malformed → return `response`), or `upgrade` (perform the\n * runtime upgrade, then dispatch the native socket's events to `handler`, seeding `ws.data` with\n * `data`). Runs the route's `upgrade(c)` guard in a real request context. Synchronous unless\n * `upgrade()` is async; a throw rejects with a flat 500 (no detail leaked).\n */\n resolveWebSocketUpgrade(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<WebSocketUpgradeOutcome>;\n /** Bun `fetch` when WS routes exist: try a WS upgrade first, else run the normal HTTP lifecycle.\n * `undefined` ⇒ Bun owns the upgraded socket; a `Response` ⇒ a normal reply or a rejected upgrade.\n * (The socket dispatch itself lives in `ws-bun.ts`, loaded via `@nifrajs/core/ws`.) */\n private bunFetchWithWebSocket;\n /**\n * The shared lifecycle, generic over how the final value is rendered: `finalize` turns a handler's\n * result + `set` into the output `T` (`toResponse` → a Web `Response`; `toNodeOutcome` → node-direct\n * primitives), `wrapResponse` lifts an early/error `Response` into that same `T`, and `onTimeout`\n * produces the 503. The Web `fetch` and `resolveNode` are thin callers over this one routing +\n * context + lifecycle implementation — no duplication across the trust boundary.\n */\n /** Apply the `clientIp` trust declaration to the adapter's raw socket peer, returning a platform\n * whose `clientIp` is the derived caller. Only called when a trust declaration is configured. */\n private deriveClientIp;\n private dispatch;\n /**\n * onRequest short-circuit path. Synchronous as long as every hook returns synchronously (the\n * common case — e.g. CORS returning `undefined` for a non-preflight request): an `async` version\n * here put EVERY request of any app with one onRequest hook onto the promise machinery, profiled\n * at ~13% of a realistic request. The first hook that returns a Promise hands the REMAINING\n * hooks to the async continuation; behavior is identical.\n */\n private runWithOnRequest;\n /** Async tail of {@link runWithOnRequest}: applies the first awaited hook's outcome, then runs\n * the remaining hooks (awaiting freely — we're already async here). */\n private continueOnRequest;\n private takeResponseRequest;\n /**\n * Route → build context → run. Synchronous through to the handler for a **bare** route\n * (selected by its compiled plan), so a sync handler produces its result with zero promise allocations;\n * routes with validation/hooks keep the full async {@link runLifecycle}, unchanged.\n */\n private routeAndRun;\n /** Run a route that has already been matched by the runtime or Nifra's portable router. */\n private runMatched;\n /** Supply request-specific deadline state to the route's precompiled execution plan. */\n private runMatchedLanes;\n /** @internal Symbol-keyed install seam for the `effectLedger()` plugin. Off the public typed surface. */\n [INSTALL_EFFECT_LEDGER](runtime: EffectLedgerRuntime): void;\n /** The narrowest bare route: a syntactic `() => ...` handler cannot observe the context argument, so\n * successful requests can skip allocating `RequestContext`. Errors still allocate one for logging. */\n private runContextlessBare;\n private contextlessBareError;\n /**\n * The synchronous fast path selected by a route's execution plan: apply static decorations, call the\n * handler, render the result — **no `await`** unless the handler itself returns a promise. It mirrors\n * the bare slice of {@link runLifecycle} (which a bare route would otherwise no-op through) and shares\n * {@link logRequestError}; a bare route has no `onError` hooks, so error handling is fully synchronous\n * (a thrown `Response` is control flow; anything else is a logged flat 500). This is where nifra skips\n * the per-request async-frame tax — the same win codegen routers get, but without `eval`.\n */\n private runBare;\n /** Bare-route error rendering — identical to {@link runLifecycle}'s catch minus the (absent) onError\n * loop: a thrown `Response` is returned as deliberate control flow; anything else is logged + 500. */\n /**\n * Build a route's fused Web renderer. Composition happens once at\n * registration; the returned closure is what every request to the route runs. Behavior is\n * byte-identical to the generic `runBare`/`runContextlessBare` + `toResponse` pair — same\n * decoration order, same error routing (thrown `Response` = control flow; anything else logs and\n * 500s), same respond semantics (the lifecycle parity suite pins it).\n */\n private buildFusedWeb;\n private bareError;\n private runWithAround;\n private runAround;\n private runBodyOnly;\n /** Validate + run the handler for the bodyOnly path — shared by the inline fast path and the\n * streaming fallback. A method (not per-request closures) so the hot path allocates nothing\n * beyond the one `.then` continuation. */\n private finishBodyOnly;\n private executeHandler;\n private handleValidationErrorRecovery;\n private applyBodyValidation;\n private runQueryOnly;\n /** Validate-result → set `ctx.query` → run handler. A method (not a per-request closure), the\n * query analogue of {@link applyBodyValidation}. */\n private applyQueryValidation;\n /**\n * Thread the response through each global `onResponse` hook. Stays SYNCHRONOUS until a hook\n * actually returns a Promise — an `async` version forced a promise + microtask on EVERY response\n * of any app with an onResponse hook (cors/securityHeaders/etag/timing all use onResponse), the\n * same ~13%/req tax the onRequest walk was de-async'd to avoid. The first async hook hands the\n * rest to {@link continueOnResponse}.\n */\n private applyOnResponse;\n private applyOnResponseAndFinalize;\n private completeResponseFinalization;\n private failResponseFinalization;\n /** Notify terminal observers in order while isolating both sync and async failures. */\n private notifyResponseFinalized;\n /** Async tail of {@link applyOnResponse}: runs the remaining hooks once one has gone async. */\n private continueOnResponse;\n /**\n * Bound the response time. On timeout we abort `ctx.signal` (so cancellation-aware\n * handlers can bail) and return 503; the in-flight work keeps running but its\n * result is discarded — JS can't forcibly cancel a promise.\n */\n private withTimeout;\n /**\n * The post-match lifecycle: validate → derive → beforeHandle → handler → afterHandle, with onError.\n * Generic over the render: a success value goes through `finalize(result, set)` (a Web `Response`, or\n * node-direct primitives); an early/error `Response` (validation, thrown, 500) through `wrapResponse`.\n */\n private runLifecycle;\n private handleLifecycleError;\n /** Log an unhandled request error to the (redacting) logger — shared by {@link runLifecycle} and the\n * bare fast path ({@link bareError}) so both record the same fields. Never throws; never leaks. */\n private logRequestError;\n private readAndValidateBody;\n /** Apply validation and its recovery hook on the generic lifecycle lane. Recovery is completed\n * before derives/beforeHandle run, matching the body-only and query-only execution lanes. */\n private applyLifecycleValidation;\n /**\n * Read the body as text, capped at `maxBodyBytes`. Rejects (`null`) on a\n * `Content-Length` over the cap *before* buffering, and aborts mid-stream once the\n * running byte count exceeds it — so a lying or absent length can't force us to\n * buffer an oversized payload.\n *\n * Fast path: when a non-chunked request carries a `Content-Length` within the cap,\n * a native `req.json()` is already bounded — under HTTP/1.1 + HTTP/2 framing the\n * runtime delivers at most `Content-Length` bytes — so we skip the manual stream\n * loop and a separate text decode. It trusts the wire\n * *framing*, not the header value: nifra only ever receives framed Requests from the\n * runtime's HTTP server, never a hand-built one with a mismatched length. Chunked or\n * length-less bodies fall through to the streaming byte-cap guard below.\n */\n private readBoundedJson;\n /** Adapt one route's compiled execution plan to Bun's already-matched request shape. Route\n * semantics remain in the plan; this closure only supplies native params and deadline fallback. */\n private compileBunNativeHandler;\n /** Compile portable route registrations into Bun's native route table. Apps with request-rewrite\n * hooks or WebSockets retain the single portable dispatcher because those features must run before\n * route selection/upgrade. Named wildcards also stay on the fallback until Bun exposes their raw\n * capture semantics; static and `:param` routes take the native lane. */\n private buildBunNativeRoutes;\n /**\n * Start a `Bun.serve` instance bound to `port` (use `0` for an ephemeral port).\n *\n * `reusePort` sets `SO_REUSEPORT` so **multiple processes can bind the same port** and the kernel\n * load-balances connections across them — the standard way to use every core (Bun is\n * single-threaded per process). Spawn one process per core, each calling\n * `app.listen(PORT, { reusePort: true })`; see `examples/cluster.ts`. Every process must opt in,\n * and all of them must be the same app. Linux balances ~evenly; macOS accepts the flag but may\n * favor one socket (fine for dev, measure on Linux for production numbers).\n *\n * `hostname` is the bind address, defaulting to Bun's `0.0.0.0` (every interface). Pass\n * `\"127.0.0.1\"` to bind loopback only - an admin surface, a sidecar, or anything that must not be\n * reachable off the box. Omitting it when you meant to restrict is a real exposure, so it is a\n * first-class option rather than something a caller has to drop down to `Bun.serve` for.\n */\n listen(port: number, options?: {\n readonly reusePort?: boolean;\n readonly hostname?: string;\n }): RunningServer;\n /**\n * Gracefully stop: wait for in-flight requests to finish (up to `drainMs`), then\n * issue a single terminal stop — graceful if everything drained, forced if\n * stragglers remain. Safe to call when not listening.\n *\n * The Bun semantics: poll `pendingRequests` (awaiting\n * `stop()`'s promise drops in-flight requests), and decide graceful-vs-forced in\n * ONE call (Bun can't escalate an already-graceful `stop()` to a forced close).\n * New connections may be accepted during the drain window; in a real deploy the\n * load balancer has already stopped routing here, and `drainMs` bounds it.\n */\n stop({ drainMs }?: {\n drainMs?: number;\n }): Promise<void>;\n private installSignalHandlers;\n}",
|
|
8575
9978
|
"doc": "/**\n * The inline server. Routes are chainable and fully type-inferred. `derive`/\n * `decorate` extend the handler context (`Ctx`) for routes defined *after* them,\n * with full types; `Ctx` is server-only and never touches the client registry.\n *\n * app.decorate(\"db\", db).derive((c) => ({ user: auth(c) }))\n * .get(\"/me\", (c) => c.user) // c.user + c.db are typed\n */"
|
|
8576
9979
|
},
|
|
8577
9980
|
{
|
|
@@ -8963,6 +10366,12 @@
|
|
|
8963
10366
|
"signature": "export declare function splitSections(markdown: string): DocSection[];",
|
|
8964
10367
|
"doc": "/** Split the generated doc into its `##` sections (the `# title` intro becomes \"Overview\"). */"
|
|
8965
10368
|
},
|
|
10369
|
+
{
|
|
10370
|
+
"name": "SQLiteClient",
|
|
10371
|
+
"kind": "interface",
|
|
10372
|
+
"package": "@nifrajs/core",
|
|
10373
|
+
"signature": "export interface SQLiteClient {\n exec(sql: string): unknown;\n query(sql: string): SQLiteStatement;\n}"
|
|
10374
|
+
},
|
|
8966
10375
|
{
|
|
8967
10376
|
"name": "SqliteDatabaseLike",
|
|
8968
10377
|
"kind": "interface",
|
|
@@ -8970,6 +10379,30 @@
|
|
|
8970
10379
|
"signature": "export interface SqliteDatabaseLike {\n /** Prepare a statement; `all` runs it and returns row objects. */\n prepare(sql: string): {\n all(...params: unknown[]): unknown[];\n };\n /** Execute a statement for its side effect (used only for `PRAGMA query_only`). */\n run(sql: string): unknown;\n}",
|
|
8971
10380
|
"doc": "/** The structural slice of `bun:sqlite`'s `Database` this package needs. */"
|
|
8972
10381
|
},
|
|
10382
|
+
{
|
|
10383
|
+
"name": "SQLiteDurableExecutionAdapter",
|
|
10384
|
+
"kind": "class",
|
|
10385
|
+
"package": "@nifrajs/core",
|
|
10386
|
+
"signature": "export declare class SQLiteDurableExecutionAdapter implements DurableExecutionAdapter {\n readonly effects: DurableEffectStore;\n readonly approvals: ApprovalStore;\n readonly sagas: SagaStore;\n readonly leases: ReconciliationLeaseStore;\n readonly backend: SQLiteDurableRecordBackend;\n constructor(client: SQLiteClient, options?: {\n readonly tablePrefix?: string;\n });\n migrate(): void;\n}"
|
|
10387
|
+
},
|
|
10388
|
+
{
|
|
10389
|
+
"name": "SQLiteDurableRecordBackend",
|
|
10390
|
+
"kind": "class",
|
|
10391
|
+
"package": "@nifrajs/core",
|
|
10392
|
+
"signature": "export declare class SQLiteDurableRecordBackend implements DurableRecordBackend {\n private readonly client;\n readonly recordsTable: string;\n readonly leasesTable: string;\n constructor(client: SQLiteClient, options?: {\n readonly tablePrefix?: string;\n });\n migrate(): void;\n create(kind: DurableRecordKind, id: string, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n get<T extends {\n readonly version: number;\n }>(kind: DurableRecordKind, id: string): Promise<T | undefined>;\n compareAndSet(kind: DurableRecordKind, id: string, expectedVersion: number, record: {\n readonly version: number;\n readonly state?: string;\n readonly updatedAt?: number;\n }): Promise<boolean>;\n scan<T extends {\n readonly state: string;\n readonly updatedAt: number;\n }>(kind: DurableRecordKind, input: ReconciliationScanOptions<string>): Promise<ReconciliationScanPage<T>>;\n acquireLease(input: Parameters<DurableRecordBackend[\"acquireLease\"]>[0]): Promise<ReconciliationLease | undefined>;\n renewLease(input: Parameters<DurableRecordBackend[\"renewLease\"]>[0]): Promise<boolean>;\n checkpointLease(input: Parameters<DurableRecordBackend[\"checkpointLease\"]>[0]): Promise<boolean>;\n releaseLease(input: Parameters<DurableRecordBackend[\"releaseLease\"]>[0]): Promise<boolean>;\n}"
|
|
10393
|
+
},
|
|
10394
|
+
{
|
|
10395
|
+
"name": "SQLiteRunResult",
|
|
10396
|
+
"kind": "interface",
|
|
10397
|
+
"package": "@nifrajs/core",
|
|
10398
|
+
"signature": "export interface SQLiteRunResult {\n readonly changes: number;\n}"
|
|
10399
|
+
},
|
|
10400
|
+
{
|
|
10401
|
+
"name": "SQLiteStatement",
|
|
10402
|
+
"kind": "interface",
|
|
10403
|
+
"package": "@nifrajs/core",
|
|
10404
|
+
"signature": "export interface SQLiteStatement {\n run(...values: readonly unknown[]): SQLiteRunResult;\n get(...values: readonly unknown[]): Record<string, unknown> | null | undefined;\n all(...values: readonly unknown[]): readonly (Record<string, unknown> | undefined)[];\n}"
|
|
10405
|
+
},
|
|
8973
10406
|
{
|
|
8974
10407
|
"name": "sse",
|
|
8975
10408
|
"kind": "function",
|
|
@@ -9163,6 +10596,27 @@
|
|
|
9163
10596
|
"signature": "export interface StaticRoutes {\n /** Concrete prerendered paths — static `prerender` routes + each `getStaticPaths` entry. */\n readonly paths: string[];\n /** Per dynamic route pattern, its `getStaticPaths` `fallback` (`\"ssr\"` default). `createWebApp` uses\n * `\"404\"` to reject an unlisted path under that route at runtime (the path simply doesn't exist). */\n readonly fallbacks: Record<string, \"ssr\" | \"404\">;\n}",
|
|
9164
10597
|
"doc": "/** The static-routing facts a server needs from the route modules: which concrete paths are\n * prerendered, plus each dynamic route's `getStaticPaths` fallback policy. */"
|
|
9165
10598
|
},
|
|
10599
|
+
{
|
|
10600
|
+
"name": "STATUS_HEADER",
|
|
10601
|
+
"kind": "const",
|
|
10602
|
+
"package": "@nifrajs/web",
|
|
10603
|
+
"signature": "export declare const STATUS_HEADER = \"x-nifra-status\";",
|
|
10604
|
+
"doc": "/**\n * Response header carrying a **terminal status** a loader signalled with `notFound()` / `gone()` /\n * `statusPage(n)` during a client-side navigation's data fetch.\n *\n * A soft-nav fetches data, not a document, so the server cannot answer by rendering the `_404` page -\n * it has only JSON to return. Without this channel the two halves disagree: a crawler doing a hard\n * navigation gets a correct 404 page while a user who clicked a link gets an error or a blank screen.\n * The client reads it and renders the same boundary the server would have.\n *\n * Carried in a header rather than the body so it survives the NDJSON deferred-data path unchanged,\n * exactly like {@link REDIRECT_HEADER}.\n */"
|
|
10605
|
+
},
|
|
10606
|
+
{
|
|
10607
|
+
"name": "statusPage",
|
|
10608
|
+
"kind": "function",
|
|
10609
|
+
"package": "@nifrajs/web",
|
|
10610
|
+
"signature": "export declare function statusPage(status: number, options?: StatusPageOptions): never;",
|
|
10611
|
+
"doc": "/**\n * Render a terminal page at any 4xx/5xx status - the escape hatch behind {@link notFound} and\n * {@link gone} (402, 451, …). Uses `_<status>.tsx` if present, otherwise `_404`.\n */"
|
|
10612
|
+
},
|
|
10613
|
+
{
|
|
10614
|
+
"name": "StatusPageOptions",
|
|
10615
|
+
"kind": "interface",
|
|
10616
|
+
"package": "@nifrajs/web",
|
|
10617
|
+
"signature": "export interface StatusPageOptions {\n /**\n * Extra headers for the rendered response - `cache-control` above all.\n *\n * The defaults differ by status for a reason: a 404 may be a race with publication, so it wants a\n * short TTL, while a 410 is a promise that the URL is permanently gone and can be cached hard.\n * Getting this wrong is the difference between a crawler dropping a dead URL and re-fetching it\n * for weeks.\n */\n readonly headers?: HeadersLike;\n}",
|
|
10618
|
+
"doc": "/** Options shared by {@link notFound}, {@link gone}, and {@link statusPage}. */"
|
|
10619
|
+
},
|
|
9166
10620
|
{
|
|
9167
10621
|
"name": "StorageAdapter",
|
|
9168
10622
|
"kind": "interface",
|
|
@@ -9281,6 +10735,13 @@
|
|
|
9281
10735
|
"signature": "export declare function string(opts?: Base<string> & Optional): StandardSchemaV1<string | undefined>;",
|
|
9282
10736
|
"doc": "/** A required (or defaulted/optional) non-empty string. */"
|
|
9283
10737
|
},
|
|
10738
|
+
{
|
|
10739
|
+
"name": "stringify",
|
|
10740
|
+
"kind": "function",
|
|
10741
|
+
"package": "@nifrajs/core",
|
|
10742
|
+
"signature": "export declare function stringify(value: unknown): string;",
|
|
10743
|
+
"doc": "/** `encode` + `JSON.stringify` in one call - the rich-type equivalent of `JSON.stringify`. */"
|
|
10744
|
+
},
|
|
9284
10745
|
{
|
|
9285
10746
|
"name": "stripComments",
|
|
9286
10747
|
"kind": "function",
|
|
@@ -9308,6 +10769,13 @@
|
|
|
9308
10769
|
"signature": "export interface StylesheetEmitter {\n /** Store `css` for `path`, returning the `import \"<path>?<namespace>\"` line for the JS module. */\n emit(path: string, css: string): string;\n}",
|
|
9309
10770
|
"doc": "/**\n * Records compiled CSS and wires it into the client bundle through a virtual `?<namespace>` module —\n * the idiom the Vue plugin established (`?vue-css`). Register one per plugin `setup`; call `emit` per\n * file to stash its CSS and get back the `import` line to append to the JS module.\n */"
|
|
9310
10771
|
},
|
|
10772
|
+
{
|
|
10773
|
+
"name": "styleTags",
|
|
10774
|
+
"kind": "function",
|
|
10775
|
+
"package": "@nifrajs/web",
|
|
10776
|
+
"signature": "export declare function styleTags(styles: readonly string[]): string;",
|
|
10777
|
+
"doc": "/** `<link rel=\"stylesheet\">` tags for Bun's extracted CSS, injected into each SSR'd page's `<head>`. */"
|
|
10778
|
+
},
|
|
9311
10779
|
{
|
|
9312
10780
|
"name": "Submission",
|
|
9313
10781
|
"kind": "interface",
|
|
@@ -9558,6 +11026,13 @@
|
|
|
9558
11026
|
"package": "@nifrajs/middleware",
|
|
9559
11027
|
"signature": "export interface TimingOptions {\n /** Name for the automatic total request metric. Default `\"total\"`; set `false` to disable. */\n readonly total?: string | false;\n /** Decimal places for durations. Default `1`. */\n readonly precision?: number;\n /** Only emit timing for matching requests. Default `true`. */\n readonly enabled?: boolean | ((request: Request) => boolean);\n}"
|
|
9560
11028
|
},
|
|
11029
|
+
{
|
|
11030
|
+
"name": "timingSafeEqual",
|
|
11031
|
+
"kind": "function",
|
|
11032
|
+
"package": "@nifrajs/web",
|
|
11033
|
+
"signature": "export declare function timingSafeEqual(a: string, b: string): boolean;",
|
|
11034
|
+
"doc": "/**\n * Compare two strings without leaking, via timing, where they first differ. A length mismatch returns\n * `false` up front: the length isn't the secret, and different-length buffers can't be compared in\n * constant time anyway. Encodes to bytes first so multi-byte characters compare by content, not by\n * UTF-16 code unit.\n */"
|
|
11035
|
+
},
|
|
9561
11036
|
{
|
|
9562
11037
|
"name": "timingSafeEqualBytes",
|
|
9563
11038
|
"kind": "function",
|
|
@@ -9689,6 +11164,55 @@
|
|
|
9689
11164
|
"signature": "export interface TransitiveServerImportFinding extends ServerImportFinding {\n /** `[routeFile, ...as-written specifiers…, sink]` — the shortest path the walk found. Length 2 means\n * the route imports the sink directly (same as the regex scan's direct edge). */\n readonly chain: readonly string[];\n /** True when a precise transitive resolve wasn't possible for the first hop (a bare pkg / path alias),\n * so the chain is the honest direct edge rather than a fabricated deeper path. */\n readonly fallback: boolean;\n}",
|
|
9690
11165
|
"doc": "/** One transitive server-only finding: the route module, the route's offending top-level import (the\n * first hop / `specifier`), the line + snippet of that import, and the FULL chain to the sink. */"
|
|
9691
11166
|
},
|
|
11167
|
+
{
|
|
11168
|
+
"name": "TransportCodec",
|
|
11169
|
+
"kind": "interface",
|
|
11170
|
+
"package": "@nifrajs/core",
|
|
11171
|
+
"signature": "export interface TransportCodec {\n readonly id: string;\n readonly version: number;\n readonly mediaType: string;\n encode(value: unknown): string;\n decode(text: string): unknown;\n}"
|
|
11172
|
+
},
|
|
11173
|
+
{
|
|
11174
|
+
"name": "TransportCodecError",
|
|
11175
|
+
"kind": "class",
|
|
11176
|
+
"package": "@nifrajs/core",
|
|
11177
|
+
"signature": "export declare class TransportCodecError extends TypeError {\n constructor(message: string, options?: ErrorOptions);\n}"
|
|
11178
|
+
},
|
|
11179
|
+
{
|
|
11180
|
+
"name": "TransportCodecRegistry",
|
|
11181
|
+
"kind": "interface",
|
|
11182
|
+
"package": "@nifrajs/core",
|
|
11183
|
+
"signature": "export interface TransportCodecRegistry {\n readonly fallback: TransportCodec;\n forContentType(contentType: string | null): TransportCodec;\n negotiate(accept: string | null): TransportCodec;\n byIdentity(id: string, version: number): TransportCodec;\n}"
|
|
11184
|
+
},
|
|
11185
|
+
{
|
|
11186
|
+
"name": "transportCodecs",
|
|
11187
|
+
"kind": "function",
|
|
11188
|
+
"package": "@nifrajs/core",
|
|
11189
|
+
"signature": "export declare function transportCodecs(registry: TransportCodecRegistry, options?: TransportCodecsOptions): IdentityPlugin;"
|
|
11190
|
+
},
|
|
11191
|
+
{
|
|
11192
|
+
"name": "TransportCodecsOptions",
|
|
11193
|
+
"kind": "interface",
|
|
11194
|
+
"package": "@nifrajs/core",
|
|
11195
|
+
"signature": "export interface TransportCodecsOptions {\n /** Maximum encoded request bytes. Keep aligned with `server({ maxBodyBytes })`. */\n readonly maxBytes?: number;\n}"
|
|
11196
|
+
},
|
|
11197
|
+
{
|
|
11198
|
+
"name": "TransportDecodeOptions",
|
|
11199
|
+
"kind": "interface",
|
|
11200
|
+
"package": "@nifrajs/core",
|
|
11201
|
+
"signature": "export interface TransportDecodeOptions {\n readonly maxBytes?: number;\n}",
|
|
11202
|
+
"doc": "/**\n * Versioned, bounded codecs shared by HTTP bodies, loader streams, and WebSocket frames. Plain JSON\n * remains the zero-configuration fast path; rich wire is explicit and preserves non-JSON values.\n */"
|
|
11203
|
+
},
|
|
11204
|
+
{
|
|
11205
|
+
"name": "TransportDecodeResult",
|
|
11206
|
+
"kind": "type",
|
|
11207
|
+
"package": "@nifrajs/core",
|
|
11208
|
+
"signature": "export type TransportDecodeResult = {\n readonly matched: false;\n} | {\n readonly matched: true;\n readonly value: unknown;\n} | {\n readonly matched: true;\n readonly response: Response;\n};"
|
|
11209
|
+
},
|
|
11210
|
+
{
|
|
11211
|
+
"name": "TransportRuntime",
|
|
11212
|
+
"kind": "interface",
|
|
11213
|
+
"package": "@nifrajs/core",
|
|
11214
|
+
"signature": "export interface TransportRuntime {\n responseCodec(accept: string | null): TransportCodec;\n decodeRequest(source: TransportBodySource, contentType: string, maxBytes: number): Promise<TransportDecodeResult>;\n}"
|
|
11215
|
+
},
|
|
9692
11216
|
{
|
|
9693
11217
|
"name": "Treaty",
|
|
9694
11218
|
"kind": "type",
|
|
@@ -10315,9 +11839,16 @@
|
|
|
10315
11839
|
"name": "VERSION",
|
|
10316
11840
|
"kind": "const",
|
|
10317
11841
|
"package": "@nifrajs/core",
|
|
10318
|
-
"signature": "export declare const VERSION: \"2.
|
|
11842
|
+
"signature": "export declare const VERSION: \"2.2.0\";",
|
|
10319
11843
|
"doc": "/**\n * Current package version. A hardcoded literal on purpose — core runs on the edge (no fs), so it can't\n * read its own package.json at runtime. `scripts/version.ts` rewrites it on every release bump and\n * `check:publish` asserts it equals `@nifrajs/core`'s package version.\n */"
|
|
10320
11844
|
},
|
|
11845
|
+
{
|
|
11846
|
+
"name": "viteBundler",
|
|
11847
|
+
"kind": "const",
|
|
11848
|
+
"package": "@nifrajs/web",
|
|
11849
|
+
"signature": "export declare const viteBundler: Bundler;",
|
|
11850
|
+
"doc": "/**\n * The Vite build STRATEGY — plugged into `buildTargetWith`. `plugins` arriving through the shared\n * orchestrator are the app's Vite plugins (the escape hatch's whole reason), cast to Vite's plugin type.\n */"
|
|
11851
|
+
},
|
|
10321
11852
|
{
|
|
10322
11853
|
"name": "ViteDevServer",
|
|
10323
11854
|
"kind": "interface",
|
|
@@ -10328,7 +11859,14 @@
|
|
|
10328
11859
|
"name": "ViteDevServerOptions",
|
|
10329
11860
|
"kind": "interface",
|
|
10330
11861
|
"package": "@nifrajs/web",
|
|
10331
|
-
"signature": "export interface ViteDevServerOptions {\n /** Absolute (or cwd-relative) path to the `routes/` dir. */\n readonly routesDir: string;\n /** Client runtime module providing `mountRouter` (e.g. `\"@nifrajs/web-react/client\"`). */\n readonly clientModule: string;\n /**\n * Build the nifra app for the given dev client-entry URL
|
|
11862
|
+
"signature": "export interface ViteDevServerOptions {\n /** Absolute (or cwd-relative) path to the `routes/` dir. */\n readonly routesDir: string;\n /** Client runtime module providing `mountRouter` (e.g. `\"@nifrajs/web-react/client\"`). */\n readonly clientModule: string;\n /**\n * Build the nifra app for the given dev client-entry URL.\n *\n * `load` resolves a route module through **Vite's** graph (`ssrLoadModule`). Pass it to\n * `discoverRoutes(routesDir, { load })` so SSR and the client are resolved by the SAME toolchain.\n * Without it SSR resolves through Bun while the client resolves through Vite - two resolvers, one\n * process - which is what makes `resolve.dedupe` fail to reach SSR and produces the dual-React\n * crash. Vite re-evaluates on change, so no `importQuery` cache-buster is needed alongside it.\n */\n readonly createApp: (clientEntry: string, load: (absolutePath: string) => Promise<unknown>) => FetchApp | Promise<FetchApp>;\n /** Vite plugins — inject your framework's official plugin, e.g. `[react()]`. */\n readonly plugins?: readonly unknown[];\n /**\n * Extra `resolve.conditions` prepended ahead of nifra's defaults — some frameworks need their own\n * (e.g. Solid's `\"solid\"` condition routes `solid-js` to its source/JSX-dev build).\n */\n readonly conditions?: readonly string[];\n /**\n * Compile-time `define` replacements (e.g. Vue's `__VUE_OPTIONS_API__` flags). Vite already sets\n * `process.env.NODE_ENV` in dev; this is for framework feature flags the plugin doesn't inject.\n */\n readonly define?: Readonly<Record<string, string>>;\n /** Vite project root (default `process.cwd()`). */\n readonly root?: string;\n /** Port (default {@link DEFAULT_DEV_PORT}). */\n readonly port?: number;\n /**\n * Use polling for the file watcher. Native fs events (fsevents/inotify) are unreliable inside\n * containers, networked filesystems, and some sandboxes — there, HMR silently never fires. Set\n * `true` (or the env var `CHOKIDAR_USEPOLLING=1`) to poll instead. Default: off (native events).\n */\n readonly poll?: boolean;\n /** Vite public directory. Defaults to `<root>/public`; `false` disables it. */\n readonly publicDir?: string | false;\n}"
|
|
11863
|
+
},
|
|
11864
|
+
{
|
|
11865
|
+
"name": "viteLeakGuard",
|
|
11866
|
+
"kind": "function",
|
|
11867
|
+
"package": "@nifrajs/web",
|
|
11868
|
+
"signature": "export declare function viteLeakGuard(): LeakGuardPlugin;",
|
|
11869
|
+
"doc": "/**\n * A Vite/Rollup plugin that fails the build when server-only code or a `node:` builtin reaches the client\n * bundle - the same two guards, and the same error messages, as nifra's Bun production build.\n */"
|
|
10332
11870
|
},
|
|
10333
11871
|
{
|
|
10334
11872
|
"name": "vueAdapter",
|
|
@@ -10429,7 +11967,7 @@
|
|
|
10429
11967
|
"name": "WebSocketHandler",
|
|
10430
11968
|
"kind": "interface",
|
|
10431
11969
|
"package": "@nifrajs/core",
|
|
10432
|
-
"signature": "export interface WebSocketHandler<Data = unknown, Env = unknown, Schema extends StandardSchemaV1 | undefined = undefined, Send extends StandardSchemaV1 | undefined = undefined> {\n /**\n * Cross-site WebSocket hijacking (CSWSH) guard — checked BEFORE `upgrade()`. A browser does not\n * apply CORS to WebSocket handshakes and DOES send the page's cookies, so without an Origin check\n * any site can open an authenticated socket to your app. Set this to lock the route to known\n * origins: a string allow-list (exact `Origin` header match) or a predicate. A request whose\n * `Origin` doesn't match (or is absent, for the allow-list form) is rejected with `403` before any\n * per-connection work.\n *\n * **When omitted, the default is same-origin:** a cross-origin BROWSER handshake (an `Origin` header\n * whose host differs from the request's) is rejected with `403`. Non-browser clients (no `Origin`) and\n * same-origin browsers pass. Set this to allow specific cross-origin clients, or `() => true` for a\n * genuinely public socket. Non-browser clients can spoof `Origin`, so this is a browser-CSWSH defense,\n * not authentication — pair it with auth in `upgrade()`.\n */\n allowedOrigins?: ReadonlyArray<string> | ((origin: string | null) => boolean);\n /**\n * Runs in the HTTP request context **before** the upgrade (and after {@link allowedOrigins}) — the\n * place to authenticate or rate-limit. Return the initial per-connection `data` (→ `ws.data`), or a\n * `Response` to **reject** the upgrade (the client never connects). Omit to accept with\n * `data: undefined`. A thrown error rejects with a flat 500.\n */\n upgrade?(c: WebSocketContext<Env>): MaybePromise<Data | Response>;\n /**\n * Contract-first messages: a Standard Schema (`t`, zod, valibot, …) validating each **inbound** frame.\n * Text frames are parsed as JSON first. When set, `message` receives the validated, typed value; a\n * non-JSON or schema-invalid frame is routed to `onInvalidMessage` (or dropped if that's omitted).\n */\n messageSchema?: Schema;\n /**\n * The **outbound** frame contract (server → client), a Standard Schema. Purely type-level: it types\n * the frames the typed client's `.ws()` handle receives, and documents what this route pushes. The\n * server does NOT runtime-validate its own sends - the inbound `messageSchema` guards the trust\n * boundary; outbound honesty is the handler author's code, checked by tests.\n */\n sendSchema?: Send;\n open?(ws: NifraWebSocket<Data>): MaybePromise<void>;\n message?(ws: NifraWebSocket<Data>, data: WsMessageInput<Schema>): MaybePromise<void>;\n /** Inbound frame that failed JSON parse or `messageSchema` validation (only fires when a schema is\n * set). `raw` is the original frame; `issues` are the Standard Schema issues (one synthetic issue for\n * a JSON parse failure). Omit to silently drop invalid frames. */\n onInvalidMessage?(ws: NifraWebSocket<Data>, issues: ReadonlyArray<StandardIssue>, raw: WebSocketData): MaybePromise<void>;\n close?(ws: NifraWebSocket<Data>, code: number, reason: string): MaybePromise<void>;\n error?(ws: NifraWebSocket<Data>, error: unknown): MaybePromise<void>;\n}",
|
|
11970
|
+
"signature": "export interface WebSocketHandler<Data = unknown, Env = unknown, Schema extends StandardSchemaV1 | undefined = undefined, Send extends StandardSchemaV1 | undefined = undefined> {\n /**\n * Cross-site WebSocket hijacking (CSWSH) guard — checked BEFORE `upgrade()`. A browser does not\n * apply CORS to WebSocket handshakes and DOES send the page's cookies, so without an Origin check\n * any site can open an authenticated socket to your app. Set this to lock the route to known\n * origins: a string allow-list (exact `Origin` header match) or a predicate. A request whose\n * `Origin` doesn't match (or is absent, for the allow-list form) is rejected with `403` before any\n * per-connection work.\n *\n * **When omitted, the default is same-origin:** a cross-origin BROWSER handshake (an `Origin` header\n * whose host differs from the request's) is rejected with `403`. Non-browser clients (no `Origin`) and\n * same-origin browsers pass. Set this to allow specific cross-origin clients, or `() => true` for a\n * genuinely public socket. Non-browser clients can spoof `Origin`, so this is a browser-CSWSH defense,\n * not authentication — pair it with auth in `upgrade()`.\n */\n allowedOrigins?: ReadonlyArray<string> | ((origin: string | null) => boolean);\n /**\n * Runs in the HTTP request context **before** the upgrade (and after {@link allowedOrigins}) — the\n * place to authenticate or rate-limit. Return the initial per-connection `data` (→ `ws.data`), or a\n * `Response` to **reject** the upgrade (the client never connects). Omit to accept with\n * `data: undefined`. A thrown error rejects with a flat 500.\n */\n upgrade?(c: WebSocketContext<Env>): MaybePromise<Data | Response>;\n /**\n * Contract-first messages: a Standard Schema (`t`, zod, valibot, …) validating each **inbound** frame.\n * Text frames are parsed as JSON first. When set, `message` receives the validated, typed value; a\n * non-JSON or schema-invalid frame is routed to `onInvalidMessage` (or dropped if that's omitted).\n */\n messageSchema?: Schema;\n /**\n * The **outbound** frame contract (server → client), a Standard Schema. Purely type-level: it types\n * the frames the typed client's `.ws()` handle receives, and documents what this route pushes. The\n * server does NOT runtime-validate its own sends - the inbound `messageSchema` guards the trust\n * boundary; outbound honesty is the handler author's code, checked by tests.\n */\n sendSchema?: Send;\n /** Decode versioned transport frames before inbound schema validation. Omit for legacy JSON. */\n transport?: {\n readonly registry: TransportCodecRegistry;\n readonly maxBytes?: number;\n };\n open?(ws: NifraWebSocket<Data>): MaybePromise<void>;\n message?(ws: NifraWebSocket<Data>, data: WsMessageInput<Schema>): MaybePromise<void>;\n /** Inbound frame that failed JSON parse or `messageSchema` validation (only fires when a schema is\n * set). `raw` is the original frame; `issues` are the Standard Schema issues (one synthetic issue for\n * a JSON parse failure). Omit to silently drop invalid frames. */\n onInvalidMessage?(ws: NifraWebSocket<Data>, issues: ReadonlyArray<StandardIssue>, raw: WebSocketData): MaybePromise<void>;\n close?(ws: NifraWebSocket<Data>, code: number, reason: string): MaybePromise<void>;\n error?(ws: NifraWebSocket<Data>, error: unknown): MaybePromise<void>;\n}",
|
|
10433
11971
|
"doc": "/** A WebSocket route's lifecycle. All callbacks optional; only `message` is needed for an echo. */"
|
|
10434
11972
|
},
|
|
10435
11973
|
{
|
|
@@ -10452,6 +11990,34 @@
|
|
|
10452
11990
|
"signature": "export declare function widgetDocument(opts: DefineMcpWidgetOptions): string;",
|
|
10453
11991
|
"doc": "/** Assemble the full self-contained widget document (bridge inlined in `<head>` so body scripts can use\n * `mcpApp` immediately). */"
|
|
10454
11992
|
},
|
|
11993
|
+
{
|
|
11994
|
+
"name": "Wire",
|
|
11995
|
+
"kind": "interface",
|
|
11996
|
+
"package": "@nifrajs/core",
|
|
11997
|
+
"signature": "export interface Wire {\n /** The root value: an inline primitive/scalar, or a `{ [TAG]: \"ref\", i }` into {@link Wire.n}. */\n readonly r: unknown;\n /** Interned container and rich-type nodes, addressed by index from `ref`s. */\n readonly n: readonly unknown[];\n}",
|
|
11998
|
+
"doc": "/** The JSON-safe encoded form produced by {@link encode} and consumed by {@link decode}. */"
|
|
11999
|
+
},
|
|
12000
|
+
{
|
|
12001
|
+
"name": "WireDecodeError",
|
|
12002
|
+
"kind": "class",
|
|
12003
|
+
"package": "@nifrajs/core",
|
|
12004
|
+
"signature": "export declare class WireDecodeError extends TypeError {\n constructor(message: string);\n}",
|
|
12005
|
+
"doc": "/** Thrown by {@link decode} for a wire value carrying an unknown tag, a bad index, or malformed shape. */"
|
|
12006
|
+
},
|
|
12007
|
+
{
|
|
12008
|
+
"name": "WireDecodeLimits",
|
|
12009
|
+
"kind": "interface",
|
|
12010
|
+
"package": "@nifrajs/core",
|
|
12011
|
+
"signature": "export interface WireDecodeLimits {\n /** Maximum number of interned nodes. Default 10,000. */\n readonly maxNodes?: number;\n /** Maximum nesting depth across containers and references. Default 256. */\n readonly maxDepth?: number;\n /** Maximum total object/array/map/set entries visited. Default 100,000. */\n readonly maxCollectionEntries?: number;\n /** Maximum UTF-8 string plus decoded binary bytes materialized. Default 16 MiB. */\n readonly maxDecodedBytes?: number;\n}",
|
|
12012
|
+
"doc": "/** Resource limits applied while reconstructing transport-controlled wire data. */"
|
|
12013
|
+
},
|
|
12014
|
+
{
|
|
12015
|
+
"name": "WireEncodeError",
|
|
12016
|
+
"kind": "class",
|
|
12017
|
+
"package": "@nifrajs/core",
|
|
12018
|
+
"signature": "export declare class WireEncodeError extends TypeError {\n constructor(message: string);\n}",
|
|
12019
|
+
"doc": "/** Thrown by {@link encode} for a value it will not encode (a function or a symbol). */"
|
|
12020
|
+
},
|
|
10455
12021
|
{
|
|
10456
12022
|
"name": "withDeadlineHeader",
|
|
10457
12023
|
"kind": "function",
|
|
@@ -10533,6 +12099,13 @@
|
|
|
10533
12099
|
"signature": "export declare function writeDbFiles(target: string, choice: DbChoice): Promise<void>;",
|
|
10534
12100
|
"doc": "/** Write a DB preset's files into `target` and ensure local DB artifacts + .env are gitignored. */"
|
|
10535
12101
|
},
|
|
12102
|
+
{
|
|
12103
|
+
"name": "writeDevFiles",
|
|
12104
|
+
"kind": "function",
|
|
12105
|
+
"package": "@nifrajs/web",
|
|
12106
|
+
"signature": "export declare function writeDevFiles(options: WriteDevFilesOptions): void;",
|
|
12107
|
+
"doc": "/**\n * Generate the client entry + the HTML route that carries it.\n *\n * Route specifiers are written **relative to the entry file**, not root-relative as the Vite path writes\n * them: Vite resolves `/routes/x.tsx` against its configured root, while Bun's bundler resolves an import\n * the way the runtime does, so a leading slash there would mean the filesystem root.\n */"
|
|
12108
|
+
},
|
|
10536
12109
|
{
|
|
10537
12110
|
"name": "writeScaffoldRoute",
|
|
10538
12111
|
"kind": "function",
|