@nifrajs/cli 1.3.0 → 1.4.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/cli.js +1 -1
- package/dist/introspect.d.ts +5 -12
- package/dist/introspect.d.ts.map +1 -1
- package/dist/introspect.js +8 -23
- package/dist/introspect.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +3 -16
- package/dist/mcp.js.map +1 -1
- package/docs/llms-full.txt +47 -11
- package/docs/types.json +850 -36
- package/package.json +8 -7
- package/src/cli.ts +1 -1
- package/src/introspect.ts +15 -37
- package/src/mcp-http.ts +1 -1
- package/src/mcp.ts +7 -28
package/docs/types.json
CHANGED
|
@@ -27,6 +27,12 @@
|
|
|
27
27
|
"signature": "export type ActionData<A> = A extends (...args: never[]) => infer R ? Awaited<R> extends {\n readonly __nifraRevalidate: readonly string[];\n readonly data: infer D;\n} ? Exclude<D, Response> : Exclude<Awaited<R>, Response> : never;",
|
|
28
28
|
"doc": "/**\n * The (awaited) data return of an `action`, for typing a page component's `actionData` prop.\n * A `Response` return (redirect/custom) is excluded — it never reaches the component. A\n * `revalidate(paths, data)` wrapper (from `@nifrajs/web`) is transparent: matched structurally (so this\n * stays decoupled from `@nifrajs/web`) and unwrapped to its inner `data` — what the component receives.\n */"
|
|
29
29
|
},
|
|
30
|
+
{
|
|
31
|
+
"name": "ActiveObservation",
|
|
32
|
+
"kind": "interface",
|
|
33
|
+
"package": "@nifrajs/otel",
|
|
34
|
+
"signature": "export interface ActiveObservation {\n readonly span: NifraSpan;\n readonly context: ObservationContext;\n /** Adds a sink to this in-flight span. Re-adding the same adapter is idempotent. */\n addAdapter(adapter: ObservationAdapter): void;\n /** Starts a child that inherits this span's trace identity and sampling decision. */\n startChild(input: Omit<StartObservation, \"parent\" | \"traceparent\">, additionalAdapters?: readonly ObservationAdapter[]): ActiveObservation;\n /** Records failure evidence without deciding the final status until the response is known. */\n recordError(error: unknown): void;\n /** Ends and exports once. Repeated calls return the same completed span without notifying again. */\n end(input?: EndObservation): NifraSpan;\n}"
|
|
35
|
+
},
|
|
30
36
|
{
|
|
31
37
|
"name": "AddRoute",
|
|
32
38
|
"kind": "type",
|
|
@@ -67,6 +73,33 @@
|
|
|
67
73
|
"package": "create-nifra",
|
|
68
74
|
"signature": "export interface AgentsMdOptions {\n readonly template: TemplateName;\n readonly framework: Framework;\n readonly name: string;\n /** Drizzle preset, when scaffolded with `--db` — adds a Database section. */\n readonly db?: DbChoice;\n /** Auth preset, when scaffolded with `--auth` — adds an Authentication section. */\n readonly auth?: AuthChoice;\n}"
|
|
69
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"name": "AgentSpan",
|
|
78
|
+
"kind": "type",
|
|
79
|
+
"package": "@nifrajs/agent-telemetry",
|
|
80
|
+
"signature": "export type AgentSpan = NifraSpan;",
|
|
81
|
+
"doc": "/** A tool-call span. Kept as an alias for package-specific naming without duplicating OTel types. */"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "AgentSpanExporter",
|
|
85
|
+
"kind": "type",
|
|
86
|
+
"package": "@nifrajs/agent-telemetry",
|
|
87
|
+
"signature": "export type AgentSpanExporter = SpanExporter;",
|
|
88
|
+
"doc": "/** Exporter seam shared with `@nifrajs/otel`. */"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "agentTelemetry",
|
|
92
|
+
"kind": "function",
|
|
93
|
+
"package": "@nifrajs/agent-telemetry",
|
|
94
|
+
"signature": "export declare function agentTelemetry(options: AgentTelemetryOptions): {\n name: string;\n beforeHandle(context: HookContext): undefined;\n onError(error: unknown, context: HookContext): undefined;\n onResponse(response: Response, request: Request): Response;\n};",
|
|
95
|
+
"doc": "/**\n * Agent telemetry middleware. Register via `app.use(agentTelemetry({ exporter }))`.\n *\n * Creates child spans for requests targeting tool endpoints (`/_nifra/tool/*`)\n * or the MCP endpoint (`/mcp`). Non-matching requests pass through with zero overhead\n * (a single `startsWith` check — O(1), no regex).\n */"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "AgentTelemetryOptions",
|
|
99
|
+
"kind": "interface",
|
|
100
|
+
"package": "@nifrajs/agent-telemetry",
|
|
101
|
+
"signature": "export interface AgentTelemetryOptions {\n /** Exporter that receives completed tool-call spans. */\n readonly exporter: AgentSpanExporter;\n /** Path prefix for nifra tool routes (default `\"/_nifra/tool/\"`). */\n readonly toolPathPrefix?: string | undefined;\n /** Path for the MCP endpoint (default `\"/mcp\"`). */\n readonly mcpPath?: string | undefined;\n}"
|
|
102
|
+
},
|
|
70
103
|
{
|
|
71
104
|
"name": "aggregateSizeReport",
|
|
72
105
|
"kind": "function",
|
|
@@ -124,14 +157,14 @@
|
|
|
124
157
|
"name": "apiRoutesIndexSection",
|
|
125
158
|
"kind": "function",
|
|
126
159
|
"package": "@nifrajs/cli",
|
|
127
|
-
"signature": "export declare function apiRoutesIndexSection(routes: readonly
|
|
160
|
+
"signature": "export declare function apiRoutesIndexSection(routes: readonly ReflectedRoute[]): string;",
|
|
128
161
|
"doc": "/** Compact API-routes INDEX for the no-arg `nifra_context` call — `METHOD path` per route, WITHOUT the\n * body/query/response shapes or the per-route `call` line. Bounds the first-call payload on a big backend:\n * an agent gets the full route list (so it knows what's mounted) plus a pointer to fetch any route's full\n * contract via the `path`/`kind` slice, instead of every schema up front. */"
|
|
129
162
|
},
|
|
130
163
|
{
|
|
131
164
|
"name": "apiRoutesSection",
|
|
132
165
|
"kind": "function",
|
|
133
166
|
"package": "@nifrajs/cli",
|
|
134
|
-
"signature": "export declare function apiRoutesSection(routes: readonly
|
|
167
|
+
"signature": "export declare function apiRoutesSection(routes: readonly ReflectedRoute[]): string;",
|
|
135
168
|
"doc": "/** Markdown section listing the backend's API routes with their request + response field shapes. */"
|
|
136
169
|
},
|
|
137
170
|
{
|
|
@@ -148,6 +181,13 @@
|
|
|
148
181
|
"signature": "export interface AppLike {\n fetch(request: Request): Response | Promise<Response>;\n}",
|
|
149
182
|
"doc": "/** Anything with a Web-standard fetch handler — a nifra app, or any `(Request) => Response`. Declared\n * structurally so this package has zero dependency on `@nifrajs/core`. */"
|
|
150
183
|
},
|
|
184
|
+
{
|
|
185
|
+
"name": "AppLike",
|
|
186
|
+
"kind": "interface",
|
|
187
|
+
"package": "@nifrajs/testing",
|
|
188
|
+
"signature": "export interface AppLike {\n fetch(request: Request): Response | Promise<Response>;\n}",
|
|
189
|
+
"doc": "/** The minimal shape a nifra `server()` app satisfies — its own `fetch`. */"
|
|
190
|
+
},
|
|
151
191
|
{
|
|
152
192
|
"name": "applyDoctorAutoFix",
|
|
153
193
|
"kind": "function",
|
|
@@ -176,6 +216,27 @@
|
|
|
176
216
|
"signature": "export declare function assertAuthableDb(db: DbChoice): void;",
|
|
177
217
|
"doc": "/**\n * Guard `--auth` against a DB whose ORM has no clean better-auth adapter. Throws an actionable error\n * for Kysely (passing a raw dialect to better-auth is manual wiring we won't fake-scaffold). Called by\n * the CLI before scaffolding so the failure is early and explains the fix.\n */"
|
|
178
218
|
},
|
|
219
|
+
{
|
|
220
|
+
"name": "assertRenderAdapterConformance",
|
|
221
|
+
"kind": "function",
|
|
222
|
+
"package": "@nifrajs/web",
|
|
223
|
+
"signature": "export declare function assertRenderAdapterConformance(adapter: RenderAdapter, fixture: RenderAdapterConformanceFixture): Promise<void>;",
|
|
224
|
+
"doc": "/**\n * Execute the observable {@link RenderAdapter} interface against a framework-specific fixture.\n *\n * The promise resolves only when the adapter proves all shared invariants: page props reach a\n * page-only render, streams contain byte chunks, layout chains nest outermost-first, optional\n * buffered rendering is byte-for-byte hydration-equivalent to streaming for non-deferred content,\n * and hydration-head output is a stable string. It rejects with\n * {@link RenderAdapterConformanceError} naming the first failed check.\n *\n * Framework semantics outside the interface—Suspense scheduling, compiler plugins, DOM hydration,\n * error boundaries, and framework-specific primitives—remain the adapter package's local tests.\n */"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "assertSafeKey",
|
|
228
|
+
"kind": "function",
|
|
229
|
+
"package": "@nifrajs/storage",
|
|
230
|
+
"signature": "export declare function assertSafeKey(key: string): void;",
|
|
231
|
+
"doc": "/** Throw {@link StorageKeyError} unless `key` is a safe relative storage key. */"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "assertStorageAdapterConformance",
|
|
235
|
+
"kind": "function",
|
|
236
|
+
"package": "@nifrajs/storage",
|
|
237
|
+
"signature": "export declare function assertStorageAdapterConformance(options: StorageAdapterConformanceOptions): Promise<void>;",
|
|
238
|
+
"doc": "/**\n * Execute the observable {@link StorageAdapter} contract without depending on a test runner.\n *\n * The adapter must be isolated because this writes deterministic conformance keys. The promise resolves\n * only after proving byte + metadata round-trips, overwrite, missing/delete semantics, prefix/limit listing,\n * and uniform unsafe-key rejection across every key-taking method. When the adapter also implements an\n * optional capability ({@link PagedStorageAdapter}, {@link PresignableStorageAdapter},\n * {@link MovableStorageAdapter}), that capability's contract is proven too — implementing a capability\n * partially or unsafely fails conformance rather than silently escaping it.\n */"
|
|
239
|
+
},
|
|
179
240
|
{
|
|
180
241
|
"name": "attachWebSocket",
|
|
181
242
|
"kind": "function",
|
|
@@ -277,9 +338,16 @@
|
|
|
277
338
|
"name": "backendRoutes",
|
|
278
339
|
"kind": "function",
|
|
279
340
|
"package": "@nifrajs/cli",
|
|
280
|
-
"signature": "export declare function backendRoutes(backend: unknown):
|
|
341
|
+
"signature": "export declare function backendRoutes(backend: unknown): ReflectedRoute[];",
|
|
281
342
|
"doc": "/** Read the backend's registered routes, if it's a `server()` with a `.routes()` method. */"
|
|
282
343
|
},
|
|
344
|
+
{
|
|
345
|
+
"name": "Backoff",
|
|
346
|
+
"kind": "type",
|
|
347
|
+
"package": "@nifrajs/jobs",
|
|
348
|
+
"signature": "export type Backoff = (attempt: number) => number;",
|
|
349
|
+
"doc": "/** ms to wait before the next attempt, given the number of attempts already made (1-based). */"
|
|
350
|
+
},
|
|
283
351
|
{
|
|
284
352
|
"name": "base64UrlDecode",
|
|
285
353
|
"kind": "function",
|
|
@@ -533,6 +601,12 @@
|
|
|
533
601
|
"signature": "export declare function cache(options: CacheOptions): Middleware;",
|
|
534
602
|
"doc": "/**\n * Full response cache for small, cacheable responses. Use a shared `store` in production. The\n * middleware honors `Cache-Control` by default, avoids `Set-Cookie`, caps stored bytes, emits `Age`,\n * and keeps `Vary` headers aligned with the cache key.\n */"
|
|
535
603
|
},
|
|
604
|
+
{
|
|
605
|
+
"name": "Cache",
|
|
606
|
+
"kind": "interface",
|
|
607
|
+
"package": "@nifrajs/cache",
|
|
608
|
+
"signature": "export interface Cache {\n /** The cached value for `key`, or `undefined` if missing/expired. Pass `T` for the value type. */\n get<T = unknown>(key: string): Promise<T | undefined>;\n /** Whether a live (non-expired) entry exists. */\n has(key: string): Promise<boolean>;\n /** Store `value` under `key`. */\n set<T>(key: string, value: T, options?: SetOptions): Promise<void>;\n delete(key: string): Promise<void>;\n /** Drop every entry tagged `tag`. */\n invalidateTag(tag: string): Promise<void>;\n clear(): Promise<void>;\n /**\n * Cache-aside: return the cached value, or run `loader`, store the result, and return it. Stampede-safe\n * (concurrent misses for one key share a single `loader` call) and SWR-aware (a stale-but-live value is\n * returned immediately while a deduped background refresh runs). A throwing `loader` is NOT cached.\n */\n wrap<T>(key: string, loader: () => T, options?: WrapOptions): Promise<Awaited<T>>;\n}"
|
|
609
|
+
},
|
|
536
610
|
{
|
|
537
611
|
"name": "cacheControl",
|
|
538
612
|
"kind": "function",
|
|
@@ -565,12 +639,25 @@
|
|
|
565
639
|
"signature": "export interface CachedResponse {\n /** The rendered document (UTF-8 HTML, fully buffered). */\n readonly body: string;\n readonly status: number;\n /** Response headers to replay (e.g. `content-type`). */\n readonly headers: Readonly<Record<string, string>>;\n /** When this entry was stored, via the injected clock (ms epoch). */\n readonly storedAt: number;\n /** Freshness window (ms): `now - storedAt >= revalidate` ⇒ stale (serve it, regenerate behind it). */\n readonly revalidate: number;\n}",
|
|
566
640
|
"doc": "/** A cached SSR response — the bytes + metadata a {@link CacheStore} persists. */"
|
|
567
641
|
},
|
|
642
|
+
{
|
|
643
|
+
"name": "CacheOptions",
|
|
644
|
+
"kind": "interface",
|
|
645
|
+
"package": "@nifrajs/cache",
|
|
646
|
+
"signature": "export interface CacheOptions {\n /** Storage adapter. Default: a fresh {@link MemoryCache}. */\n readonly store?: CacheStore;\n /** Default TTL (ms) for `set`/`wrap` when none is given. Default 60_000. */\n readonly defaultTtlMs?: number;\n /** Injectable clock (tests). Default `() => Date.now()`. */\n readonly now?: () => number;\n /** Called when a background SWR revalidation throws. Default: `console.error`. */\n readonly onError?: (error: unknown, key: string) => void;\n}"
|
|
647
|
+
},
|
|
568
648
|
{
|
|
569
649
|
"name": "CacheOptions",
|
|
570
650
|
"kind": "interface",
|
|
571
651
|
"package": "@nifrajs/middleware",
|
|
572
652
|
"signature": "export interface CacheOptions {\n readonly store: ResponseCacheStore;\n /** Time to live in milliseconds. */\n readonly ttlMs: number;\n /** Methods cached. Default `[\"GET\", \"HEAD\"]`. */\n readonly methods?: readonly string[];\n /** Status predicate. Default: `200` only. */\n readonly status?: (status: number) => boolean;\n /** Header names included in the cache key and emitted in `Vary`. */\n readonly vary?: readonly string[];\n /** Custom cache key. Receives the normalized `vary` headers through the request itself. */\n readonly key?: (request: Request) => string;\n /** Maximum response bytes to store. Default `1_000_000`. Larger responses pass through. */\n readonly maxBytes?: number;\n /** Respect request `Cache-Control: no-cache/no-store`. Default `true`. */\n readonly respectRequestCacheControl?: boolean;\n /** Respect response `Cache-Control: private/no-store`. Default `true`. */\n readonly respectResponseCacheControl?: boolean;\n /** Cache responses with `Set-Cookie`. Default `false`. */\n readonly cacheSetCookie?: boolean;\n /** Cache responses to requests bearing `Authorization` or `Cookie` even when the response is not\n * explicitly `Cache-Control: public` (or `s-maxage`). Default `false`: a shared cache must not store a\n * personalized response (RFC 9111 §3.5), or it would be replayed to other users. Leave this off unless\n * the cached route is genuinely the same for every caller. */\n readonly cacheAuthenticated?: boolean;\n /** Response header for cache status. Default `\"x-nifra-cache\"`; set `false` to disable. */\n readonly cacheStatusHeader?: string | false;\n}"
|
|
573
653
|
},
|
|
654
|
+
{
|
|
655
|
+
"name": "CacheStore",
|
|
656
|
+
"kind": "interface",
|
|
657
|
+
"package": "@nifrajs/cache",
|
|
658
|
+
"signature": "export interface CacheStore {\n /** The live entry for `key`, or `undefined` if missing or hard-expired (`now >= expiresAt`). */\n get(key: string): StoredEntry | undefined | Promise<StoredEntry | undefined>;\n /** Store `entry` under `key`, indexed by `tags` for {@link CacheStore.invalidateTag}. */\n set(key: string, entry: StoredEntry, tags: readonly string[]): void | Promise<void>;\n delete(key: string): void | Promise<void>;\n /** Drop every entry carrying `tag`. */\n invalidateTag(tag: string): void | Promise<void>;\n clear(): void | Promise<void>;\n}",
|
|
659
|
+
"doc": "/**\n * Raw key→entry storage. The default {@link MemoryCache} is in-process; implement this over CF KV /\n * Redis / etc. for a cache shared across instances. All methods may be sync or async — the cache awaits them.\n */"
|
|
660
|
+
},
|
|
574
661
|
{
|
|
575
662
|
"name": "CacheStore",
|
|
576
663
|
"kind": "interface",
|
|
@@ -596,7 +683,7 @@
|
|
|
596
683
|
"name": "CheckResult",
|
|
597
684
|
"kind": "interface",
|
|
598
685
|
"package": "@nifrajs/cli",
|
|
599
|
-
"signature": "export interface CheckResult {\n readonly ok: boolean;\n readonly typecheck: \"pass\" | \"fail\" | \"skipped\";\n readonly diagnostics: readonly CheckDiagnostic[];\n}",
|
|
686
|
+
"signature": "export interface CheckResult {\n readonly ok: boolean;\n readonly typecheck: \"pass\" | \"fail\" | \"skipped\";\n readonly diagnostics: readonly CheckDiagnostic[];\n /** Set only when the caller passed `maxDiagnostics` and there were more — `diagnostics` then holds the\n * first `shown` of `total`. It caps the serialized size so the `nifra_check` MCP tool can't emit a\n * message large enough to break the stdio transport; fix the shown diagnostics and re-run for the rest. */\n readonly truncated?: {\n readonly shown: number;\n readonly total: number;\n };\n}",
|
|
600
687
|
"doc": "/** The structured result of a full check — what `--json` prints and the `nifra_check` MCP tool returns. */"
|
|
601
688
|
},
|
|
602
689
|
{
|
|
@@ -695,7 +782,7 @@
|
|
|
695
782
|
"name": "collectCheckResult",
|
|
696
783
|
"kind": "function",
|
|
697
784
|
"package": "@nifrajs/cli",
|
|
698
|
-
"signature": "export declare function collectCheckResult(cwd: string, opts?: {\n readonly lintsOnly?: boolean;\n readonly signal?: AbortSignal;\n}): Promise<CheckResult>;",
|
|
785
|
+
"signature": "export declare function collectCheckResult(cwd: string, opts?: {\n readonly lintsOnly?: boolean;\n readonly signal?: AbortSignal;\n /** Cap the returned `diagnostics` to this many (adds {@link CheckResult.truncated}). The MCP tool sets\n * it so a huge project can't produce a transport-breaking result; the CLI leaves it unset (all shown). */\n readonly maxDiagnostics?: number;\n}): Promise<CheckResult>;",
|
|
699
786
|
"doc": "/** Run the three checks and assemble a structured, machine-readable result. The single source the CLI\n * report, `--json`, and the MCP tool all render from. */"
|
|
700
787
|
},
|
|
701
788
|
{
|
|
@@ -726,6 +813,13 @@
|
|
|
726
813
|
"signature": "export declare function combine(...items: readonly Composable[]): NifraPlugin;",
|
|
727
814
|
"doc": "/** Compose middleware/plugins into one reusable bundle. Individual named plugins still dedupe. */"
|
|
728
815
|
},
|
|
816
|
+
{
|
|
817
|
+
"name": "combineObservationAdapters",
|
|
818
|
+
"kind": "function",
|
|
819
|
+
"package": "@nifrajs/otel",
|
|
820
|
+
"signature": "export declare function combineObservationAdapters(adapters: readonly ObservationAdapter[]): ObservationAdapter;",
|
|
821
|
+
"doc": "/**\n * Fan out lifecycle notifications to several adapters. Each adapter is isolated: an exception in\n * one sink cannot prevent the remaining sinks from observing the span.\n */"
|
|
822
|
+
},
|
|
729
823
|
{
|
|
730
824
|
"name": "commonSecretPatterns",
|
|
731
825
|
"kind": "const",
|
|
@@ -808,6 +902,13 @@
|
|
|
808
902
|
"signature": "export declare function computed<T>(fn: () => T): () => T;",
|
|
809
903
|
"doc": "/** Derived value, cached into a signal — recomputes when its tracked inputs change. */"
|
|
810
904
|
},
|
|
905
|
+
{
|
|
906
|
+
"name": "consoleAgentExporter",
|
|
907
|
+
"kind": "function",
|
|
908
|
+
"package": "@nifrajs/agent-telemetry",
|
|
909
|
+
"signature": "export declare function consoleAgentExporter(log?: (line: string) => void): AgentSpanExporter;",
|
|
910
|
+
"doc": "/**\n * Pretty-prints agent tool call traces to the terminal.\n *\n * Output format:\n * ```\n * [agent] tool:get_weather 12ms ok (input: 45B, output: 128B)\n * ```\n */"
|
|
911
|
+
},
|
|
811
912
|
{
|
|
812
913
|
"name": "consoleSpanExporter",
|
|
813
914
|
"kind": "function",
|
|
@@ -909,6 +1010,20 @@
|
|
|
909
1010
|
"signature": "export type ContractShape = Record<string, OperationDef>;",
|
|
910
1011
|
"doc": "/** A contract: named operations. Names are the handler keys and OpenAPI operationIds. */"
|
|
911
1012
|
},
|
|
1013
|
+
{
|
|
1014
|
+
"name": "cookieJar",
|
|
1015
|
+
"kind": "function",
|
|
1016
|
+
"package": "@nifrajs/testing",
|
|
1017
|
+
"signature": "export declare function cookieJar(): CookieJar;",
|
|
1018
|
+
"doc": "/** Create an empty cookie jar. */"
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
"name": "CookieJar",
|
|
1022
|
+
"kind": "interface",
|
|
1023
|
+
"package": "@nifrajs/testing",
|
|
1024
|
+
"signature": "export interface CookieJar {\n /** The current `Cookie` request-header value (`\"a=1; b=2\"`, or `\"\"` when empty). */\n header(): string;\n /** Set the `Cookie` header on `headers` when the jar is non-empty. */\n applyTo(headers: Headers): void;\n /** Absorb every `Set-Cookie` on a response (setting or, on removal, deleting each). */\n store(response: {\n headers: Headers;\n }): void;\n set(name: string, value: string): void;\n get(name: string): string | undefined;\n clear(): void;\n readonly size: number;\n}",
|
|
1025
|
+
"doc": "/**\n * A tiny cookie jar for in-process tests — parses `Set-Cookie` off responses and emits a `Cookie`\n * request header, so a login → authenticated-request flow works without threading headers by hand. It\n * honours removal (`Max-Age=0` / a past `Expires`) so logout clears the cookie; other attributes\n * (Domain/Path/Secure/SameSite) are ignored — everything is same-origin in-process.\n */"
|
|
1026
|
+
},
|
|
912
1027
|
{
|
|
913
1028
|
"name": "CookieOptions",
|
|
914
1029
|
"kind": "interface",
|
|
@@ -942,6 +1057,13 @@
|
|
|
942
1057
|
"signature": "export declare function createBunWsHandlers(topics: TopicRegistry): BunWsHandlers;",
|
|
943
1058
|
"doc": "/** The shared Bun `websocket` dispatcher config for one app — each connection's\n * `ws.data.handler` is the matched route's handler, set by `server.upgrade`. */"
|
|
944
1059
|
},
|
|
1060
|
+
{
|
|
1061
|
+
"name": "createCache",
|
|
1062
|
+
"kind": "function",
|
|
1063
|
+
"package": "@nifrajs/cache",
|
|
1064
|
+
"signature": "export declare function createCache(options?: CacheOptions): Cache;",
|
|
1065
|
+
"doc": "/** Create a cache over the given (or a fresh in-memory) store. */"
|
|
1066
|
+
},
|
|
945
1067
|
{
|
|
946
1068
|
"name": "createCachedAppLoader",
|
|
947
1069
|
"kind": "function",
|
|
@@ -1015,6 +1137,20 @@
|
|
|
1015
1137
|
"package": "@nifrajs/mcp",
|
|
1016
1138
|
"signature": "export interface CreateMcpServerOptions {\n readonly name: string;\n readonly version: string;\n readonly tools?: readonly McpTool[];\n /** MCP Apps widgets — their resources are registered and the UI capability is advertised. */\n readonly widgets?: readonly McpWidget[];\n /** Extra (non-widget) resources to expose. */\n readonly resources?: readonly McpResource[];\n readonly prompts?: readonly McpPrompt[];\n /** GET health-page text. */\n readonly health?: string;\n /** Max JSON-RPC body size in bytes (default 1 MB). */\n readonly maxBodyBytes?: number;\n}"
|
|
1017
1139
|
},
|
|
1140
|
+
{
|
|
1141
|
+
"name": "createMockServer",
|
|
1142
|
+
"kind": "function",
|
|
1143
|
+
"package": "@nifrajs/mock",
|
|
1144
|
+
"signature": "export declare function createMockServer(app: MockableApp, options?: MockServerOptions | undefined): MockServer;",
|
|
1145
|
+
"doc": "/**\n * Create a mock server from a Nifra app's route definitions. For each route\n * with a `schema.response`, generates a handler returning fake data that\n * matches the response schema structure. Routes without response schemas\n * return `{}`.\n */"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"name": "createObservationLifecycle",
|
|
1149
|
+
"kind": "function",
|
|
1150
|
+
"package": "@nifrajs/otel",
|
|
1151
|
+
"signature": "export declare function createObservationLifecycle(options?: ObservationLifecycleOptions): ObservationLifecycle;",
|
|
1152
|
+
"doc": "/** Creates an independent lifecycle factory. Adapters are always called fail-open. */"
|
|
1153
|
+
},
|
|
1018
1154
|
{
|
|
1019
1155
|
"name": "createQuery",
|
|
1020
1156
|
"kind": "function",
|
|
@@ -1035,6 +1171,13 @@
|
|
|
1035
1171
|
"signature": "export interface CreateQueryResult<T> {\n /** Reactive accessor for the {@link QueryState} (`status`/`data`/`error`/`isFetching`/`updatedAt`). */\n readonly state: Accessor<QueryState<T>>;\n /** Force a refetch (ignores `staleTime`). */\n readonly refetch: () => Promise<T>;\n}",
|
|
1036
1172
|
"doc": "/** A query's reactive state accessor plus `refetch`. */"
|
|
1037
1173
|
},
|
|
1174
|
+
{
|
|
1175
|
+
"name": "createQueue",
|
|
1176
|
+
"kind": "function",
|
|
1177
|
+
"package": "@nifrajs/jobs",
|
|
1178
|
+
"signature": "export declare function createQueue(options?: QueueOptions): Queue;",
|
|
1179
|
+
"doc": "/** Create a job queue. Define jobs, enqueue payloads, and `start()` a worker (or `drain()` once). */"
|
|
1180
|
+
},
|
|
1038
1181
|
{
|
|
1039
1182
|
"name": "createScheduler",
|
|
1040
1183
|
"kind": "function",
|
|
@@ -1193,6 +1336,13 @@
|
|
|
1193
1336
|
"package": "@nifrajs/middleware",
|
|
1194
1337
|
"signature": "export declare function decodeBase64(input: string): Uint8Array<ArrayBuffer> | null;"
|
|
1195
1338
|
},
|
|
1339
|
+
{
|
|
1340
|
+
"name": "decodeCursor",
|
|
1341
|
+
"kind": "function",
|
|
1342
|
+
"package": "@nifrajs/schema",
|
|
1343
|
+
"signature": "export declare function decodeCursor<T = unknown>(cursor: string | null | undefined): T | undefined;",
|
|
1344
|
+
"doc": "/** Decode a cursor back to its value. Returns `undefined` for a null/empty/malformed cursor — treat that\n * as \"start from the beginning\" rather than erroring on a client-supplied string. */"
|
|
1345
|
+
},
|
|
1196
1346
|
{
|
|
1197
1347
|
"name": "DecodedImage",
|
|
1198
1348
|
"kind": "interface",
|
|
@@ -1368,6 +1518,39 @@
|
|
|
1368
1518
|
"package": "@nifrajs/web",
|
|
1369
1519
|
"signature": "export interface DevServerOptions extends Omit<BuildClientOptions, \"minify\"> {\n /**\n * Build the nifra app for the freshly-built client entry. `importQuery` changes on every\n * rebuild — pass it to `discoverRoutes(routesDir, { importQuery })` so SSR re-imports edited\n * route modules instead of Bun's 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}"
|
|
1370
1520
|
},
|
|
1521
|
+
{
|
|
1522
|
+
"name": "devtools",
|
|
1523
|
+
"kind": "function",
|
|
1524
|
+
"package": "@nifrajs/devtools",
|
|
1525
|
+
"signature": "export declare function devtools(options?: DevToolsOptions | undefined): import(\"@nifrajs/core\").NifraPlugin<import(\"@nifrajs/core\").AnyServer, import(\"@nifrajs/core\").AnyServer>;",
|
|
1526
|
+
"doc": "/**\n * DevTools plugin. Its observation adapter projects the single request span into a\n * `DevToolsEvent`; its middleware only owns the secured SSE transport.\n * When configuring `tracing()` yourself, register it before this plugin so DevTools attaches to\n * that request owner.\n */"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
"name": "DevToolsClientOptions",
|
|
1530
|
+
"kind": "interface",
|
|
1531
|
+
"package": "@nifrajs/devtools",
|
|
1532
|
+
"signature": "export interface DevToolsClientOptions {\n /** SSE path configured on the server plugin. */\n readonly path?: string | undefined;\n}"
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
"name": "devtoolsClientScript",
|
|
1536
|
+
"kind": "function",
|
|
1537
|
+
"package": "@nifrajs/devtools",
|
|
1538
|
+
"signature": "export declare function devtoolsClientScript(options?: DevToolsClientOptions): string;",
|
|
1539
|
+
"doc": "/**\n * Returns a self-contained JavaScript string that creates a floating DevTools\n * overlay in the browser. Inject via `<script>` tag in dev mode.\n *\n * The overlay:\n * - Connects to `/_nifra/devtools` via EventSource\n * - Shows a scrolling log of request traces\n * - Color-coded method badges and status codes\n * - ISR hit/miss/stale indicators\n * - Collapsible with a ⚡ toggle button\n */"
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
"name": "DevToolsEvent",
|
|
1543
|
+
"kind": "interface",
|
|
1544
|
+
"package": "@nifrajs/devtools",
|
|
1545
|
+
"signature": "export interface DevToolsEvent {\n readonly id: string;\n readonly traceId: string;\n readonly spanId: string;\n readonly parentSpanId?: string | undefined;\n readonly timestamp: number;\n readonly method: string;\n readonly path: string;\n readonly status: number;\n readonly durationMs: number;\n readonly isrStatus?: string | undefined;\n readonly bodyBytes: number;\n}",
|
|
1546
|
+
"doc": "/**\n * `@nifrajs/devtools` — interactive DevTools overlay for `nifra dev`.\n *\n * Server-side: a middleware plugin that captures request traces into a ring buffer\n * and streams them via SSE at `/_nifra/devtools`.\n *\n * Client-side: a floating browser overlay that connects to the SSE stream and\n * renders a scrolling log of request traces with ISR status badges.\n *\n * **Zero production overhead** — register conditionally:\n * ```ts\n * if (process.env.NODE_ENV !== \"production\") app.use(devtools())\n * ```\n * When not registered, routes stay `bare` and the SSE endpoint doesn't exist.\n */"
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
"name": "DevToolsOptions",
|
|
1550
|
+
"kind": "interface",
|
|
1551
|
+
"package": "@nifrajs/devtools",
|
|
1552
|
+
"signature": "export interface DevToolsOptions {\n /** Maximum events to retain in the ring buffer (default 200). */\n readonly maxEvents?: number | undefined;\n /** Maximum simultaneous SSE connections (default 5). */\n readonly maxConnections?: number | undefined;\n /** SSE path (default `/_nifra/devtools`). */\n readonly path?: string | undefined;\n /** Explicit enable switch. Defaults to true only when `NODE_ENV === \"development\"`. */\n readonly enabled?: boolean | undefined;\n /** Permit non-loopback URL hosts. Default false. */\n readonly allowRemote?: boolean | undefined;\n /** Additional origins permitted to open the stream. Same-origin requests are always allowed. */\n readonly allowedOrigins?: readonly string[] | undefined;\n /** Optional request authorization for the stream. */\n readonly authorize?: ((request: Request) => boolean | Promise<boolean>) | undefined;\n /**\n * Interval for SSE keep-alive comment frames, in milliseconds (default 15000). Pings stop\n * idle proxies/dev tunnels from dropping the stream and evict dead connections so they no\n * longer count against `maxConnections`.\n */\n readonly pingIntervalMs?: number | undefined;\n}"
|
|
1553
|
+
},
|
|
1371
1554
|
{
|
|
1372
1555
|
"name": "diffManifestRoutes",
|
|
1373
1556
|
"kind": "function",
|
|
@@ -1502,6 +1685,25 @@
|
|
|
1502
1685
|
"package": "@nifrajs/web",
|
|
1503
1686
|
"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}"
|
|
1504
1687
|
},
|
|
1688
|
+
{
|
|
1689
|
+
"name": "encodeCursor",
|
|
1690
|
+
"kind": "function",
|
|
1691
|
+
"package": "@nifrajs/schema",
|
|
1692
|
+
"signature": "export declare function encodeCursor(value: unknown): string;",
|
|
1693
|
+
"doc": "/** Encode any JSON-serializable value (e.g. the last row's sort key) into an opaque cursor string. */"
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
"name": "EndObservation",
|
|
1697
|
+
"kind": "interface",
|
|
1698
|
+
"package": "@nifrajs/otel",
|
|
1699
|
+
"signature": "export interface EndObservation {\n readonly statusCode?: number;\n /** Explicit status wins over status-code and recorded-error classification. */\n readonly status?: Exclude<SpanStatus, \"unset\">;\n readonly attributes?: Readonly<Record<string, AttributeValue>>;\n}"
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1702
|
+
"name": "EnqueueOptions",
|
|
1703
|
+
"kind": "interface",
|
|
1704
|
+
"package": "@nifrajs/jobs",
|
|
1705
|
+
"signature": "export interface EnqueueOptions {\n /** Delay before the job becomes eligible. Ignored if `runAt` is set. */\n readonly delayMs?: number;\n /** Absolute epoch-ms eligibility time. Overrides `delayMs`. */\n readonly runAt?: number;\n}"
|
|
1706
|
+
},
|
|
1505
1707
|
{
|
|
1506
1708
|
"name": "ensureDefaultFormats",
|
|
1507
1709
|
"kind": "function",
|
|
@@ -1627,6 +1829,40 @@
|
|
|
1627
1829
|
"signature": "export interface ExecutionContext {\n waitUntil(promise: Promise<unknown>): void;\n}",
|
|
1628
1830
|
"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. */"
|
|
1629
1831
|
},
|
|
1832
|
+
{
|
|
1833
|
+
"name": "exponentialBackoff",
|
|
1834
|
+
"kind": "function",
|
|
1835
|
+
"package": "@nifrajs/jobs",
|
|
1836
|
+
"signature": "export declare function exponentialBackoff(options?: ExponentialOptions): Backoff;",
|
|
1837
|
+
"doc": "/** Exponential backoff: `baseMs * 2^(attempt-1)`, capped at `maxMs`, with optional jitter. */"
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"name": "ExponentialOptions",
|
|
1841
|
+
"kind": "interface",
|
|
1842
|
+
"package": "@nifrajs/jobs",
|
|
1843
|
+
"signature": "export interface ExponentialOptions {\n /** Delay before the FIRST retry (attempt 1). Default 1000. */\n readonly baseMs?: number;\n /** Upper bound on the delay. Default 30_000. */\n readonly maxMs?: number;\n /** Full-jitter fraction in [0,1]: the delay is scaled by `1 - jitter*rand`. Default 0 (deterministic). */\n readonly jitter?: number;\n /** Injectable randomness for jitter (tests). Default `Math.random`. */\n readonly random?: () => number;\n}"
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"name": "extractBackendPrompts",
|
|
1847
|
+
"kind": "function",
|
|
1848
|
+
"package": "@nifrajs/cli",
|
|
1849
|
+
"signature": "export declare function extractBackendPrompts(backend: unknown): McpPrompt[];",
|
|
1850
|
+
"doc": "/** Extract MCP prompts registered via `.prompt()` on the Nifra backend. Exported for the surfacing test. */"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"name": "extractBackendResources",
|
|
1854
|
+
"kind": "function",
|
|
1855
|
+
"package": "@nifrajs/cli",
|
|
1856
|
+
"signature": "export declare function extractBackendResources(backend: unknown): McpResource[];",
|
|
1857
|
+
"doc": "/** Extract MCP resources registered via `.resource()` on the Nifra backend. Exported for the surfacing test. */"
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"name": "extractBackendTools",
|
|
1861
|
+
"kind": "function",
|
|
1862
|
+
"package": "@nifrajs/cli",
|
|
1863
|
+
"signature": "export declare function extractBackendTools(backend: unknown): McpTool[];",
|
|
1864
|
+
"doc": "/** Extract tools registered via .tool() routes on the Nifra backend. Exported for the test that proves a\n * `server().tool()` route surfaces in `tools/list` and executes through `tools/call`. */"
|
|
1865
|
+
},
|
|
1630
1866
|
{
|
|
1631
1867
|
"name": "FEATURE_IDS",
|
|
1632
1868
|
"kind": "const",
|
|
@@ -1724,6 +1960,20 @@
|
|
|
1724
1960
|
"signature": "export type FetchRouteData = (path: string, match: RouteMatch, signal?: AbortSignal) => Promise<unknown>;",
|
|
1725
1961
|
"doc": "/** How a router fetches a route's loader data on navigation. `signal` aborts a superseded fetch\n * (and its deferred stream). */"
|
|
1726
1962
|
},
|
|
1963
|
+
{
|
|
1964
|
+
"name": "FieldKey",
|
|
1965
|
+
"kind": "type",
|
|
1966
|
+
"package": "@nifrajs/web",
|
|
1967
|
+
"signature": "export type FieldKey<App, Path extends string, Method extends string> = [\n RouteBody<App, Path, Method>\n] extends [never] ? never : keyof RouteBody<App, Path, Method> & string;",
|
|
1968
|
+
"doc": "/** The valid field names for that route's body — the schema's keys as a string union. */"
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
"name": "FieldProps",
|
|
1972
|
+
"kind": "type",
|
|
1973
|
+
"package": "@nifrajs/web",
|
|
1974
|
+
"signature": "export type FieldProps = Record<string, unknown>;",
|
|
1975
|
+
"doc": "/** Extra attributes merged into the returned input props (id, type, defaultValue, placeholder, …). */"
|
|
1976
|
+
},
|
|
1727
1977
|
{
|
|
1728
1978
|
"name": "filePathToPattern",
|
|
1729
1979
|
"kind": "function",
|
|
@@ -1738,6 +1988,12 @@
|
|
|
1738
1988
|
"signature": "export declare function filePathToPatterns(file: string): string[];",
|
|
1739
1989
|
"doc": "/**\n * Derive **every** nifra router pattern a route file maps to (relative to the routes dir):\n * `index` → the parent path, `[id]` → `:id`, `[...slug]` → `*slug` (catch-all, captures the rest of\n * the path into one param), `(group)` folders are dropped from the URL (organization only), and an\n * optional `[[lang]]` expands the set — once with the segment present (`:lang`) and once absent. A file\n * with no optionals yields exactly one pattern. Throws on an invalid param or a catch-all that isn't\n * the last segment.\n */"
|
|
1740
1990
|
},
|
|
1991
|
+
{
|
|
1992
|
+
"name": "FileStorage",
|
|
1993
|
+
"kind": "class",
|
|
1994
|
+
"package": "@nifrajs/storage",
|
|
1995
|
+
"signature": "export declare class FileStorage implements StorageAdapter {\n private readonly root;\n private readonly metadataRoot;\n constructor(root: string);\n private metadataPathFor;\n /** Resolve `key` to an absolute path, asserting it stays inside `root` (defense-in-depth on top of `assertSafeKey`). */\n private pathFor;\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n get(key: string): Promise<StorageObject | null>;\n delete(key: string): Promise<void>;\n exists(key: string): Promise<boolean>;\n list(options?: ListOptions): Promise<string[]>;\n private walk;\n}"
|
|
1996
|
+
},
|
|
1741
1997
|
{
|
|
1742
1998
|
"name": "FileType",
|
|
1743
1999
|
"kind": "interface",
|
|
@@ -1752,6 +2008,13 @@
|
|
|
1752
2008
|
"signature": "export declare function fillRoutePattern(pattern: string, params: Record<string, string>): {\n path: string;\n missing: string[];\n};",
|
|
1753
2009
|
"doc": "/**\n * Substitute a route pattern's `:param` segments with concrete values: `/users/:id` + `{id:\"7\"}` →\n * `/users/7`. Returns the filled path plus any params that had no value (a `getStaticPaths` bug) so\n * the caller can skip rather than emit a path with a literal `:name`. Shared by the SSG driver and\n * {@link enumeratePrerenderedPaths}.\n */"
|
|
1754
2010
|
},
|
|
2011
|
+
{
|
|
2012
|
+
"name": "fixedBackoff",
|
|
2013
|
+
"kind": "const",
|
|
2014
|
+
"package": "@nifrajs/jobs",
|
|
2015
|
+
"signature": "export declare const fixedBackoff: (ms: number) => Backoff;",
|
|
2016
|
+
"doc": "/** Fixed delay before every retry. */"
|
|
2017
|
+
},
|
|
1755
2018
|
{
|
|
1756
2019
|
"name": "Flags",
|
|
1757
2020
|
"kind": "interface",
|
|
@@ -1831,6 +2094,19 @@
|
|
|
1831
2094
|
"signature": "export declare function formatTraceparent(traceId: string, spanId: string, sampled: boolean): string;",
|
|
1832
2095
|
"doc": "/** Format a `traceparent` header value (version `00`). */"
|
|
1833
2096
|
},
|
|
2097
|
+
{
|
|
2098
|
+
"name": "formFor",
|
|
2099
|
+
"kind": "function",
|
|
2100
|
+
"package": "@nifrajs/web",
|
|
2101
|
+
"signature": "export declare function formFor<App, Path extends RoutePaths<App>, Method extends string = \"post\">(): FormHandle<App, Path, Method>;",
|
|
2102
|
+
"doc": "/**\n * Bind a form to a backend route's body schema at the type level. `App` is `typeof backend`; `Path` is\n * constrained to the app's real routes (a wrong path is a type error); `Method` defaults to `\"post\"`.\n */"
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
"name": "FormHandle",
|
|
2106
|
+
"kind": "interface",
|
|
2107
|
+
"package": "@nifrajs/web",
|
|
2108
|
+
"signature": "export interface FormHandle<App, Path extends string, Method extends string> {\n /** Input props for a schema field. `name` is constrained to the body's keys — a typo, or a field the\n * schema doesn't have, is a COMPILE error. Spread onto an element: `<input {...f.field(\"text\")} />`. */\n field<K extends FieldKey<App, Path, Method>>(name: K, props?: FieldProps): FieldProps & {\n name: K;\n };\n /** `formData.get`, key-constrained to the body's fields — reading an orphan key won't compile. */\n read<K extends FieldKey<App, Path, Method>>(form: FormData, name: K): FormEntry;\n /** `formData.getAll`, key-checked the same way. */\n readAll<K extends FieldKey<App, Path, Method>>(form: FormData, name: K): FormEntries;\n}"
|
|
2109
|
+
},
|
|
1834
2110
|
{
|
|
1835
2111
|
"name": "Framework",
|
|
1836
2112
|
"kind": "type",
|
|
@@ -1875,8 +2151,8 @@
|
|
|
1875
2151
|
"name": "fromTypeBox",
|
|
1876
2152
|
"kind": "function",
|
|
1877
2153
|
"package": "@nifrajs/schema",
|
|
1878
|
-
"signature": "export declare function fromTypeBox<T extends TSchema>(schema: T): NifraSchema<T>;",
|
|
1879
|
-
"doc": "/**\n * Wrap a TypeBox schema as a `NifraSchema`.\n *\n * **Validation is fast where it can be, and works everywhere.** The first `validate`\n * builds a compiled `TypeCompiler` validator (codegen via `new Function`) and memoizes\n * it — composing schemas (`t.object({ a: t.string() })`) never compiles the inner\n * pieces; only a schema actually used to validate a request pays the one-time codegen\n * cost. On Bun and Node this is the only path and it is untouched.\n *\n * Edge runtimes (Cloudflare Workers, Vercel Edge, Deno Deploy) **forbid dynamic code\n * generation**, so that first compile throws there. We catch it once per schema and\n * fall back to TypeBox's eval-free `Value` checker — same semantics (and same global\n * `FormatRegistry`, so `t.string({ format })` behaves identically), no `new Function`.\n * The branch is decided once and memoized, so the hot path is a single check either way.\n *\n * Exposed (not just used internally by `t`) so a TypeBox schema authored directly can\n * be adapted without leaving the Standard Schema world.\n */"
|
|
2154
|
+
"signature": "export declare function fromTypeBox<T extends TSchema>(schema: T, options?: {\n readonly coerce?: boolean;\n}): NifraSchema<T>;",
|
|
2155
|
+
"doc": "/**\n * Wrap a TypeBox schema as a `NifraSchema`.\n *\n * **Validation is fast where it can be, and works everywhere.** The first `validate`\n * builds a compiled `TypeCompiler` validator (codegen via `new Function`) and memoizes\n * it — composing schemas (`t.object({ a: t.string() })`) never compiles the inner\n * pieces; only a schema actually used to validate a request pays the one-time codegen\n * cost. On Bun and Node this is the only path and it is untouched.\n *\n * Edge runtimes (Cloudflare Workers, Vercel Edge, Deno Deploy) **forbid dynamic code\n * generation**, so that first compile throws there. We catch it once per schema and\n * fall back to TypeBox's eval-free `Value` checker — same semantics (and same global\n * `FormatRegistry`, so `t.string({ format })` behaves identically), no `new Function`.\n * The branch is decided once and memoized, so the hot path is a single check either way.\n *\n * Exposed (not just used internally by `t`) so a TypeBox schema authored directly can\n * be adapted without leaving the Standard Schema world.\n *\n * `options.coerce` runs TypeBox's `Value.Convert` (string→number/integer/boolean, per the schema)\n * BEFORE validating. Query values always arrive as strings (`?limit=20` → `\"20\"`), so a query schema\n * with a numeric field can't validate without this — it's how `t.pageQuery` yields a real `number`.\n * Leave it OFF (the default) for body/JSON schemas: a JSON number is already a number, and coercing\n * would silently accept `\"20\"` where the contract said `20`.\n */"
|
|
1880
2156
|
},
|
|
1881
2157
|
{
|
|
1882
2158
|
"name": "generateClientEntry",
|
|
@@ -1891,6 +2167,19 @@
|
|
|
1891
2167
|
"package": "@nifrajs/web",
|
|
1892
2168
|
"signature": "export interface GenerateClientEntryOptions {\n /** Module specifier for the adapter's client runtime (exports `mountRouter`), e.g.\n * `\"@nifrajs/web-solid/client\"`. */\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}"
|
|
1893
2169
|
},
|
|
2170
|
+
{
|
|
2171
|
+
"name": "generateLlmsTxt",
|
|
2172
|
+
"kind": "function",
|
|
2173
|
+
"package": "@nifrajs/web",
|
|
2174
|
+
"signature": "export declare function generateLlmsTxt(full: boolean, pageRoutes: ReadonlyArray<{\n readonly pattern: string;\n readonly id: string;\n}>, backend: unknown): Promise<string>;"
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
"name": "generateMockValue",
|
|
2178
|
+
"kind": "function",
|
|
2179
|
+
"package": "@nifrajs/mock",
|
|
2180
|
+
"signature": "export declare function generateMockValue(schema: unknown, fieldName?: string | undefined, rng?: (() => number) | undefined): unknown;",
|
|
2181
|
+
"doc": "/**\n * Generate a mock value from a schema object. Inspects JSON Schema properties\n * (`type`, `properties`, `items`, `enum`, `format`) that TypeBox / NifraSchema\n * objects carry directly. Unsupported constraints fail closed with\n * {@link UnsupportedMockSchemaError} rather than returning a known-invalid response.\n *\n * @param schema A JSON-Schema-shaped object (TypeBox, NifraSchema, or raw JSON Schema)\n * @param fieldName Optional field name hint for generating contextual string values\n * @param rng Optional seeded random function for deterministic output\n */"
|
|
2182
|
+
},
|
|
1894
2183
|
{
|
|
1895
2184
|
"name": "generateServerEntry",
|
|
1896
2185
|
"kind": "function",
|
|
@@ -2581,6 +2870,61 @@
|
|
|
2581
2870
|
"signature": "export declare const issue: (message: string) => {\n readonly issues: ReadonlyArray<StandardIssue>;\n};",
|
|
2582
2871
|
"doc": "/** A single issue. Messages NEVER include the variable's value — it may be a secret. */"
|
|
2583
2872
|
},
|
|
2873
|
+
{
|
|
2874
|
+
"name": "JobContext",
|
|
2875
|
+
"kind": "interface",
|
|
2876
|
+
"package": "@nifrajs/jobs",
|
|
2877
|
+
"signature": "export interface JobContext {\n readonly id: string;\n readonly name: string;\n /** 1 on the first run, 2 on the first retry, … */\n readonly attempt: number;\n}",
|
|
2878
|
+
"doc": "/** What a handler receives alongside the payload: identity + which attempt this is (1-based). */"
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
"name": "JobCounts",
|
|
2882
|
+
"kind": "interface",
|
|
2883
|
+
"package": "@nifrajs/jobs",
|
|
2884
|
+
"signature": "export interface JobCounts {\n /** Eligible or waiting, not currently leased. */\n readonly pending: number;\n /** Leased and in flight. */\n readonly active: number;\n /** Dead-lettered (exhausted retries). */\n readonly dead: number;\n}"
|
|
2885
|
+
},
|
|
2886
|
+
{
|
|
2887
|
+
"name": "JobDefinition",
|
|
2888
|
+
"kind": "interface",
|
|
2889
|
+
"package": "@nifrajs/jobs",
|
|
2890
|
+
"signature": "export interface JobDefinition<Payload> {\n readonly handler: JobHandler<Payload>;\n /** Optional Standard Schema — validates the payload at `enqueue` (the trust boundary); a failure throws. */\n readonly input?: StandardSchemaV1<Payload>;\n /** `number` is shorthand for `{ attempts }`. */\n readonly retries?: number | RetryPolicy;\n}",
|
|
2891
|
+
"doc": "/** A job definition registered on a queue. */"
|
|
2892
|
+
},
|
|
2893
|
+
{
|
|
2894
|
+
"name": "JobError",
|
|
2895
|
+
"kind": "class",
|
|
2896
|
+
"package": "@nifrajs/jobs",
|
|
2897
|
+
"signature": "export declare class JobError extends Error {\n readonly name = \"JobError\";\n}",
|
|
2898
|
+
"doc": "/** Thrown for a misuse of the queue API (duplicate/unknown job name). */"
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
"name": "JobHandle",
|
|
2902
|
+
"kind": "interface",
|
|
2903
|
+
"package": "@nifrajs/jobs",
|
|
2904
|
+
"signature": "export interface JobHandle<Payload> {\n readonly name: string;\n enqueue(payload: Payload, options?: EnqueueOptions): Promise<string>;\n}",
|
|
2905
|
+
"doc": "/** A typed handle to enqueue a defined job. */"
|
|
2906
|
+
},
|
|
2907
|
+
{
|
|
2908
|
+
"name": "JobHandler",
|
|
2909
|
+
"kind": "type",
|
|
2910
|
+
"package": "@nifrajs/jobs",
|
|
2911
|
+
"signature": "export type JobHandler<Payload> = (payload: Payload, ctx: JobContext) => void | Promise<void>;",
|
|
2912
|
+
"doc": "/** A job processor. A throw/rejection routes to `onError` and triggers retry/dead-letter — never crashes the worker. */"
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
"name": "JobStore",
|
|
2916
|
+
"kind": "interface",
|
|
2917
|
+
"package": "@nifrajs/jobs",
|
|
2918
|
+
"signature": "export interface JobStore {\n /** Persist a new job; return its id. */\n enqueue(job: {\n name: string;\n payload: unknown;\n runAt: number;\n maxAttempts: number;\n }): string | Promise<string>;\n /** Atomically claim up to `limit` jobs due at/before `now`, hiding them for `leaseMs`. */\n lease(now: number, limit: number, leaseMs: number): StoredJob[] | Promise<StoredJob[]>;\n /** A job finished successfully — remove it. */\n complete(id: string): void | Promise<void>;\n /** A job failed but has attempts left — bump its attempt count and reschedule for `runAt`. */\n retry(id: string, runAt: number): void | Promise<void>;\n /** A job exhausted its attempts — move it to the dead-letter set with the last error. */\n deadLetter(id: string, error: string): void | Promise<void>;\n /** Snapshot counts (observability + tests). */\n counts(): JobCounts | Promise<JobCounts>;\n}",
|
|
2919
|
+
"doc": "/**\n * Persistence + leasing for the queue. The default {@link MemoryJobStore} is single-process (dev / a\n * single long-running server); implement this over Redis/Postgres/etc. for durability or multiple\n * workers. All methods may be sync or async — the queue awaits them.\n */"
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
"name": "JobValidationError",
|
|
2923
|
+
"kind": "class",
|
|
2924
|
+
"package": "@nifrajs/jobs",
|
|
2925
|
+
"signature": "export declare class JobValidationError extends Error {\n readonly job: string;\n readonly issues: ReadonlyArray<{\n readonly message: string;\n }>;\n readonly name = \"JobValidationError\";\n constructor(job: string, issues: ReadonlyArray<{\n readonly message: string;\n }>);\n}",
|
|
2926
|
+
"doc": "/** Thrown by `enqueue` when the payload fails the job's `input` schema (validation at the trust boundary). */"
|
|
2927
|
+
},
|
|
2584
2928
|
{
|
|
2585
2929
|
"name": "jsonError",
|
|
2586
2930
|
"kind": "function",
|
|
@@ -2626,6 +2970,13 @@
|
|
|
2626
2970
|
"package": "@nifrajs/mcp",
|
|
2627
2971
|
"signature": "export type JsonRpcResponse = {\n jsonrpc: \"2.0\";\n id: JsonRpcId;\n result: unknown;\n} | {\n jsonrpc: \"2.0\";\n id: JsonRpcId;\n error: {\n code: number;\n message: string;\n };\n};"
|
|
2628
2972
|
},
|
|
2973
|
+
{
|
|
2974
|
+
"name": "JsonSchema",
|
|
2975
|
+
"kind": "type",
|
|
2976
|
+
"package": "@nifrajs/core",
|
|
2977
|
+
"signature": "export type JsonSchema = boolean | Readonly<Record<string, unknown>>;",
|
|
2978
|
+
"doc": "/** JSON Schema permits either a schema object or the boolean schemas `true` and `false`. */"
|
|
2979
|
+
},
|
|
2629
2980
|
{
|
|
2630
2981
|
"name": "jwk",
|
|
2631
2982
|
"kind": "function",
|
|
@@ -2765,6 +3116,12 @@
|
|
|
2765
3116
|
"signature": "export interface LinkDescriptor {\n readonly rel?: string;\n readonly href?: string;\n readonly hreflang?: string;\n readonly crossorigin?: string;\n readonly media?: string;\n readonly sizes?: string;\n readonly type?: string;\n readonly as?: string;\n readonly integrity?: string;\n readonly referrerpolicy?: string;\n readonly fetchpriority?: string;\n readonly title?: string;\n readonly imagesrcset?: string;\n readonly imagesizes?: string;\n readonly color?: string;\n readonly disabled?: boolean;\n readonly [attr: string]: string | boolean | undefined;\n}",
|
|
2766
3117
|
"doc": "/**\n * One `<link>` tag's attributes for a route/layout's `meta.link`. The common HTML `<link>` attributes\n * are spelled out and **optional** so a typed partial like `{ rel, href, hreflang }` is assignable —\n * the previous `Record<string, string>` required *every* value to be a present string, which rejected\n * exactly that idiomatic shape (the bug this fixes). The index signature keeps custom/`data-*` attrs\n * (and any future standard attr) passing without a cast; `boolean` covers boolean attributes like\n * `disabled` (rendered as a bare attribute when `true`, omitted when `false`), and `undefined` lets a\n * caller spread in a conditionally-absent attribute. Attribute *names* are still shape-validated and\n * values HTML-escaped at render — a widened type never widens the injection surface.\n */"
|
|
2767
3118
|
},
|
|
3119
|
+
{
|
|
3120
|
+
"name": "ListOptions",
|
|
3121
|
+
"kind": "interface",
|
|
3122
|
+
"package": "@nifrajs/storage",
|
|
3123
|
+
"signature": "export interface ListOptions {\n /** Only keys starting with this prefix. */\n readonly prefix?: string;\n /** Cap the number of keys returned. */\n readonly limit?: number;\n}"
|
|
3124
|
+
},
|
|
2768
3125
|
{
|
|
2769
3126
|
"name": "load",
|
|
2770
3127
|
"kind": "function",
|
|
@@ -2963,8 +3320,8 @@
|
|
|
2963
3320
|
"name": "MCP_CLI_VERSION",
|
|
2964
3321
|
"kind": "const",
|
|
2965
3322
|
"package": "create-nifra",
|
|
2966
|
-
"signature": "export declare const MCP_CLI_VERSION:
|
|
2967
|
-
"doc": "/**\n * The `@nifrajs/cli` version the launch command pins to.
|
|
3323
|
+
"signature": "export declare const MCP_CLI_VERSION: string;",
|
|
3324
|
+
"doc": "/**\n * The `@nifrajs/cli` version the launch command pins to — DERIVED at load time from this package's own\n * `version`, never hardcoded. `fixed` changeset versioning ([[\"@nifrajs/*\", \"create-nifra\", \"nifra\"]] in\n * `.changeset/config.json`) bumps `create-nifra` and `@nifrajs/cli` in lockstep, so `create-nifra@x`\n * always means `@nifrajs/cli@x`. Deriving it here means a release bump has nothing to forget to update —\n * there is no stale literal to drift (the 1.0.0 cut shipped a beta pin exactly this way). `check:publish`\n * still asserts it equals `@nifrajs/cli`'s version as a belt-and-suspenders guard on the `fixed` link.\n *\n * Resolves correctly under BOTH export conditions: the `bun` export runs `src/agent-files.ts`\n * (`../package.json` → the package root) and the tsc `default` export runs `dist/agent-files.js`\n * (`../package.json` → the same root, since `dist/` sits beside the manifest). npm always ships a\n * package's own `package.json`, so the read can't miss at install time.\n *\n * Why pin at all instead of `bunx @nifrajs/cli mcp`: `bunx` keys its cache on the exact version spec.\n * An UNPINNED spec resolves to the `latest` tag once, then `bunx` reuses that cached copy on every\n * later spawn WITHOUT re-checking the registry — so an editor that once launched an older `@nifrajs/cli`\n * keeps respawning the stale binary even after a newer one is published (the MCP server silently runs\n * old code). Pinning the exact version makes the version part of the cache key, so each release fetches\n * fresh and a stale cache can never shadow it. The cost: an already-scaffolded app's `.mcp.json` freezes\n * at its scaffold-time version until `nifra init-agents` is re-run — an acceptable, deterministic trade.\n */"
|
|
2968
3325
|
},
|
|
2969
3326
|
{
|
|
2970
3327
|
"name": "MCP_CONFIG",
|
|
@@ -2984,7 +3341,7 @@
|
|
|
2984
3341
|
"name": "MCP_SERVER_ARGS",
|
|
2985
3342
|
"kind": "const",
|
|
2986
3343
|
"package": "create-nifra",
|
|
2987
|
-
"signature": "export declare const MCP_SERVER_ARGS: readonly [
|
|
3344
|
+
"signature": "export declare const MCP_SERVER_ARGS: readonly [`@nifrajs/cli@${string}`, \"mcp\"];"
|
|
2988
3345
|
},
|
|
2989
3346
|
{
|
|
2990
3347
|
"name": "MCP_SERVER_COMMAND",
|
|
@@ -3033,6 +3390,13 @@
|
|
|
3033
3390
|
"package": "@nifrajs/mcp",
|
|
3034
3391
|
"signature": "export interface McpPrompt {\n readonly name: string;\n readonly description: string;\n readonly arguments?: readonly {\n readonly name: string;\n readonly description?: string;\n readonly required?: boolean;\n }[];\n readonly handler: (args: Record<string, unknown>) => Promise<readonly McpPromptMessage[]>;\n}"
|
|
3035
3392
|
},
|
|
3393
|
+
{
|
|
3394
|
+
"name": "McpPromptDescriptor",
|
|
3395
|
+
"kind": "interface",
|
|
3396
|
+
"package": "@nifrajs/core",
|
|
3397
|
+
"signature": "export interface McpPromptDescriptor {\n readonly name: string;\n readonly description: string;\n readonly arguments?: readonly PromptArgument[];\n readonly handler: (args: Record<string, string>) => MaybePromise<readonly PromptMessage[]>;\n}",
|
|
3398
|
+
"doc": "/** An app-declared MCP prompt — a reusable prompt template an agent can fetch through `nifra mcp`. */"
|
|
3399
|
+
},
|
|
3036
3400
|
{
|
|
3037
3401
|
"name": "McpPromptMessage",
|
|
3038
3402
|
"kind": "interface",
|
|
@@ -3057,6 +3421,13 @@
|
|
|
3057
3421
|
"package": "@nifrajs/mcp",
|
|
3058
3422
|
"signature": "export interface McpResource {\n readonly uri: string;\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n /** Descriptor `_meta` (MCP Apps: CSP / domain / border render hints under `ui`). */\n readonly _meta?: Record<string, unknown>;\n readonly read: () => Promise<{\n readonly text: string;\n readonly mimeType?: string;\n }>;\n}"
|
|
3059
3423
|
},
|
|
3424
|
+
{
|
|
3425
|
+
"name": "McpResourceDescriptor",
|
|
3426
|
+
"kind": "interface",
|
|
3427
|
+
"package": "@nifrajs/core",
|
|
3428
|
+
"signature": "export interface McpResourceDescriptor {\n readonly uri: string;\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n readonly read: () => MaybePromise<string | {\n readonly text: string;\n readonly mimeType?: string;\n }>;\n}",
|
|
3429
|
+
"doc": "/** An app-declared MCP resource — read-only data an agent can fetch through `nifra mcp`. */"
|
|
3430
|
+
},
|
|
3060
3431
|
{
|
|
3061
3432
|
"name": "McpServer",
|
|
3062
3433
|
"kind": "interface",
|
|
@@ -3080,8 +3451,14 @@
|
|
|
3080
3451
|
"name": "McpTool",
|
|
3081
3452
|
"kind": "interface",
|
|
3082
3453
|
"package": "@nifrajs/mcp",
|
|
3083
|
-
"signature": "export interface McpTool {\n readonly name: string;\n readonly description: string;\n readonly inputSchema: Record<string, unknown>;\n readonly _meta?: Record<string, unknown>;\n readonly handler: (args: Record<string, unknown>, context: McpToolContext) => Promise<string | McpToolResult>;\n}"
|
|
3084
|
-
|
|
3454
|
+
"signature": "export interface McpTool {\n readonly name: string;\n readonly description: string;\n readonly inputSchema: Record<string, unknown>;\n readonly annotations?: McpToolAnnotations;\n readonly _meta?: Record<string, unknown>;\n readonly handler: (args: Record<string, unknown>, context: McpToolContext) => Promise<string | McpToolResult>;\n}"
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
"name": "McpToolAnnotations",
|
|
3458
|
+
"kind": "interface",
|
|
3459
|
+
"package": "@nifrajs/mcp",
|
|
3460
|
+
"signature": "export interface McpToolAnnotations {\n readonly title?: string;\n readonly readOnlyHint?: boolean;\n readonly destructiveHint?: boolean;\n readonly idempotentHint?: boolean;\n readonly openWorldHint?: boolean;\n}",
|
|
3461
|
+
"doc": "/** MCP tool safety hints (`readOnlyHint`/`destructiveHint`/…) surfaced in `tools/list`, per the MCP spec. */"
|
|
3085
3462
|
},
|
|
3086
3463
|
{
|
|
3087
3464
|
"name": "McpToolContext",
|
|
@@ -3117,6 +3494,18 @@
|
|
|
3117
3494
|
"signature": "export interface McpWidget {\n readonly uri: string;\n readonly resource: McpResource;\n readonly meta: Record<string, unknown>;\n}",
|
|
3118
3495
|
"doc": "/** A widget: the resource to register on the server, its `ui://` URI, and the `_meta` link for its tool. */"
|
|
3119
3496
|
},
|
|
3497
|
+
{
|
|
3498
|
+
"name": "MemoryCache",
|
|
3499
|
+
"kind": "class",
|
|
3500
|
+
"package": "@nifrajs/cache",
|
|
3501
|
+
"signature": "export declare class MemoryCache implements CacheStore {\n private readonly rows;\n private readonly tagIndex;\n private readonly maxEntries;\n private readonly now;\n constructor(options?: MemoryCacheOptions);\n get(key: string): StoredEntry | undefined;\n set(key: string, entry: StoredEntry, tags: readonly string[]): void;\n delete(key: string): void;\n invalidateTag(tag: string): void;\n clear(): void;\n /** Live entry count (for observability/tests). */\n size(): number;\n /** Remove a key and unlink it from every tag set it belonged to. */\n private evict;\n}"
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
"name": "MemoryCacheOptions",
|
|
3505
|
+
"kind": "interface",
|
|
3506
|
+
"package": "@nifrajs/cache",
|
|
3507
|
+
"signature": "export interface MemoryCacheOptions {\n /** Evict the least-recently-used entry once the count exceeds this. `0` (default) = unbounded. */\n readonly maxEntries?: number;\n /** Injectable clock (tests). Default `() => Date.now()`. */\n readonly now?: () => number;\n}"
|
|
3508
|
+
},
|
|
3120
3509
|
{
|
|
3121
3510
|
"name": "MemoryCacheStore",
|
|
3122
3511
|
"kind": "class",
|
|
@@ -3143,6 +3532,13 @@
|
|
|
3143
3532
|
"package": "@nifrajs/middleware",
|
|
3144
3533
|
"signature": "export interface MemoryIdempotencyStoreOptions {\n /** Allow the in-memory store in production. Off by default — a per-instance store can't dedupe across instances. */\n readonly allowInProduction?: boolean;\n}"
|
|
3145
3534
|
},
|
|
3535
|
+
{
|
|
3536
|
+
"name": "MemoryJobStore",
|
|
3537
|
+
"kind": "class",
|
|
3538
|
+
"package": "@nifrajs/jobs",
|
|
3539
|
+
"signature": "export declare class MemoryJobStore implements JobStore {\n private readonly jobs;\n private readonly dead;\n private seq;\n private readonly idFor;\n constructor(options?: {\n idFor?: () => string;\n });\n enqueue(job: {\n name: string;\n payload: unknown;\n runAt: number;\n maxAttempts: number;\n }): string;\n lease(now: number, limit: number, leaseMs: number): StoredJob[];\n complete(id: string): void;\n retry(id: string, runAt: number): void;\n deadLetter(id: string, error: string): void;\n counts(now?: number): JobCounts;\n /** The dead-letter queue — inspect/requeue failed jobs (not part of the {@link JobStore} contract). */\n deadLetters(): DeadRecord[];\n}",
|
|
3540
|
+
"doc": "/** Construct an in-memory job store. `idFor` is injectable for deterministic tests. */"
|
|
3541
|
+
},
|
|
3146
3542
|
{
|
|
3147
3543
|
"name": "MemoryResponseCache",
|
|
3148
3544
|
"kind": "class",
|
|
@@ -3168,6 +3564,12 @@
|
|
|
3168
3564
|
"package": "@nifrajs/auth",
|
|
3169
3565
|
"signature": "export interface MemorySessionStoreOptions {\n /** Allow the in-memory store in production. Off by default — per-instance sessions don't hold across\n * instances and are lost on restart. */\n readonly allowInProduction?: boolean;\n /** Hard cap on stored sessions; the oldest-inserted is evicted past it (default 10_000). */\n readonly max?: number;\n}"
|
|
3170
3566
|
},
|
|
3567
|
+
{
|
|
3568
|
+
"name": "MemoryStorage",
|
|
3569
|
+
"kind": "class",
|
|
3570
|
+
"package": "@nifrajs/storage",
|
|
3571
|
+
"signature": "export declare class MemoryStorage implements StorageAdapter {\n private readonly objects;\n constructor();\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n get(key: string): Promise<StorageObject | null>;\n delete(key: string): Promise<void>;\n exists(key: string): Promise<boolean>;\n list(options?: ListOptions): Promise<string[]>;\n}"
|
|
3572
|
+
},
|
|
3171
3573
|
{
|
|
3172
3574
|
"name": "MemoryStore",
|
|
3173
3575
|
"kind": "class",
|
|
@@ -3249,6 +3651,32 @@
|
|
|
3249
3651
|
"signature": "export interface Middleware {\n readonly name?: string;\n readonly onRequest?: (req: Request) => MaybePromise<OnRequestResult>;\n readonly around?: <T>(context: Context, next: () => MaybePromise<T>) => MaybePromise<T>;\n readonly beforeHandle?: (context: Context) => MaybePromise<unknown>;\n readonly afterHandle?: (result: unknown, context: Context) => MaybePromise<unknown>;\n readonly onResponse?: (response: Response, req: Request) => MaybePromise<Response>;\n readonly onError?: (error: unknown, context: Context) => MaybePromise<unknown>;\n}",
|
|
3250
3652
|
"doc": "/**\n * A bundle of lifecycle hooks applied together via {@link Server.use} — the unit\n * `@nifrajs/middleware` ships (cors, security headers, rate-limit). Every hook is\n * optional and wired to its lifecycle point. Middleware is context-agnostic (sees\n * the base `Context`); `use` does no context-type merging — the full type-merging\n * plugin system is deferred, and `.use` is reserved as its future entry point.\n */"
|
|
3251
3653
|
},
|
|
3654
|
+
{
|
|
3655
|
+
"name": "MockableApp",
|
|
3656
|
+
"kind": "interface",
|
|
3657
|
+
"package": "@nifrajs/mock",
|
|
3658
|
+
"signature": "export interface MockableApp {\n routes(): readonly MockableRoute[];\n}",
|
|
3659
|
+
"doc": "/** App shape — anything with a `routes()` method. */"
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
"name": "MockableRoute",
|
|
3663
|
+
"kind": "interface",
|
|
3664
|
+
"package": "@nifrajs/mock",
|
|
3665
|
+
"signature": "export interface MockableRoute {\n readonly method: string;\n readonly path: string;\n readonly schema?: {\n readonly response?: unknown;\n } | undefined;\n}",
|
|
3666
|
+
"doc": "/** Minimal route shape returned by `app.routes()`. */"
|
|
3667
|
+
},
|
|
3668
|
+
{
|
|
3669
|
+
"name": "MockServer",
|
|
3670
|
+
"kind": "interface",
|
|
3671
|
+
"package": "@nifrajs/mock",
|
|
3672
|
+
"signature": "export interface MockServer {\n /** Handle a request against the mock routes. */\n fetch(request: Request): Promise<Response>;\n /** The generated mock routes for inspection. */\n readonly mockRoutes: ReadonlyArray<{\n method: string;\n path: string;\n }>;\n}"
|
|
3673
|
+
},
|
|
3674
|
+
{
|
|
3675
|
+
"name": "MockServerOptions",
|
|
3676
|
+
"kind": "interface",
|
|
3677
|
+
"package": "@nifrajs/mock",
|
|
3678
|
+
"signature": "export interface MockServerOptions {\n /** Seed for deterministic mock generation. */\n readonly seed?: number | undefined;\n /** Log mock requests to console. */\n readonly verbose?: boolean | undefined;\n}"
|
|
3679
|
+
},
|
|
3252
3680
|
{
|
|
3253
3681
|
"name": "ModuleReader",
|
|
3254
3682
|
"kind": "type",
|
|
@@ -3319,6 +3747,13 @@
|
|
|
3319
3747
|
"signature": "export interface MountRouterOptions {\n readonly router: ClientRouter;\n /** routeId → layout chain (outermost layout → page); built by `generateClientEntry`. */\n readonly routes: Record<string, readonly unknown[]>;\n /** Hydration container (opaque — the adapter casts it to its DOM element type). */\n readonly container: unknown;\n}",
|
|
3320
3748
|
"doc": "/** Options for a per-adapter `mountRouter` (the Router binding that hydrates + re-renders). */"
|
|
3321
3749
|
},
|
|
3750
|
+
{
|
|
3751
|
+
"name": "MovableStorageAdapter",
|
|
3752
|
+
"kind": "interface",
|
|
3753
|
+
"package": "@nifrajs/storage",
|
|
3754
|
+
"signature": "export interface MovableStorageAdapter extends StorageAdapter {\n copy(sourceKey: string, destinationKey: string): Promise<void>;\n move(sourceKey: string, destinationKey: string): Promise<void>;\n}",
|
|
3755
|
+
"doc": "/** Optional server-side copy/move capability. */"
|
|
3756
|
+
},
|
|
3322
3757
|
{
|
|
3323
3758
|
"name": "namedCombine",
|
|
3324
3759
|
"kind": "function",
|
|
@@ -3402,6 +3837,13 @@
|
|
|
3402
3837
|
"signature": "export interface NifraWebSocket<Data = unknown> {\n /** Send a text (`string`) or binary (`ArrayBuffer`/typed-array) frame. No-op once closed. */\n send(data: string | ArrayBufferView | ArrayBuffer): void;\n /** Close the connection (optional code 1000–4999 + short reason). */\n close(code?: number, reason?: string): void;\n /** `WebSocket.readyState` (0 CONNECTING · 1 OPEN · 2 CLOSING · 3 CLOSED). */\n readonly readyState: number;\n /** Join a pub/sub topic — `app.publish(topic, data)` then reaches this connection. Idempotent. */\n subscribe(topic: string): void;\n /** Leave a pub/sub topic. Idempotent. (All topics are dropped automatically on close.) */\n unsubscribe(topic: string): void;\n /** Per-connection state — seeded by `upgrade()`, mutable for the connection's lifetime. */\n data: Data;\n /** Escape hatch to the runtime's native socket (Bun `ServerWebSocket`, Web `WebSocket`, `ws`). */\n readonly raw: unknown;\n}",
|
|
3403
3838
|
"doc": "/** The portable socket handed to WS lifecycle callbacks. Each adapter wraps its native socket. */"
|
|
3404
3839
|
},
|
|
3840
|
+
{
|
|
3841
|
+
"name": "noBackoff",
|
|
3842
|
+
"kind": "const",
|
|
3843
|
+
"package": "@nifrajs/jobs",
|
|
3844
|
+
"signature": "export declare const noBackoff: Backoff;",
|
|
3845
|
+
"doc": "/** No delay — retry immediately. */"
|
|
3846
|
+
},
|
|
3405
3847
|
{
|
|
3406
3848
|
"name": "NodeBuiltinFinding",
|
|
3407
3849
|
"kind": "interface",
|
|
@@ -3427,7 +3869,7 @@
|
|
|
3427
3869
|
"kind": "function",
|
|
3428
3870
|
"package": "@nifrajs/web",
|
|
3429
3871
|
"signature": "export declare function normalizeRolldownPlugins(plugins: readonly unknown[], isRolldown: boolean): readonly unknown[];",
|
|
3430
|
-
"doc": "/**\n * Strip `optimizeDeps.rollupOptions.jsx` from a plugin's `config` hook output when running under\n * rolldown-vite — the source of the scary, harmless `Warning: Invalid input options … \"jsx\" Invalid\n * key: Expected never but received \"jsx\"` on `nifra dev`.\n *\n * Why it happens: `@vitejs/plugin-react@4.x` (and peers) target an *older* rolldown-vite optimizeDeps\n * API — they inject `optimizeDeps.rollupOptions.jsx` to tell the dep pre-bundler to transform JSX. Vite\n * 8's rolldown dep-optimizer renamed that surface to `optimizeDeps.rolldownOptions` (and moved jsx under\n * `transform.jsx`), so the stale `rollupOptions.jsx` is an unrecognized input option → the warning. It's\n * a version-skew artifact, not a real misconfig: the route source JSX transform runs through the\n * plugin's own `transform` hook (untouched here), and node_modules deps that get pre-bundled almost\n * never contain raw JSX — so dropping the dead key changes no behavior and keeps HMR/Fast Refresh\n * intact. We *strip* (rather than translate to `rolldownOptions`) so the fix is version-agnostic: a\n * plugin already emitting the correct `rolldownOptions` is left untouched, and a future plugin bump that\n * stops emitting `rollupOptions.jsx` makes this a no-op.\n *\n * Scoped narrowly: only the `optimizeDeps.rollupOptions.jsx` key is removed, only under rolldown-vite,\n * and only from the value a plugin's `config` hook returns. Non-rolldown Vite is passed through verbatim.\n */"
|
|
3872
|
+
"doc": "/**\n * Strip `optimizeDeps.rollupOptions.jsx` from a plugin's `config` hook output when running under\n * rolldown-vite — the source of the scary, harmless `Warning: Invalid input options … \"jsx\" Invalid\n * key: Expected never but received \"jsx\"` on `nifra dev`.\n *\n * Why it happens: `@vitejs/plugin-react@4.x` (and peers) target an *older* rolldown-vite optimizeDeps\n * API — they inject `optimizeDeps.rollupOptions.jsx` to tell the dep pre-bundler to transform JSX. Vite\n * 8's rolldown dep-optimizer renamed that surface to `optimizeDeps.rolldownOptions` (and moved jsx under\n * `transform.jsx`), so the stale `rollupOptions.jsx` is an unrecognized input option → the warning. It's\n * a version-skew artifact, not a real misconfig: the route source JSX transform runs through the\n * plugin's own `transform` hook (untouched here), and node_modules deps that get pre-bundled almost\n * never contain raw JSX — so dropping the dead key changes no behavior and keeps HMR/Fast Refresh\n * intact. We *strip* (rather than translate to `rolldownOptions`) so the fix is version-agnostic: a\n * plugin already emitting the correct `rolldownOptions` is left untouched, and a future plugin bump that\n * stops emitting `rollupOptions.jsx` makes this a no-op.\n *\n * Scoped narrowly: only the `optimizeDeps.rollupOptions.jsx` key is removed, only under rolldown-vite,\n * and only from the value a plugin's `config` hook returns. Non-rolldown Vite is passed through verbatim.\n *\n * FLATTEN FIRST: a Vite plugin factory may return an ARRAY of plugins — `@vitejs/plugin-react`'s `react()`\n * returns `[vite:react-babel, vite:react-refresh]`, and it's `react:react-babel`'s `config` hook that emits\n * the offending `optimizeDeps.rollupOptions.jsx`. `nifra.config.ts` writes `vitePlugins = [react()]`, so the\n * plugin list arrives NESTED (`[[babel, refresh]]`). Without flattening, `.map` sees the inner array (which\n * has no `config`), leaves it untouched, and Vite — which flattens plugin arrays itself before running them\n * — then executes the un-stripped babel hook, so the warning survives. Flattening here (Vite accepts a flat\n * list identically) is what lets the strip reach every real plugin.\n */"
|
|
3431
3873
|
},
|
|
3432
3874
|
{
|
|
3433
3875
|
"name": "number",
|
|
@@ -3436,6 +3878,43 @@
|
|
|
3436
3878
|
"signature": "export declare function number(opts?: Base<number> & Optional): StandardSchemaV1<number | undefined>;",
|
|
3437
3879
|
"doc": "/** A finite number, coerced from its decimal string. */"
|
|
3438
3880
|
},
|
|
3881
|
+
{
|
|
3882
|
+
"name": "ObservationAdapter",
|
|
3883
|
+
"kind": "interface",
|
|
3884
|
+
"package": "@nifrajs/otel",
|
|
3885
|
+
"signature": "export interface ObservationAdapter {\n onStart?(span: NifraSpan): void;\n onEnd(span: NifraSpan): void;\n}",
|
|
3886
|
+
"doc": "/**\n * Where ended spans go. Implement this to bridge to the OpenTelemetry SDK (map each field onto a\n * real `Span` from a `Tracer`), ship to a collector, or just log. `onStart` is optional (most\n * backends only need the completed span).\n */"
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
"name": "ObservationClock",
|
|
3890
|
+
"kind": "interface",
|
|
3891
|
+
"package": "@nifrajs/otel",
|
|
3892
|
+
"signature": "export interface ObservationClock {\n /** Epoch milliseconds for interoperable start/end timestamps. */\n wallTime(): number;\n /** Monotonic milliseconds for durations. */\n monotonicTime(): number;\n}"
|
|
3893
|
+
},
|
|
3894
|
+
{
|
|
3895
|
+
"name": "ObservationContext",
|
|
3896
|
+
"kind": "interface",
|
|
3897
|
+
"package": "@nifrajs/otel",
|
|
3898
|
+
"signature": "export interface ObservationContext {\n readonly traceId: string;\n readonly spanId: string;\n readonly parentSpanId?: string;\n readonly sampled: boolean;\n /** This span's outbound W3C trace context. */\n readonly traceparent: string;\n}"
|
|
3899
|
+
},
|
|
3900
|
+
{
|
|
3901
|
+
"name": "ObservationLifecycle",
|
|
3902
|
+
"kind": "interface",
|
|
3903
|
+
"package": "@nifrajs/otel",
|
|
3904
|
+
"signature": "export interface ObservationLifecycle {\n start(input: StartObservation, additionalAdapters?: readonly ObservationAdapter[]): ActiveObservation;\n}"
|
|
3905
|
+
},
|
|
3906
|
+
{
|
|
3907
|
+
"name": "ObservationLifecycleOptions",
|
|
3908
|
+
"kind": "interface",
|
|
3909
|
+
"package": "@nifrajs/otel",
|
|
3910
|
+
"signature": "export interface ObservationLifecycleOptions {\n readonly adapters?: readonly ObservationAdapter[];\n /** Injectable seams are primarily useful for deterministic tests and constrained runtimes. */\n readonly clock?: ObservationClock;\n readonly generateTraceId?: () => string;\n readonly generateSpanId?: () => string;\n}"
|
|
3911
|
+
},
|
|
3912
|
+
{
|
|
3913
|
+
"name": "ObservationParent",
|
|
3914
|
+
"kind": "interface",
|
|
3915
|
+
"package": "@nifrajs/otel",
|
|
3916
|
+
"signature": "export interface ObservationParent {\n readonly traceId: string;\n readonly spanId: string;\n readonly sampled: boolean;\n}"
|
|
3917
|
+
},
|
|
3439
3918
|
{
|
|
3440
3919
|
"name": "OnRequestResult",
|
|
3441
3920
|
"kind": "type",
|
|
@@ -3560,6 +4039,20 @@
|
|
|
3560
4039
|
"signature": "export declare function packageOf(spec: string): string | undefined;",
|
|
3561
4040
|
"doc": "/**\n * Resolve an import specifier to the npm package name it would install as, or `undefined` when it isn't\n * an npm dependency at all (a relative/absolute path, a runtime builtin, or a malformed scope like the\n * `@/…` path-alias convention). `@scope/name/sub` → `@scope/name`; `name/sub` → `name`.\n */"
|
|
3562
4041
|
},
|
|
4042
|
+
{
|
|
4043
|
+
"name": "Page",
|
|
4044
|
+
"kind": "interface",
|
|
4045
|
+
"package": "@nifrajs/schema",
|
|
4046
|
+
"signature": "export interface Page<Item> {\n readonly items: Item[];\n readonly nextCursor: string | null;\n}",
|
|
4047
|
+
"doc": "/** A cursor-pagination page — matches the shape of `t.paginated(item)`. */"
|
|
4048
|
+
},
|
|
4049
|
+
{
|
|
4050
|
+
"name": "PagedStorageAdapter",
|
|
4051
|
+
"kind": "interface",
|
|
4052
|
+
"package": "@nifrajs/storage",
|
|
4053
|
+
"signature": "export interface PagedStorageAdapter extends StorageAdapter {\n listPage(options?: StorageListPageOptions): Promise<StorageListPage>;\n}",
|
|
4054
|
+
"doc": "/** Optional cursor-listing capability. Kept out of {@link StorageAdapter} for simple stores. */"
|
|
4055
|
+
},
|
|
3563
4056
|
{
|
|
3564
4057
|
"name": "PageRouteInput",
|
|
3565
4058
|
"kind": "interface",
|
|
@@ -3574,6 +4067,13 @@
|
|
|
3574
4067
|
"signature": "export declare function pageRoutesSection(manifest: Manifest | undefined): string;",
|
|
3575
4068
|
"doc": "/** Markdown section listing the file-routed pages (URL pattern → source file). */"
|
|
3576
4069
|
},
|
|
4070
|
+
{
|
|
4071
|
+
"name": "paginate",
|
|
4072
|
+
"kind": "function",
|
|
4073
|
+
"package": "@nifrajs/schema",
|
|
4074
|
+
"signature": "export declare function paginate<Row>(rows: readonly Row[], limit: number, cursorOf: (row: Row) => unknown): Page<Row>;",
|
|
4075
|
+
"doc": "/**\n * Build a page from rows you fetched with `limit + 1`. If the extra row came back there are more pages:\n * drop it and emit a `nextCursor` from the last KEPT row via `cursorOf`; otherwise `nextCursor` is `null`.\n *\n * const rows = await db.notes.after(decodeCursor(query.cursor)).take(limit + 1)\n * return paginate(rows, limit, (note) => note.id)\n */"
|
|
4076
|
+
},
|
|
3577
4077
|
{
|
|
3578
4078
|
"name": "Params",
|
|
3579
4079
|
"kind": "type",
|
|
@@ -3864,6 +4364,13 @@
|
|
|
3864
4364
|
"signature": "export declare function prerenderRoutes(options: PrerenderOptions): Promise<PrerenderResult>;",
|
|
3865
4365
|
"doc": "/**\n * Render every opted-in static route to a static `index.html` under `outDir`. Run AFTER `buildClient`\n * (so the app references the hashed client entry). Returns a report of what was emitted vs skipped —\n * the caller can use `prerendered` to wire a hybrid deploy (e.g. exclude those paths from the SSR\n * worker so the CDN serves the static file). Never throws on a per-route miss: a non-OK response or a\n * non-opted/dynamic route is recorded in `skipped` and the build continues.\n */"
|
|
3866
4366
|
},
|
|
4367
|
+
{
|
|
4368
|
+
"name": "PresignableStorageAdapter",
|
|
4369
|
+
"kind": "interface",
|
|
4370
|
+
"package": "@nifrajs/storage",
|
|
4371
|
+
"signature": "export interface PresignableStorageAdapter extends StorageAdapter {\n presign(key: string, operation: StoragePresignOperation, options?: StoragePresignOptions): Promise<StoragePresignedUrl>;\n}",
|
|
4372
|
+
"doc": "/** Optional provider-side URL-signing capability. Asset sensitivity and TTL policy stay with callers. */"
|
|
4373
|
+
},
|
|
3867
4374
|
{
|
|
3868
4375
|
"name": "Prettify",
|
|
3869
4376
|
"kind": "type",
|
|
@@ -3909,6 +4416,20 @@
|
|
|
3909
4416
|
"signature": "export declare function projectTools(cwd: string, loadAppCached?: (outDirName?: string) => Promise<LoadedApp>): McpTool[];",
|
|
3910
4417
|
"doc": "/** Build the project-scoped tools for `cwd`. */"
|
|
3911
4418
|
},
|
|
4419
|
+
{
|
|
4420
|
+
"name": "PromptArgument",
|
|
4421
|
+
"kind": "interface",
|
|
4422
|
+
"package": "@nifrajs/core",
|
|
4423
|
+
"signature": "export interface PromptArgument {\n readonly name: string;\n readonly description?: string;\n readonly required?: boolean;\n}",
|
|
4424
|
+
"doc": "/** One declared argument of an MCP prompt, surfaced in `prompts/list`. */"
|
|
4425
|
+
},
|
|
4426
|
+
{
|
|
4427
|
+
"name": "PromptMessage",
|
|
4428
|
+
"kind": "interface",
|
|
4429
|
+
"package": "@nifrajs/core",
|
|
4430
|
+
"signature": "export interface PromptMessage {\n readonly role: \"user\" | \"assistant\";\n readonly content: {\n readonly type: \"text\";\n readonly text: string;\n };\n}",
|
|
4431
|
+
"doc": "/** A message in an MCP prompt's rendered output (see {@link Server.prompt}). */"
|
|
4432
|
+
},
|
|
3912
4433
|
{
|
|
3913
4434
|
"name": "PROTOCOL_VERSION",
|
|
3914
4435
|
"kind": "const",
|
|
@@ -3930,6 +4451,12 @@
|
|
|
3930
4451
|
"signature": "export declare function publicEnvDefines(prefix: string, env: Readonly<Record<string, string | undefined>>): Record<string, string>;",
|
|
3931
4452
|
"doc": "/**\n * The `process.env.<NAME>` → `JSON.stringify(value)` define entries for every env var whose name\n * carries `prefix` (the Vite/Next public-env convention). Exposing ONLY the prefixed vars is the\n * security boundary: an unprefixed var (a secret) never gets a define, so the bare `process.env`\n * define resolves it to `undefined` in the client bundle. An empty `prefix` exposes nothing (the\n * opt-out). Pure + exported so the prefix/redaction contract is unit-testable without a real build.\n */"
|
|
3932
4453
|
},
|
|
4454
|
+
{
|
|
4455
|
+
"name": "PutOptions",
|
|
4456
|
+
"kind": "interface",
|
|
4457
|
+
"package": "@nifrajs/storage",
|
|
4458
|
+
"signature": "export interface PutOptions {\n /** MIME type stored alongside the object (returned by `get`). */\n readonly contentType?: string;\n /** Arbitrary string metadata stored with the object. */\n readonly metadata?: Readonly<Record<string, string>>;\n}"
|
|
4459
|
+
},
|
|
3933
4460
|
{
|
|
3934
4461
|
"name": "QueryClient",
|
|
3935
4462
|
"kind": "interface",
|
|
@@ -3990,12 +4517,44 @@
|
|
|
3990
4517
|
"signature": "export type QueryValue = string | string[];",
|
|
3991
4518
|
"doc": "/** A query value: a single occurrence is a string; a repeated key promotes to a string[] so an\n * array query schema (`t.array(t.string())`) can validate `?tag=a&tag=b` — last-wins silently\n * dropped values before (audit 2026-06). Single-occurrence keys stay plain strings, so existing\n * `t.string()` schemas are untouched; a repeated key against a string schema now FAILS validation\n * (an explicit 400 beats silently picking one). */"
|
|
3992
4519
|
},
|
|
4520
|
+
{
|
|
4521
|
+
"name": "Queue",
|
|
4522
|
+
"kind": "interface",
|
|
4523
|
+
"package": "@nifrajs/jobs",
|
|
4524
|
+
"signature": "export interface Queue {\n /** Register a typed job. Throws now (not at run time) on a duplicate name. */\n define<Payload>(name: string, definition: JobDefinition<Payload>): JobHandle<Payload>;\n /** Enqueue by name (the {@link JobHandle} is the typed alternative). */\n enqueue(name: string, payload: unknown, options?: EnqueueOptions): Promise<string>;\n /** Run ONE poll round: lease up to `concurrency` due jobs, run them, await them. Returns the count run.\n * Re-entrant-safe (a concurrent call returns the in-flight round). Used by `start()` and by Workers. */\n process(): Promise<number>;\n /** Process repeatedly until no job is due (one-shot batch drain). */\n drain(): Promise<number>;\n /** Start the background worker (Bun/Node/Deno). */\n start(options?: WorkerOptions): Worker;\n /** Current store counts. */\n counts(): JobCounts | Promise<JobCounts>;\n /** The underlying store (for dead-letter inspection, custom drivers). */\n readonly store: JobStore;\n}"
|
|
4525
|
+
},
|
|
4526
|
+
{
|
|
4527
|
+
"name": "QueueOptions",
|
|
4528
|
+
"kind": "interface",
|
|
4529
|
+
"package": "@nifrajs/jobs",
|
|
4530
|
+
"signature": "export interface QueueOptions {\n /** Persistence. Default: a fresh {@link MemoryJobStore} (single-process). */\n readonly store?: JobStore;\n /** Called when a handler throws (before retry/dead-letter). Default: `console.error`. A throwing handler here is swallowed. */\n readonly onError?: (error: unknown, jobName: string) => void;\n /** Injectable clock (tests). Default `() => Date.now()`. */\n readonly now?: () => number;\n /** Default attempts for jobs that don't set `retries`. Default 3. */\n readonly defaultAttempts?: number;\n /** Default backoff for jobs that don't set one. Default {@link exponentialBackoff}. */\n readonly backoff?: Backoff;\n}"
|
|
4531
|
+
},
|
|
3993
4532
|
{
|
|
3994
4533
|
"name": "quotedHeaderValue",
|
|
3995
4534
|
"kind": "function",
|
|
3996
4535
|
"package": "@nifrajs/middleware",
|
|
3997
4536
|
"signature": "export declare function quotedHeaderValue(value: string): string;"
|
|
3998
4537
|
},
|
|
4538
|
+
{
|
|
4539
|
+
"name": "R2BucketLike",
|
|
4540
|
+
"kind": "interface",
|
|
4541
|
+
"package": "@nifrajs/storage",
|
|
4542
|
+
"signature": "export interface R2BucketLike {\n put(key: string, value: ArrayBuffer | ArrayBufferView, options?: {\n httpMetadata?: {\n contentType?: string;\n };\n customMetadata?: Record<string, string>;\n }): Promise<unknown>;\n get(key: string): Promise<(R2ObjectLike & {\n arrayBuffer(): Promise<ArrayBuffer>;\n }) | null>;\n head(key: string): Promise<R2ObjectLike | null>;\n delete(key: string): Promise<void>;\n list(options?: {\n prefix?: string;\n limit?: number;\n }): Promise<{\n objects: ReadonlyArray<{\n key: string;\n }>;\n }>;\n}",
|
|
4543
|
+
"doc": "/** The slice of the R2 bucket binding this adapter calls. `env.<BUCKET>` satisfies it. */"
|
|
4544
|
+
},
|
|
4545
|
+
{
|
|
4546
|
+
"name": "R2ObjectLike",
|
|
4547
|
+
"kind": "interface",
|
|
4548
|
+
"package": "@nifrajs/storage",
|
|
4549
|
+
"signature": "export interface R2ObjectLike {\n readonly size: number;\n readonly httpMetadata?: {\n readonly contentType?: string;\n };\n readonly customMetadata?: Record<string, string>;\n}",
|
|
4550
|
+
"doc": "/** The slice of R2's object metadata this adapter reads. */"
|
|
4551
|
+
},
|
|
4552
|
+
{
|
|
4553
|
+
"name": "R2Storage",
|
|
4554
|
+
"kind": "class",
|
|
4555
|
+
"package": "@nifrajs/storage",
|
|
4556
|
+
"signature": "export declare class R2Storage implements StorageAdapter {\n private readonly bucket;\n constructor(bucket: R2BucketLike);\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n get(key: string): Promise<StorageObject | null>;\n delete(key: string): Promise<void>;\n exists(key: string): Promise<boolean>;\n list(options?: ListOptions): Promise<string[]>;\n}"
|
|
4557
|
+
},
|
|
3999
4558
|
{
|
|
4000
4559
|
"name": "rateLimit",
|
|
4001
4560
|
"kind": "function",
|
|
@@ -4131,6 +4690,39 @@
|
|
|
4131
4690
|
"signature": "export interface RedirectOptions {\n /** HTTP status (default 303 See Other; pass 307/308 to preserve the method). */\n readonly status?: number;\n /** Allow an off-origin / absolute destination. Off by default: only a same-origin path (a single\n * leading `/`) is permitted, so an action can't be turned into an open redirect by passing\n * attacker-controlled input straight through. Set `true` for a deliberate external redirect. */\n readonly external?: boolean;\n}",
|
|
4132
4691
|
"doc": "/** Options for {@link redirect}. */"
|
|
4133
4692
|
},
|
|
4693
|
+
{
|
|
4694
|
+
"name": "ReflectedRoute",
|
|
4695
|
+
"kind": "interface",
|
|
4696
|
+
"package": "@nifrajs/core",
|
|
4697
|
+
"signature": "export interface ReflectedRoute {\n readonly method: string;\n readonly path: string;\n readonly schema?: ReflectedRouteSchema;\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}"
|
|
4698
|
+
},
|
|
4699
|
+
{
|
|
4700
|
+
"name": "ReflectedRouteSchema",
|
|
4701
|
+
"kind": "interface",
|
|
4702
|
+
"package": "@nifrajs/core",
|
|
4703
|
+
"signature": "export interface ReflectedRouteSchema {\n readonly body?: SchemaReflection;\n readonly query?: SchemaReflection;\n readonly response?: SchemaReflection;\n readonly errors?: Readonly<Record<string, SchemaReflection>>;\n}"
|
|
4704
|
+
},
|
|
4705
|
+
{
|
|
4706
|
+
"name": "ReflectedSchemaField",
|
|
4707
|
+
"kind": "interface",
|
|
4708
|
+
"package": "@nifrajs/core",
|
|
4709
|
+
"signature": "export interface ReflectedSchemaField {\n readonly name: string;\n readonly required: boolean;\n readonly schema: JsonSchema;\n}",
|
|
4710
|
+
"doc": "/** One top-level property of an introspectable object schema. */"
|
|
4711
|
+
},
|
|
4712
|
+
{
|
|
4713
|
+
"name": "reflectRoutes",
|
|
4714
|
+
"kind": "function",
|
|
4715
|
+
"package": "@nifrajs/core",
|
|
4716
|
+
"signature": "export declare function reflectRoutes(source: unknown): readonly ReflectedRoute[];",
|
|
4717
|
+
"doc": "/**\n * Safely enumerate and normalize route descriptors from an app or descriptor array. Invalid entries\n * are ignored; a missing/throwing `routes()` method yields an empty array.\n */"
|
|
4718
|
+
},
|
|
4719
|
+
{
|
|
4720
|
+
"name": "reflectSchema",
|
|
4721
|
+
"kind": "function",
|
|
4722
|
+
"package": "@nifrajs/core",
|
|
4723
|
+
"signature": "export declare function reflectSchema(value: unknown): SchemaReflection;",
|
|
4724
|
+
"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 */"
|
|
4725
|
+
},
|
|
4134
4726
|
{
|
|
4135
4727
|
"name": "registerFormat",
|
|
4136
4728
|
"kind": "function",
|
|
@@ -4156,7 +4748,7 @@
|
|
|
4156
4748
|
"name": "RegistryFromImpl",
|
|
4157
4749
|
"kind": "type",
|
|
4158
4750
|
"package": "@nifrajs/core",
|
|
4159
|
-
"signature": "export type RegistryFromImpl<C extends ContractShape, H extends HandlersFor<C>> = {\n [P in C[keyof C][\"path\"]]: {\n [K in keyof C as C[K][\"path\"] extends P ? C[K][\"method\"] : never]: {\n readonly params: Params<C[K][\"path\"]>;\n readonly query: OpQuery<C[K]>;\n readonly body: OpBody<C[K]>;\n readonly output: C[K] extends {\n response: infer R extends StandardSchemaV1;\n } ? InferOutput<R> : H[K] extends AnyFn ? OutputOf<H[K]> : unknown;\n };\n };\n};",
|
|
4751
|
+
"signature": "export type RegistryFromImpl<C extends ContractShape, H extends HandlersFor<C>> = {\n [P in C[keyof C][\"path\"]]: {\n [K in keyof C as C[K][\"path\"] extends P ? C[K][\"method\"] : never]: {\n readonly params: Params<C[K][\"path\"]>;\n readonly query: OpQuery<C[K]>;\n readonly body: OpBody<C[K]>;\n readonly output: C[K] extends {\n response: infer R extends StandardSchemaV1;\n } ? InferOutput<R> : H[K] extends AnyFn ? OutputOf<H[K]> : unknown;\n readonly errors: OpErrors<C[K]>;\n };\n };\n};",
|
|
4160
4752
|
"doc": "/**\n * The registry produced by `implement`: input from the contract op; `output` is the declared `response`\n * contract when present (it wins — exactly as in the inline path), else the bound HANDLER's return — so\n * the implemented server stays route-for-route identical to the equivalent inline server (the\n * mode-conformance guarantee), and a contract-typed client and a `typeof app`-typed client agree.\n */"
|
|
4161
4753
|
},
|
|
4162
4754
|
{
|
|
@@ -4171,7 +4763,21 @@
|
|
|
4171
4763
|
"kind": "interface",
|
|
4172
4764
|
"package": "@nifrajs/web",
|
|
4173
4765
|
"signature": "export interface RenderAdapter {\n /**\n * Server: render a route's layout `chain` (outermost layout → page) to a **stream** of HTML\n * bytes, including the framework's hydration markers. The page (innermost) receives `props`\n * (the loader data); each layout wraps the child via its `children`. Returns (or resolves to)\n * a Web `ReadableStream<Uint8Array>`: a streaming renderer flushes the shell first and streams\n * Suspense boundaries as they resolve; a non-streaming renderer may return a one-chunk stream.\n * May be async — e.g. React resolves once the shell is renderable, so a shell-render throw can\n * still map to an error status before any byte is sent.\n */\n renderToStream(chain: readonly unknown[], props: RenderProps): ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;\n /**\n * Server (optional): render the chain to a complete HTML **string** in one pass, with the same\n * hydration markers `renderToStream` produces. When provided, `renderPage` uses it for any page\n * that does **not** `defer()` — buffering the document is faster than the streaming pipeline there,\n * because the framework's synchronous renderer (React `renderToString`, Solid `renderToString`,\n * Preact `render`, Vue `renderToString`, Svelte `render`) is markedly cheaper than its streaming\n * renderer — most visibly on Bun, where React Fizz / Solid `renderToStream` are the heaviest. Pages\n * that `defer()` keep the streaming path (progressive `<Await>` needs it). Markup MUST be\n * hydration-equivalent to `renderToStream`; a throw surfaces like the streaming shell-readiness\n * await (the `_error` boundary maps it to a status). Omit it to always stream.\n */\n renderToString?(chain: readonly unknown[], props: RenderProps): string | Promise<string>;\n /**\n * Server: per-document bootstrap markup injected into `<head>` that the client\n * `hydrate` requires (Solid: `generateHydrationScript()`). Empty string if none.\n */\n hydrationHead(): string;\n}",
|
|
4174
|
-
"doc": "
|
|
4766
|
+
"doc": "/**\n * The seam every render adapter implements. New adapters should prove these invariants with\n * {@link assertRenderAdapterConformance}; framework-specific behavior remains locally tested.\n */"
|
|
4767
|
+
},
|
|
4768
|
+
{
|
|
4769
|
+
"name": "RenderAdapterConformanceError",
|
|
4770
|
+
"kind": "class",
|
|
4771
|
+
"package": "@nifrajs/web",
|
|
4772
|
+
"signature": "export declare class RenderAdapterConformanceError extends Error {\n readonly check: string;\n constructor(check: string, message: string, cause?: unknown);\n}",
|
|
4773
|
+
"doc": "/** A failed invariant reported by {@link assertRenderAdapterConformance}. */"
|
|
4774
|
+
},
|
|
4775
|
+
{
|
|
4776
|
+
"name": "RenderAdapterConformanceFixture",
|
|
4777
|
+
"kind": "interface",
|
|
4778
|
+
"package": "@nifrajs/web",
|
|
4779
|
+
"signature": "export interface RenderAdapterConformanceFixture {\n /** A page that renders the `page`, `data`, and `pending` markers from the supplied props. */\n readonly page: unknown;\n /** The outer layout, which renders `markers.outer` before its child. */\n readonly outerLayout: unknown;\n /** The inner layout, which renders `markers.inner` before its child. */\n readonly innerLayout: unknown;\n /** Props passed to the page. Use values represented by the `data` and `pending` markers. */\n readonly props: RenderProps;\n /**\n * Set when the fixture renders **deferred/streaming-only** content (e.g. Suspense that resolves during\n * the stream). Streaming and buffered (`renderToString`) output then legitimately differ byte-for-byte,\n * so the hydration-equivalence check is relaxed to \"buffered output still contains every marker\" instead\n * of exact equality. Leave unset for plain synchronous content (the stricter, preferred check).\n */\n readonly deferred?: boolean;\n /** Unique text fragments observable in the rendered HTML. */\n readonly markers: {\n readonly page: string;\n readonly data: string;\n readonly pending: string;\n readonly outer: string;\n readonly inner: string;\n };\n}",
|
|
4780
|
+
"doc": "/** Framework-specific values that let the shared conformance module exercise a render adapter. */"
|
|
4175
4781
|
},
|
|
4176
4782
|
{
|
|
4177
4783
|
"name": "renderDevErrorOverlay",
|
|
@@ -4422,6 +5028,13 @@
|
|
|
4422
5028
|
"signature": "export declare function resolvePlugins(field: PluginsField | undefined): Promise<unknown[]>;",
|
|
4423
5029
|
"doc": "/** Normalize a {@link PluginsField} (array | thunk | undefined) to a fresh array, awaiting a thunk. */"
|
|
4424
5030
|
},
|
|
5031
|
+
{
|
|
5032
|
+
"name": "resolveProjectDir",
|
|
5033
|
+
"kind": "function",
|
|
5034
|
+
"package": "@nifrajs/cli",
|
|
5035
|
+
"signature": "export declare function resolveProjectDir(root: string, dir: string | undefined): string | null;",
|
|
5036
|
+
"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 */"
|
|
5037
|
+
},
|
|
4425
5038
|
{
|
|
4426
5039
|
"name": "resolveServerOnlyChains",
|
|
4427
5040
|
"kind": "function",
|
|
@@ -4480,8 +5093,14 @@
|
|
|
4480
5093
|
"name": "Result",
|
|
4481
5094
|
"kind": "type",
|
|
4482
5095
|
"package": "@nifrajs/client",
|
|
4483
|
-
"signature": "export type Result<Data> = {\n readonly ok: true;\n readonly status: number;\n readonly data: Data;\n readonly error: null;\n} | {\n readonly ok: false;\n readonly status: number;\n readonly data:
|
|
4484
|
-
"doc": "/**\n * The outcome of a client call. The client never throws — inspect `ok`
|
|
5096
|
+
"signature": "export type Result<Data, ErrData = unknown> = {\n readonly ok: true;\n readonly status: number;\n readonly data: Data;\n readonly error: null;\n} | {\n readonly ok: false;\n readonly status: number;\n readonly data: ErrData;\n readonly error: ApiError;\n};",
|
|
5097
|
+
"doc": "/**\n * The outcome of a client call. The client never throws — inspect `ok` to branch.\n * `data` is the parsed response body, **typed by `ok`**: on success it's the route's\n * response type; on failure it's the parsed error body, typed from the route's\n * `errors` contract (`unknown` when the route declares none, `null` on a transport\n * error with no response body). `error` is always the server's normalized\n * `{ error, issues? }` summary on failure (or a transport error), `null` on success.\n */"
|
|
5098
|
+
},
|
|
5099
|
+
{
|
|
5100
|
+
"name": "RetryPolicy",
|
|
5101
|
+
"kind": "interface",
|
|
5102
|
+
"package": "@nifrajs/jobs",
|
|
5103
|
+
"signature": "export interface RetryPolicy {\n /** Total attempts before dead-lettering (incl. the first). Default 3. `1` = no retries. */\n readonly attempts: number;\n /** Delay before each retry. Default {@link exponentialBackoff}. */\n readonly backoff?: Backoff;\n}"
|
|
4485
5104
|
},
|
|
4486
5105
|
{
|
|
4487
5106
|
"name": "revalidate",
|
|
@@ -4543,6 +5162,13 @@
|
|
|
4543
5162
|
"signature": "export declare const ROUTE_GLOBAL = \"__NIFRA_ROUTE__\";",
|
|
4544
5163
|
"doc": "/** Global the server writes the matched route id into; the client uses it to pick the chain. */"
|
|
4545
5164
|
},
|
|
5165
|
+
{
|
|
5166
|
+
"name": "RouteBody",
|
|
5167
|
+
"kind": "type",
|
|
5168
|
+
"package": "@nifrajs/web",
|
|
5169
|
+
"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;",
|
|
5170
|
+
"doc": "/** The body object type of `App`'s `Method Path` route (`never` when the route declares no body). */"
|
|
5171
|
+
},
|
|
4546
5172
|
{
|
|
4547
5173
|
"name": "RouteConfigError",
|
|
4548
5174
|
"kind": "class",
|
|
@@ -4561,7 +5187,7 @@
|
|
|
4561
5187
|
"name": "RouteDescriptor",
|
|
4562
5188
|
"kind": "interface",
|
|
4563
5189
|
"package": "@nifrajs/core",
|
|
4564
|
-
"signature": "export interface RouteDescriptor {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n}",
|
|
5190
|
+
"signature": "export interface RouteDescriptor {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}",
|
|
4565
5191
|
"doc": "/**\n * A registered route's public descriptor — method, path, and input schemas. The\n * router trie discards the original patterns, so this flat list is what lets tools\n * (e.g. `toOpenAPI`) enumerate routes after registration.\n */"
|
|
4566
5192
|
},
|
|
4567
5193
|
{
|
|
@@ -4575,14 +5201,14 @@
|
|
|
4575
5201
|
"name": "RouteInfo",
|
|
4576
5202
|
"kind": "interface",
|
|
4577
5203
|
"package": "@nifrajs/core",
|
|
4578
|
-
"signature": "export interface RouteInfo {\n readonly params: object;\n readonly query: unknown;\n readonly body: unknown;\n readonly output: unknown;\n}",
|
|
5204
|
+
"signature": "export interface RouteInfo {\n readonly params: object;\n readonly query: unknown;\n readonly body: unknown;\n readonly output: unknown;\n /** Union of the route's declared error-response body types (from `schema.errors`); `unknown` when the\n * route declares none. Surfaced by the typed client as the failure `errorData`. */\n readonly errors?: unknown;\n}",
|
|
4579
5205
|
"doc": "/**\n * One route's input/output shape as the **client** will consume it. `query`/`body`\n * are `never` when the route declares no schema for them, so the client can detect\n * \"this route takes no body\" via `[body] extends [never]`. `output` is the\n * handler's raw return type (the client applies `Jsonify` when reading it).\n */"
|
|
4580
5206
|
},
|
|
4581
5207
|
{
|
|
4582
5208
|
"name": "RouteInfoFor",
|
|
4583
5209
|
"kind": "type",
|
|
4584
5210
|
"package": "@nifrajs/core",
|
|
4585
|
-
"signature": "export type RouteInfoFor<Path extends string, S extends RouteSchema, Output> = {\n readonly params: Params<Path>;\n readonly query: RegistryQuery<S>;\n readonly body: RegistryBody<S>;\n readonly output: RegistryOutput<S, Output>;\n};",
|
|
5211
|
+
"signature": "export type RouteInfoFor<Path extends string, S extends RouteSchema, Output> = {\n readonly params: Params<Path>;\n readonly query: RegistryQuery<S>;\n readonly body: RegistryBody<S>;\n readonly output: RegistryOutput<S, Output>;\n readonly errors: RegistryErrors<S>;\n};",
|
|
4586
5212
|
"doc": "/** Build a {@link RouteInfo} from a route's path, schema, and handler output type. */"
|
|
4587
5213
|
},
|
|
4588
5214
|
{
|
|
@@ -4627,6 +5253,13 @@
|
|
|
4627
5253
|
"signature": "export interface RouteModule {\n readonly default: unknown;\n readonly loader?: Loader;\n readonly action?: Action;\n readonly meta?: MetaInput;\n /**\n * Opt this route out of nifra's full-document client hydration. The server still renders the full\n * HTML document, loaders/actions still run, and native links/forms still work; the generated app\n * client, route chunks, and loader globals are omitted for hard navigations. Intended for static or\n * island-hydrated pages where interactivity is mounted by smaller, explicit client entries.\n */\n readonly hydrate?: boolean;\n /**\n * Opt a **static** route (no `:param`/`*`) into build-time prerendering (SSG): `prerenderRoutes`\n * (from `@nifrajs/web/build`) renders it to a static `index.html` at build. The loader runs at build\n * with the in-process `api` (build-safe data only — no per-request cookies/secrets); `defer()` on a\n * prerendered route resolves at build. For **dynamic** routes use {@link getStaticPaths} instead.\n */\n readonly prerender?: boolean;\n /**\n * Enumerate the concrete params to prerender for a **dynamic** (`:param`) route — the SSG path list\n * (blogs/docs/etc.). Runs at build; `prerenderRoutes` renders one `index.html` per returned path.\n */\n readonly getStaticPaths?: GetStaticPaths;\n /**\n * ISR freshness for this route, in **seconds**. `createWebApp` emits it as an `x-nifra-revalidate`\n * response header that `withISR` reads to set the page's cache TTL (overriding the wrapper's\n * default). Older-than-`revalidate` cached pages are served stale while regenerating.\n */\n readonly revalidate?: number;\n /**\n * No-framework island bundles (`@nifrajs/web/islands`) to load on this route, as `<script\n * type=\"module\">` in the document tail. Loaded **regardless of `hydrate`** — pair with\n * `export const hydrate = false` for a static page that ships zero framework JS and mounts\n * interactivity through `<Island>` markers + `mountIslands` enhancers instead.\n */\n readonly islandScripts?: readonly string[];\n}",
|
|
4628
5254
|
"doc": "/** A route module — the default component + optional loader / action / meta. */"
|
|
4629
5255
|
},
|
|
5256
|
+
{
|
|
5257
|
+
"name": "RoutePaths",
|
|
5258
|
+
"kind": "type",
|
|
5259
|
+
"package": "@nifrajs/web",
|
|
5260
|
+
"signature": "export type RoutePaths<App> = keyof RegistryOf<App> & string;",
|
|
5261
|
+
"doc": "/** Every route path the app declares — constrains `Path`, so a wrong path is itself a type error. */"
|
|
5262
|
+
},
|
|
4630
5263
|
{
|
|
4631
5264
|
"name": "routePathToFile",
|
|
4632
5265
|
"kind": "function",
|
|
@@ -4666,7 +5299,7 @@
|
|
|
4666
5299
|
"name": "RouteSchema",
|
|
4667
5300
|
"kind": "interface",
|
|
4668
5301
|
"package": "@nifrajs/core",
|
|
4669
|
-
"signature": "export interface RouteSchema {\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n /** Optional **response contract**. When declared: the handler's return is type-checked against it\n * (the implementation can't drift from the contract), the typed client sees THIS as the response type\n * (the contract — not the handler's incidental return), and it's emitted into OpenAPI/JSON-Schema so\n * tooling and coding agents can read the exact shape. It is **not** validated at runtime (zero\n * hot-path cost) — purely a compile-time + introspection contract. */\n readonly response?: StandardSchemaV1;\n}",
|
|
5302
|
+
"signature": "export interface RouteSchema {\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n /** Optional **response contract**. When declared: the handler's return is type-checked against it\n * (the implementation can't drift from the contract), the typed client sees THIS as the response type\n * (the contract — not the handler's incidental return), and it's emitted into OpenAPI/JSON-Schema so\n * tooling and coding agents can read the exact shape. It is **not** validated at runtime (zero\n * hot-path cost) — purely a compile-time + introspection contract. */\n readonly response?: StandardSchemaV1;\n /**\n * Optional **error-response contract**: a map of HTTP status code → the Standard Schema of that error's\n * body. Declares a route's failure modes so they flow into OpenAPI (as non-2xx `responses`), the\n * `/llms.txt` context, and other introspection — the whole contract, not just the happy path, is legible\n * to tooling and coding agents. Like `response`, it is **not** validated at runtime (zero hot-path cost);\n * it's a compile-time + introspection contract. Example: `{ 404: NotFound, 409: Conflict }`. */\n readonly errors?: Readonly<Record<number, StandardSchemaV1>>;\n /**\n * Hook fired when the request fails `body`/`query` validation, before the handler runs. `kind` says\n * which input failed (`\"body\"` | `\"query\"`). Its return value selects one of three outcomes (may be async):\n * - a **`Response`** → returned as-is, short-circuiting the route (custom error envelope, redirect, …).\n * - **any other value** → treated as a repaired payload and **re-validated once** against the same\n * schema. If it now passes, the handler runs with it; if it still fails, the original `422` stands.\n * Re-validation means a bad return can't bypass the schema — the trust boundary holds.\n * - **`undefined`** → give up; the original validation `422` is returned unchanged.\n * A route hook **overrides** the app-wide default set via `server({ onValidationError })`; return\n * `undefined` to fall through to the plain `422` even when an app default exists. Typical uses: a custom\n * error envelope, coercing the input, or prompting an LLM to repair the payload (re-validated, so it can't\n * bypass the schema).\n */\n readonly onValidationError?: (issues: ReadonlyArray<StandardIssue>, ctx: Context, kind: \"body\" | \"query\") => Response | unknown | Promise<Response | unknown>;\n}",
|
|
4670
5303
|
"doc": "/** Per-route input schemas. Each is any Standard Schema (zod/valibot/arktype/…). */"
|
|
4671
5304
|
},
|
|
4672
5305
|
{
|
|
@@ -4687,7 +5320,7 @@
|
|
|
4687
5320
|
"name": "RouteTableInput",
|
|
4688
5321
|
"kind": "interface",
|
|
4689
5322
|
"package": "@nifrajs/cli",
|
|
4690
|
-
"signature": "export interface RouteTableInput {\n readonly pages: readonly PageRouteInput[];\n readonly api:
|
|
5323
|
+
"signature": "export interface RouteTableInput {\n readonly pages: readonly PageRouteInput[];\n readonly api: ReadonlyArray<Pick<ReflectedRoute, \"method\" | \"path\">>;\n /** The page router's `apiPrefix` (default `/api`); an API route at/under it is auto-mounted. `\"\"`\n * disables the auto-mount, so no API route is marked auto-mounted. */\n readonly apiPrefix?: string;\n}"
|
|
4691
5324
|
},
|
|
4692
5325
|
{
|
|
4693
5326
|
"name": "routeTableToJson",
|
|
@@ -4956,6 +5589,13 @@
|
|
|
4956
5589
|
"package": "@nifrajs/cron",
|
|
4957
5590
|
"signature": "export interface SchedulerOptions {\n /** Called when a job handler throws/rejects. Default: `console.error`. A throwing onError is swallowed. */\n readonly onError?: (error: unknown, jobName: string) => void;\n /** Injectable clock (tests). Default `() => new Date()`. */\n readonly now?: () => Date;\n}"
|
|
4958
5591
|
},
|
|
5592
|
+
{
|
|
5593
|
+
"name": "SchemaReflection",
|
|
5594
|
+
"kind": "interface",
|
|
5595
|
+
"package": "@nifrajs/core",
|
|
5596
|
+
"signature": "export interface SchemaReflection {\n /** The Standard Schema validator, when the value implements Standard Schema v1. */\n readonly standard: StandardSchemaV1 | undefined;\n /** Raw JSON Schema metadata, when the value exposes it or is itself a raw JSON Schema. */\n readonly jsonSchema: JsonSchema | undefined;\n /** Top-level object fields, or `undefined` when the JSON Schema is absent/non-object. */\n readonly fields: readonly ReflectedSchemaField[] | undefined;\n}",
|
|
5597
|
+
"doc": "/** Validation and introspection capabilities discovered for one schema-like value. */"
|
|
5598
|
+
},
|
|
4959
5599
|
{
|
|
4960
5600
|
"name": "ScoredExample",
|
|
4961
5601
|
"kind": "interface",
|
|
@@ -5112,7 +5752,7 @@
|
|
|
5112
5752
|
"name": "Server",
|
|
5113
5753
|
"kind": "class",
|
|
5114
5754
|
"package": "@nifrajs/core",
|
|
5115
|
-
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly router;\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 routeList;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n private readonly gracefulSignals;\n private readonly logger;\n private bunServer;\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 responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\n constructor(options?: ServerOptions);\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) => 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 /**\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 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 * 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 * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined>(path: string, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema>): this;\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 /**\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 /**\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>>): 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 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 * ({@link RouteEntry.bare}), 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 /** 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 for a {@link RouteEntry.bare} route: 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 lane (see {@link RouteEntry.fusedWeb}). 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 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 /** 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 /**\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 /**\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 listen(port: number, options?: {\n readonly reusePort?: boolean;\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}",
|
|
5755
|
+
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly router;\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 routeList;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n private readonly gracefulSignals;\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 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 responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\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 /** 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) => 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 /**\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 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 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 * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined>(path: string, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema>): this;\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 /**\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 /**\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>>): 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 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 * ({@link RouteEntry.bare}), 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 /** 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 for a {@link RouteEntry.bare} route: 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 lane (see {@link RouteEntry.fusedWeb}). 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 /** 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 /**\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 /**\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 listen(port: number, options?: {\n readonly reusePort?: boolean;\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}",
|
|
5116
5756
|
"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 */"
|
|
5117
5757
|
},
|
|
5118
5758
|
{
|
|
@@ -5160,7 +5800,7 @@
|
|
|
5160
5800
|
"name": "ServerOptions",
|
|
5161
5801
|
"kind": "interface",
|
|
5162
5802
|
"package": "@nifrajs/core",
|
|
5163
|
-
"signature": "export interface ServerOptions {\n /**\n * Max request body size (bytes), enforced **only when a route declares a body schema** — the cap\n * lives in the schema-validated read path. Default 1_000_000.\n *\n * A route WITHOUT a body schema (raw body, file upload, BYO-validation) that reads `c.req` directly\n * is not auto-bounded — use **`c.boundedBody(maxBytes?)`** / **`c.boundedJson(maxBytes?)`**, which\n * apply this same cap (override per route by passing `maxBytes` — larger for an upload endpoint,\n * smaller to tighten one).\n */\n readonly maxBodyBytes?: number;\n /** Max inbound WebSocket message size (bytes) when `listen()`ing on Bun — frames over this are rejected\n * by the runtime before reaching your handler (so a huge frame can't be JSON-parsed into memory).\n * Default: `maxBodyBytes` (1 MB). */\n readonly wsMaxPayloadBytes?: number;\n /** Per-request timeout (ms): a slower request gets a 503 and `ctx.signal` aborts. 0 disables (default). */\n readonly requestTimeoutMs?: number;\n /** When `listen()`ing, install SIGTERM/SIGINT handlers that gracefully `stop()`. Default false. */\n readonly gracefulSignals?: boolean;\n /** Structured logger for framework events (redacts secrets). Default: JSON to stderr. */\n readonly logger?: Logger;\n}"
|
|
5803
|
+
"signature": "export interface ServerOptions {\n /**\n * Max request body size (bytes), enforced **only when a route declares a body schema** — the cap\n * lives in the schema-validated read path. Default 1_000_000.\n *\n * A route WITHOUT a body schema (raw body, file upload, BYO-validation) that reads `c.req` directly\n * is not auto-bounded — use **`c.boundedBody(maxBytes?)`** / **`c.boundedJson(maxBytes?)`**, which\n * apply this same cap (override per route by passing `maxBytes` — larger for an upload endpoint,\n * smaller to tighten one).\n */\n readonly maxBodyBytes?: number;\n /** Max inbound WebSocket message size (bytes) when `listen()`ing on Bun — frames over this are rejected\n * by the runtime before reaching your handler (so a huge frame can't be JSON-parsed into memory).\n * Default: `maxBodyBytes` (1 MB). */\n readonly wsMaxPayloadBytes?: number;\n /** Per-request timeout (ms): a slower request gets a 503 and `ctx.signal` aborts. 0 disables (default). */\n readonly requestTimeoutMs?: number;\n /** When `listen()`ing, install SIGTERM/SIGINT handlers that gracefully `stop()`. Default false. */\n readonly gracefulSignals?: boolean;\n /** Structured logger for framework events (redacts secrets). Default: JSON to stderr. */\n readonly logger?: Logger;\n /**\n * App-wide fallback fired when a route **without its own `onValidationError`** fails body/query\n * validation. Same contract as the per-route hook (`(issues, ctx, kind) => Response | repaired-value |\n * undefined`): a route's own hook takes precedence, and a route can fall through to the plain `422` by\n * returning `undefined`. Use it for one app-wide error envelope (like tRPC's `errorFormatter` /\n * Fastify's `setErrorHandler`) instead of repeating a formatter per route.\n */\n readonly onValidationError?: RouteSchema[\"onValidationError\"];\n}"
|
|
5164
5804
|
},
|
|
5165
5805
|
{
|
|
5166
5806
|
"name": "ServeStaticOptions",
|
|
@@ -5258,6 +5898,12 @@
|
|
|
5258
5898
|
"signature": "export declare function setMountedRouter(router: ClientRouter | undefined): void;",
|
|
5259
5899
|
"doc": "/** Register (or clear) the router that owns fetchers — called by `mountRouter`. Not for app use. */"
|
|
5260
5900
|
},
|
|
5901
|
+
{
|
|
5902
|
+
"name": "SetOptions",
|
|
5903
|
+
"kind": "interface",
|
|
5904
|
+
"package": "@nifrajs/cache",
|
|
5905
|
+
"signature": "export interface SetOptions {\n /** Time-to-live (ms) before the value goes stale. Default: the cache's `defaultTtlMs`. */\n readonly ttlMs?: number;\n /** Extra ms past TTL during which the stale value is served while a background refresh runs. Default 0. */\n readonly swrMs?: number;\n /** Tags for group invalidation via `invalidateTag`. */\n readonly tags?: readonly string[];\n}"
|
|
5906
|
+
},
|
|
5261
5907
|
{
|
|
5262
5908
|
"name": "setWsRuntime",
|
|
5263
5909
|
"kind": "function",
|
|
@@ -5423,17 +6069,17 @@
|
|
|
5423
6069
|
},
|
|
5424
6070
|
{
|
|
5425
6071
|
"name": "SpanExporter",
|
|
5426
|
-
"kind": "
|
|
6072
|
+
"kind": "type",
|
|
5427
6073
|
"package": "@nifrajs/otel",
|
|
5428
|
-
"signature": "export
|
|
5429
|
-
"doc": "
|
|
6074
|
+
"signature": "export type SpanExporter = ObservationAdapter;",
|
|
6075
|
+
"doc": "/** Backwards-compatible name for an observation sink. */"
|
|
5430
6076
|
},
|
|
5431
6077
|
{
|
|
5432
6078
|
"name": "SpanStatus",
|
|
5433
6079
|
"kind": "type",
|
|
5434
6080
|
"package": "@nifrajs/otel",
|
|
5435
6081
|
"signature": "export type SpanStatus = \"unset\" | \"ok\" | \"error\";",
|
|
5436
|
-
"doc": "/**\n * The span model + exporter seam. Attribute names follow OpenTelemetry HTTP semantic conventions\n * (`http.request.method`, `url.path`, `http.response.status_code`, …) so a span maps cleanly onto an\n * OTel `Span` when bridged — but nothing here depends on the OTel SDK. You supply
|
|
6082
|
+
"doc": "/**\n * The span model + exporter seam. Attribute names follow OpenTelemetry HTTP semantic conventions\n * (`http.request.method`, `url.path`, `http.response.status_code`, …) so a span maps cleanly onto an\n * OTel `Span` when bridged — but nothing here depends on the OTel SDK. You supply an\n * {@link ObservationAdapter}\n * (a ~10-line adapter to `@opentelemetry/api`, or the bundled {@link consoleSpanExporter}).\n */"
|
|
5437
6083
|
},
|
|
5438
6084
|
{
|
|
5439
6085
|
"name": "splitSections",
|
|
@@ -5512,6 +6158,13 @@
|
|
|
5512
6158
|
"package": "@nifrajs/env",
|
|
5513
6159
|
"signature": "export type StandardResult<Output> = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: ReadonlyArray<StandardIssue>;\n};"
|
|
5514
6160
|
},
|
|
6161
|
+
{
|
|
6162
|
+
"name": "StandardResult",
|
|
6163
|
+
"kind": "type",
|
|
6164
|
+
"package": "@nifrajs/jobs",
|
|
6165
|
+
"signature": "export type StandardResult<Output> = {\n readonly value: Output;\n readonly issues?: undefined;\n} | {\n readonly issues: ReadonlyArray<{\n readonly message: string;\n }>;\n};",
|
|
6166
|
+
"doc": "/** The validate-result half of the Standard Schema spec. */"
|
|
6167
|
+
},
|
|
5515
6168
|
{
|
|
5516
6169
|
"name": "StandardSchemaProps",
|
|
5517
6170
|
"kind": "interface",
|
|
@@ -5531,6 +6184,13 @@
|
|
|
5531
6184
|
"package": "@nifrajs/env",
|
|
5532
6185
|
"signature": "export interface StandardSchemaV1<Output = unknown> {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardResult<Output> | Promise<StandardResult<Output>>;\n readonly types?: {\n readonly output: Output;\n };\n };\n}"
|
|
5533
6186
|
},
|
|
6187
|
+
{
|
|
6188
|
+
"name": "StandardSchemaV1",
|
|
6189
|
+
"kind": "interface",
|
|
6190
|
+
"package": "@nifrajs/jobs",
|
|
6191
|
+
"signature": "export interface StandardSchemaV1<Output = unknown> {\n readonly \"~standard\": {\n readonly version: 1;\n readonly vendor: string;\n readonly validate: (value: unknown) => StandardResult<Output> | Promise<StandardResult<Output>>;\n readonly types?: {\n readonly input: unknown;\n readonly output: Output;\n };\n };\n}",
|
|
6192
|
+
"doc": "/** A minimal structural view of a Standard Schema validator (v1). `t.object(...)` satisfies it. */"
|
|
6193
|
+
},
|
|
5534
6194
|
{
|
|
5535
6195
|
"name": "StandardSuccess",
|
|
5536
6196
|
"kind": "interface",
|
|
@@ -5550,6 +6210,12 @@
|
|
|
5550
6210
|
"signature": "export interface StandardWebSocket {\n send(data: string | ArrayBufferView | ArrayBuffer): void;\n close(code?: number, reason?: string): void;\n readonly readyState: number;\n binaryType?: string;\n addEventListener(type: string, listener: (event: never) => void): void;\n}",
|
|
5551
6211
|
"doc": "/**\n * A standard server-side `WebSocket` — the half returned by Deno's `Deno.upgradeWebSocket` and the\n * Workers `WebSocketPair`. {@link attachWebSocket} wires one to a nifra handler, so the Deno and Workers\n * bridges share all the dispatch/normalization/error-isolation logic (only the upgrade call differs).\n */"
|
|
5552
6212
|
},
|
|
6213
|
+
{
|
|
6214
|
+
"name": "StartObservation",
|
|
6215
|
+
"kind": "interface",
|
|
6216
|
+
"package": "@nifrajs/otel",
|
|
6217
|
+
"signature": "export interface StartObservation {\n readonly name: string;\n /** Explicit parent. `null` forces a root span; `undefined` falls back to `traceparent`. */\n readonly parent?: ObservationParent | null;\n /** Inbound W3C header used when `parent` is undefined. */\n readonly traceparent?: string | null;\n readonly attributes?: Readonly<Record<string, AttributeValue>>;\n}"
|
|
6218
|
+
},
|
|
5553
6219
|
{
|
|
5554
6220
|
"name": "StaticPath",
|
|
5555
6221
|
"kind": "interface",
|
|
@@ -5577,6 +6243,97 @@
|
|
|
5577
6243
|
"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}",
|
|
5578
6244
|
"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. */"
|
|
5579
6245
|
},
|
|
6246
|
+
{
|
|
6247
|
+
"name": "StorageAdapter",
|
|
6248
|
+
"kind": "interface",
|
|
6249
|
+
"package": "@nifrajs/storage",
|
|
6250
|
+
"signature": "export interface StorageAdapter {\n /** Store `data` under `key`, overwriting any existing object. */\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n /** Read the object at `key`, or `null` if it doesn't exist. */\n get(key: string): Promise<StorageObject | null>;\n /** Remove `key`. No-op if it doesn't exist. */\n delete(key: string): Promise<void>;\n /** Whether an object exists at `key`. */\n exists(key: string): Promise<boolean>;\n /** List stored keys (optionally filtered by prefix + capped). */\n list(options?: ListOptions): Promise<string[]>;\n}",
|
|
6251
|
+
"doc": "/**\n * A blob store keyed by string. Keys are POSIX-ish paths (`avatars/u1.png`); every adapter rejects unsafe\n * keys (absolute, `..` traversal, NUL, backslash) so a key valid in one adapter is valid in all. All\n * methods are async.\n */"
|
|
6252
|
+
},
|
|
6253
|
+
{
|
|
6254
|
+
"name": "StorageAdapterConformanceError",
|
|
6255
|
+
"kind": "class",
|
|
6256
|
+
"package": "@nifrajs/storage",
|
|
6257
|
+
"signature": "export declare class StorageAdapterConformanceError extends Error {\n readonly check: string;\n constructor(check: string, message: string, cause?: unknown);\n}",
|
|
6258
|
+
"doc": "/** A failed invariant reported by {@link assertStorageAdapterConformance}. */"
|
|
6259
|
+
},
|
|
6260
|
+
{
|
|
6261
|
+
"name": "StorageAdapterConformanceOptions",
|
|
6262
|
+
"kind": "interface",
|
|
6263
|
+
"package": "@nifrajs/storage",
|
|
6264
|
+
"signature": "export interface StorageAdapterConformanceOptions {\n /** Return an empty, isolated adapter for this run. */\n readonly createAdapter: () => StorageAdapter | Promise<StorageAdapter>;\n}",
|
|
6265
|
+
"doc": "/** Construction and cleanup hooks for {@link assertStorageAdapterConformance}. */"
|
|
6266
|
+
},
|
|
6267
|
+
{
|
|
6268
|
+
"name": "StorageData",
|
|
6269
|
+
"kind": "type",
|
|
6270
|
+
"package": "@nifrajs/storage",
|
|
6271
|
+
"signature": "export type StorageData = Uint8Array | ArrayBuffer | string;",
|
|
6272
|
+
"doc": "/** Accepted `put` payloads — normalized to bytes by each adapter. */"
|
|
6273
|
+
},
|
|
6274
|
+
{
|
|
6275
|
+
"name": "StorageKeyError",
|
|
6276
|
+
"kind": "class",
|
|
6277
|
+
"package": "@nifrajs/storage",
|
|
6278
|
+
"signature": "export declare class StorageKeyError extends Error {\n constructor(message: string);\n}",
|
|
6279
|
+
"doc": "/**\n * Storage-key safety. A key is a POSIX-ish relative path (`avatars/u1.png`); we reject anything that\n * could escape a `FileStorage` root or otherwise misbehave — absolute paths, `..` traversal, NUL bytes,\n * and backslashes (Windows traversal). Enforced by EVERY adapter (not just `FileStorage`) so a key is\n * portable across them, and so the check can't be forgotten on the one adapter where it's a vulnerability.\n */"
|
|
6280
|
+
},
|
|
6281
|
+
{
|
|
6282
|
+
"name": "StorageListPage",
|
|
6283
|
+
"kind": "interface",
|
|
6284
|
+
"package": "@nifrajs/storage",
|
|
6285
|
+
"signature": "export interface StorageListPage {\n readonly keys: readonly string[];\n /** Opaque cursor for the next page; absent when this is the final page. */\n readonly cursor?: string;\n}",
|
|
6286
|
+
"doc": "/** One page of keys from stores that expose cursor-based listing. */"
|
|
6287
|
+
},
|
|
6288
|
+
{
|
|
6289
|
+
"name": "StorageListPageOptions",
|
|
6290
|
+
"kind": "interface",
|
|
6291
|
+
"package": "@nifrajs/storage",
|
|
6292
|
+
"signature": "export interface StorageListPageOptions extends ListOptions {\n readonly cursor?: string;\n}",
|
|
6293
|
+
"doc": "/** Cursor-aware listing options. `cursor` is adapter-owned and must be treated as opaque. */"
|
|
6294
|
+
},
|
|
6295
|
+
{
|
|
6296
|
+
"name": "StorageObject",
|
|
6297
|
+
"kind": "interface",
|
|
6298
|
+
"package": "@nifrajs/storage",
|
|
6299
|
+
"signature": "export interface StorageObject {\n readonly body: Uint8Array;\n readonly size: number;\n readonly contentType?: string;\n readonly metadata?: Readonly<Record<string, string>>;\n}",
|
|
6300
|
+
"doc": "/** An object read back from storage. `body` is buffered (not streamed) — fine for typical uploads. */"
|
|
6301
|
+
},
|
|
6302
|
+
{
|
|
6303
|
+
"name": "StoragePresignedUrl",
|
|
6304
|
+
"kind": "interface",
|
|
6305
|
+
"package": "@nifrajs/storage",
|
|
6306
|
+
"signature": "export interface StoragePresignedUrl {\n readonly url: string;\n readonly expiresAt?: Date;\n}",
|
|
6307
|
+
"doc": "/** A provider-minted URL and its known expiry. */"
|
|
6308
|
+
},
|
|
6309
|
+
{
|
|
6310
|
+
"name": "StoragePresignOperation",
|
|
6311
|
+
"kind": "type",
|
|
6312
|
+
"package": "@nifrajs/storage",
|
|
6313
|
+
"signature": "export type StoragePresignOperation = \"get\" | \"put\";",
|
|
6314
|
+
"doc": "/** Operation represented by a presigned storage URL. */"
|
|
6315
|
+
},
|
|
6316
|
+
{
|
|
6317
|
+
"name": "StoragePresignOptions",
|
|
6318
|
+
"kind": "interface",
|
|
6319
|
+
"package": "@nifrajs/storage",
|
|
6320
|
+
"signature": "export interface StoragePresignOptions {\n readonly expiresInSeconds?: number;\n /** For PUT URLs, pin the declared MIME type. */\n readonly contentType?: string;\n /** For PUT URLs, pin the exact request-body size. */\n readonly contentLength?: number;\n}",
|
|
6321
|
+
"doc": "/** Mechanical constraints applied while minting a presigned URL. */"
|
|
6322
|
+
},
|
|
6323
|
+
{
|
|
6324
|
+
"name": "StoredEntry",
|
|
6325
|
+
"kind": "interface",
|
|
6326
|
+
"package": "@nifrajs/cache",
|
|
6327
|
+
"signature": "export interface StoredEntry {\n readonly value: unknown;\n /** Epoch-ms after which the entry is gone — a miss. */\n readonly expiresAt: number;\n /** Epoch-ms after which the entry is stale: still served during the SWR window while a refresh runs.\n * Equal to `expiresAt` when there's no stale-while-revalidate window. */\n readonly staleAt: number;\n}",
|
|
6328
|
+
"doc": "/** A cached entry as the store holds it. */"
|
|
6329
|
+
},
|
|
6330
|
+
{
|
|
6331
|
+
"name": "StoredJob",
|
|
6332
|
+
"kind": "interface",
|
|
6333
|
+
"package": "@nifrajs/jobs",
|
|
6334
|
+
"signature": "export interface StoredJob {\n readonly id: string;\n readonly name: string;\n readonly payload: unknown;\n readonly attempt: number;\n readonly maxAttempts: number;\n}",
|
|
6335
|
+
"doc": "/** A job as handed back by {@link JobStore.lease}. `attempt` is the count of PRIOR attempts (0 the first time). */"
|
|
6336
|
+
},
|
|
5580
6337
|
{
|
|
5581
6338
|
"name": "string",
|
|
5582
6339
|
"kind": "function",
|
|
@@ -5656,7 +6413,7 @@
|
|
|
5656
6413
|
"name": "t",
|
|
5657
6414
|
"kind": "const",
|
|
5658
6415
|
"package": "@nifrajs/schema",
|
|
5659
|
-
"signature": "export declare const t: {\n readonly string: (options?: StringOptions) => NifraSchema<import(\"@sinclair/typebox\").TString>;\n readonly number: (options?: NumberOptions) => NifraSchema<import(\"@sinclair/typebox\").TNumber>;\n readonly integer: (options?: IntegerOptions) => NifraSchema<import(\"@sinclair/typebox\").TInteger>;\n readonly boolean: () => NifraSchema<import(\"@sinclair/typebox\").TBoolean>;\n readonly null: () => NifraSchema<import(\"@sinclair/typebox\").TNull>;\n readonly literal: <const L extends TLiteralValue>(value: L) => NifraSchema<import(\"@sinclair/typebox\").TLiteral<L>>;\n readonly object: <P extends Props>(props: P, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TObject<{ [K in keyof P]: P[K][\"jsonSchema\"]; }>>;\n /** Like `t.object` but ACCEPTS (and passes through) unknown fields — the explicit opt-out of the\n * strict default. Prefer `t.object` unless you genuinely need an open object. */\n readonly looseObject: <P extends Props>(props: P, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TObject<{ [K in keyof P]: P[K][\"jsonSchema\"]; }>>;\n readonly array: <T extends TSchema>(item: NifraSchema<T>, options?: ArrayOptions) => NifraSchema<import(\"@sinclair/typebox\").TArray<T>>;\n /** Marks a property optional inside `t.object`; standalone it is `T | undefined`. */\n readonly optional: <T extends TSchema>(schema: NifraSchema<T>) => NifraSchema<T extends import(\"@sinclair/typebox\").TOptional<infer S extends TSchema> ? import(\"@sinclair/typebox\").TOptional<S> : import(\"@sinclair/typebox\").Ensure<import(\"@sinclair/typebox\").TOptional<T>>>;\n readonly union: <const S extends readonly NifraSchema[]>(schemas: S) => NifraSchema<TUnion<{ -readonly [K in keyof S]: S[K][\"jsonSchema\"]; }>>;\n readonly record: <T extends TSchema>(value: NifraSchema<T>, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TRecord<import(\"@sinclair/typebox\").TString, T>>;\n};",
|
|
6416
|
+
"signature": "export declare const t: {\n readonly string: (options?: StringOptions) => NifraSchema<import(\"@sinclair/typebox\").TString>;\n readonly number: (options?: NumberOptions) => NifraSchema<import(\"@sinclair/typebox\").TNumber>;\n readonly integer: (options?: IntegerOptions) => NifraSchema<import(\"@sinclair/typebox\").TInteger>;\n readonly boolean: () => NifraSchema<import(\"@sinclair/typebox\").TBoolean>;\n readonly null: () => NifraSchema<import(\"@sinclair/typebox\").TNull>;\n readonly literal: <const L extends TLiteralValue>(value: L) => NifraSchema<import(\"@sinclair/typebox\").TLiteral<L>>;\n readonly object: <P extends Props>(props: P, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TObject<{ [K in keyof P]: P[K][\"jsonSchema\"]; }>>;\n /** Like `t.object` but ACCEPTS (and passes through) unknown fields — the explicit opt-out of the\n * strict default. Prefer `t.object` unless you genuinely need an open object. */\n readonly looseObject: <P extends Props>(props: P, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TObject<{ [K in keyof P]: P[K][\"jsonSchema\"]; }>>;\n readonly array: <T extends TSchema>(item: NifraSchema<T>, options?: ArrayOptions) => NifraSchema<import(\"@sinclair/typebox\").TArray<T>>;\n /** Marks a property optional inside `t.object`; standalone it is `T | undefined`. */\n readonly optional: <T extends TSchema>(schema: NifraSchema<T>) => NifraSchema<T extends import(\"@sinclair/typebox\").TOptional<infer S extends TSchema> ? import(\"@sinclair/typebox\").TOptional<S> : import(\"@sinclair/typebox\").Ensure<import(\"@sinclair/typebox\").TOptional<T>>>;\n readonly union: <const S extends readonly NifraSchema[]>(schemas: S) => NifraSchema<TUnion<{ -readonly [K in keyof S]: S[K][\"jsonSchema\"]; }>>;\n readonly record: <T extends TSchema>(value: NifraSchema<T>, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TRecord<import(\"@sinclair/typebox\").TString, T>>;\n /** A cursor-pagination response envelope: `{ items: T[]; nextCursor: string | null }` (`null` = last page). */\n readonly paginated: <T extends TSchema>(item: NifraSchema<T>, options?: ObjectOptions) => NifraSchema<import(\"@sinclair/typebox\").TObject<{\n items: import(\"@sinclair/typebox\").TArray<T>;\n nextCursor: TUnion<[import(\"@sinclair/typebox\").TString, import(\"@sinclair/typebox\").TNull]>;\n }>>;\n /** A request query schema for cursor pagination: `{ cursor?: string; limit?: number }`. `maxLimit`\n * caps `limit` — a larger value fails validation (a 422), so a client can't request an unbounded page.\n * `coerce` is on because query values arrive as strings (`?limit=20` → `\"20\"`); it's what makes `limit`\n * a real `number` in the handler (`c.query.limit`), not a string. */\n readonly pageQuery: (options?: {\n maxLimit?: number;\n }) => NifraSchema<import(\"@sinclair/typebox\").TObject<{\n cursor: import(\"@sinclair/typebox\").TOptional<import(\"@sinclair/typebox\").TString>;\n limit: import(\"@sinclair/typebox\").TOptional<import(\"@sinclair/typebox\").TInteger>;\n }>>;\n};",
|
|
5660
6417
|
"doc": "/**\n * The built-in schema builder. Each constructor returns a `NifraSchema` — a\n * Standard Schema whose validated output type flows into `c.body`/`c.query`, and\n * whose `jsonSchema` powers `toOpenAPI`. Options (min/max, length, pattern, …)\n * pass straight through to TypeBox and so become JSON Schema constraints.\n *\n * Composite constructors are generic over the *inner* TypeBox schema `T extends\n * TSchema` (not over `NifraSchema`): reading `.jsonSchema` off a value typed only as\n * `NifraSchema` would erase to the `TSchema` constraint and collapse the output type\n * to `unknown`. Capturing `T` keeps `Static<T>` precise (`string[]`, not\n * `unknown[]`).\n */"
|
|
5661
6418
|
},
|
|
5662
6419
|
{
|
|
@@ -5692,6 +6449,25 @@
|
|
|
5692
6449
|
"signature": "export declare const testClient: typeof inProcessClient;",
|
|
5693
6450
|
"doc": "/**\n * The in-process test client — the Fastify-`inject` / supertest equivalent for nifra. Drives the\n * app's own `fetch` directly: no server, no port, no network, the full real lifecycle (validation,\n * middleware, contracts, auth), and end-to-end types from `App`. Calls never throw — branch on\n * `res.ok`. An alias of {@link inProcessClient} with a test-focused name; identical behavior.\n *\n * ```ts\n * import { testClient } from \"@nifrajs/client\"\n * import { app } from \"../src/app\"\n *\n * const api = testClient<typeof app>(app)\n * const res = await api.users({ id: \"42\" }).get()\n * expect(res.ok && res.data.id).toBe(\"42\")\n * ```\n */"
|
|
5694
6451
|
},
|
|
6452
|
+
{
|
|
6453
|
+
"name": "testSession",
|
|
6454
|
+
"kind": "function",
|
|
6455
|
+
"package": "@nifrajs/testing",
|
|
6456
|
+
"signature": "export declare function testSession<App extends AppLike>(app: App, options?: TestSessionOptions): TestSession<App>;",
|
|
6457
|
+
"doc": "/** Create a cookie-persisting in-process test client for `app`. */"
|
|
6458
|
+
},
|
|
6459
|
+
{
|
|
6460
|
+
"name": "TestSession",
|
|
6461
|
+
"kind": "interface",
|
|
6462
|
+
"package": "@nifrajs/testing",
|
|
6463
|
+
"signature": "export interface TestSession<App> {\n /** The end-to-end-typed in-process client — every call carries + captures cookies. */\n readonly client: Treaty<App>;\n /** The jar backing this session — inspect (`cookies.get(\"sid\")`), seed, or `clear()` it. */\n readonly cookies: CookieJar;\n}"
|
|
6464
|
+
},
|
|
6465
|
+
{
|
|
6466
|
+
"name": "TestSessionOptions",
|
|
6467
|
+
"kind": "interface",
|
|
6468
|
+
"package": "@nifrajs/testing",
|
|
6469
|
+
"signature": "export interface TestSessionOptions extends Omit<ClientOptions, \"fetch\"> {\n /** Origin used to resolve relative paths. Default `\"http://nifra.internal\"`. */\n readonly origin?: string;\n /** Reuse an existing jar (e.g. seed a session cookie, or share one across sessions). */\n readonly cookies?: CookieJar;\n}"
|
|
6470
|
+
},
|
|
5695
6471
|
{
|
|
5696
6472
|
"name": "TestSummary",
|
|
5697
6473
|
"kind": "interface",
|
|
@@ -5754,6 +6530,13 @@
|
|
|
5754
6530
|
"package": "@nifrajs/middleware",
|
|
5755
6531
|
"signature": "export declare function timingSafeEqualString(a: string, b: string): Promise<boolean>;"
|
|
5756
6532
|
},
|
|
6533
|
+
{
|
|
6534
|
+
"name": "toBytes",
|
|
6535
|
+
"kind": "function",
|
|
6536
|
+
"package": "@nifrajs/storage",
|
|
6537
|
+
"signature": "export declare function toBytes(data: StorageData): Uint8Array;",
|
|
6538
|
+
"doc": "/** Normalize any accepted payload to bytes. */"
|
|
6539
|
+
},
|
|
5757
6540
|
{
|
|
5758
6541
|
"name": "toFetchHandler",
|
|
5759
6542
|
"kind": "function",
|
|
@@ -5779,6 +6562,13 @@
|
|
|
5779
6562
|
"package": "@nifrajs/cli",
|
|
5780
6563
|
"signature": "export declare function tokenSetHas(tokens: ReadonlySet<string>, group: SearchTermGroup): boolean;"
|
|
5781
6564
|
},
|
|
6565
|
+
{
|
|
6566
|
+
"name": "ToolAnnotations",
|
|
6567
|
+
"kind": "interface",
|
|
6568
|
+
"package": "@nifrajs/core",
|
|
6569
|
+
"signature": "export interface ToolAnnotations {\n /** Human-readable display title for the tool, distinct from the machine `name`. */\n readonly title?: string;\n /** The tool does not modify its environment (a pure read). */\n readonly readOnlyHint?: boolean;\n /** The tool may perform destructive updates — only meaningful when `readOnlyHint` is not `true`. */\n readonly destructiveHint?: boolean;\n /** Repeated calls with the same arguments have no additional effect beyond the first. */\n readonly idempotentHint?: boolean;\n /** The tool interacts with external entities (an \"open world\" beyond this server). */\n readonly openWorldHint?: boolean;\n}",
|
|
6570
|
+
"doc": "/**\n * MCP tool safety hints, surfaced in `tools/list`, that tell an agent how risky a `.tool()` call is — so it\n * can decide whether to auto-invoke or confirm first. All optional; an omitted hint means \"unknown\". Mirrors\n * the MCP spec's tool `annotations`.\n */"
|
|
6571
|
+
},
|
|
5782
6572
|
{
|
|
5783
6573
|
"name": "toOpenAPI",
|
|
5784
6574
|
"kind": "function",
|
|
@@ -5801,9 +6591,9 @@
|
|
|
5801
6591
|
},
|
|
5802
6592
|
{
|
|
5803
6593
|
"name": "TraceContext",
|
|
5804
|
-
"kind": "
|
|
6594
|
+
"kind": "type",
|
|
5805
6595
|
"package": "@nifrajs/otel",
|
|
5806
|
-
"signature": "export
|
|
6596
|
+
"signature": "export type TraceContext = ObservationContext;",
|
|
5807
6597
|
"doc": "/** The trace context exposed on the handler `c.trace` (typed, threaded via `derive`). */"
|
|
5808
6598
|
},
|
|
5809
6599
|
{
|
|
@@ -5824,7 +6614,7 @@
|
|
|
5824
6614
|
"name": "TracingOptions",
|
|
5825
6615
|
"kind": "interface",
|
|
5826
6616
|
"package": "@nifrajs/otel",
|
|
5827
|
-
"signature": "export interface TracingOptions {\n /** Where spans are sent. Default: {@link consoleSpanExporter}. */\n readonly exporter?: SpanExporter;\n /** Sets the `service.name` attribute on every span. */\n readonly serviceName?: string;\n /**\n * Set the outbound `traceparent` on the RESPONSE too (handy for browser/client correlation).\n * Default false — most setups only propagate downstream, not back to the caller.\n */\n readonly responseHeader?: boolean;\n}"
|
|
6617
|
+
"signature": "export interface TracingOptions {\n /** Where spans are sent. Default: {@link consoleSpanExporter}. */\n readonly exporter?: SpanExporter;\n /** Additional observation adapters (DevTools, a private redacting backend, metrics, …). */\n readonly adapters?: readonly ObservationAdapter[];\n /** Sets the `service.name` attribute on every span. */\n readonly serviceName?: string;\n /**\n * Set the outbound `traceparent` on the RESPONSE too (handy for browser/client correlation).\n * Default false — most setups only propagate downstream, not back to the caller.\n */\n readonly responseHeader?: boolean;\n}"
|
|
5828
6618
|
},
|
|
5829
6619
|
{
|
|
5830
6620
|
"name": "TrailingSlashOptions",
|
|
@@ -5922,6 +6712,13 @@
|
|
|
5922
6712
|
"signature": "export declare function unsignValue(signed: string, secret: string): Promise<string | null>;",
|
|
5923
6713
|
"doc": "/**\n * Verify a `value.signature` produced by {@link signValue} and return the value, or `null` if the\n * signature is missing, malformed, or doesn't match. Verification is **constant-time**\n * (`crypto.subtle.verify`), so a wrong signature can't be discovered byte-by-byte via timing.\n */"
|
|
5924
6714
|
},
|
|
6715
|
+
{
|
|
6716
|
+
"name": "UnsupportedMockSchemaError",
|
|
6717
|
+
"kind": "class",
|
|
6718
|
+
"package": "@nifrajs/mock",
|
|
6719
|
+
"signature": "export declare class UnsupportedMockSchemaError extends Error {\n readonly keyword: string;\n constructor(keyword: string, message: string);\n}",
|
|
6720
|
+
"doc": "/**\n * `@nifrajs/mock` — contract-based mock server.\n *\n * Reads a Nifra app's registered routes and their Standard Schema / JSON Schema\n * response definitions, then generates fake responses from supported JSON Schema keywords. Use it\n * for frontend-first development, agent testing, or CI smoke tests.\n */"
|
|
6721
|
+
},
|
|
5925
6722
|
{
|
|
5926
6723
|
"name": "UploadResult",
|
|
5927
6724
|
"kind": "type",
|
|
@@ -6257,8 +7054,8 @@
|
|
|
6257
7054
|
"name": "VERSION",
|
|
6258
7055
|
"kind": "const",
|
|
6259
7056
|
"package": "@nifrajs/core",
|
|
6260
|
-
"signature": "export declare const VERSION: \"
|
|
6261
|
-
"doc": "
|
|
7057
|
+
"signature": "export declare const VERSION: \"1.4.0\";",
|
|
7058
|
+
"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, so the literal can't go stale\n * (it shipped at \"0.0.0\" through 1.0.0 before those guards existed). Kept narrow (`as const`) so\n * consumers can pin it at the type level — see `test/version.test-d.ts`.\n */"
|
|
6262
7059
|
},
|
|
6263
7060
|
{
|
|
6264
7061
|
"name": "ViteDevServer",
|
|
@@ -6297,8 +7094,7 @@
|
|
|
6297
7094
|
"name": "walkSource",
|
|
6298
7095
|
"kind": "function",
|
|
6299
7096
|
"package": "@nifrajs/cli",
|
|
6300
|
-
"signature": "export declare function walkSource(cwd: string, visit: (rel: string, content: string) => void): Promise<void>;"
|
|
6301
|
-
"doc": "/** Walk the project's `.ts`/`.tsx` source (skipping deps/build/tests), calling `visit` per file.\n * Exported so `nifra doctor` ({@link ./doctor.ts}) scans the same source surface as `nifra check`. */"
|
|
7097
|
+
"signature": "export declare function walkSource(cwd: string, visit: (rel: string, content: string) => void): Promise<void>;"
|
|
6302
7098
|
},
|
|
6303
7099
|
{
|
|
6304
7100
|
"name": "WarmWorker",
|
|
@@ -6395,6 +7191,24 @@
|
|
|
6395
7191
|
"signature": "export declare function withISR(app: ISRApp, options: ISROptions): (req: Request, platform?: ISRPlatform) => Promise<Response>;",
|
|
6396
7192
|
"doc": "/**\n * Wrap a nifra app with **Incremental Static Regeneration**: a cacheable page is served from\n * {@link CacheStore} when fresh, served **stale while a fresh copy regenerates in the background**\n * (`platform.waitUntil` on edge), or rendered + stored on a miss. Framework-agnostic (it caches the\n * rendered bytes). Returns a `fetch(req, platform?)` handler — hand it to `Bun.serve`/the Workers\n * `export default`, etc. Regeneration is single-flight per key (no stampede on a hot stale page).\n *\n * Each route's freshness comes from the `revalidate` header the app sets (per-route\n * `export const revalidate`), falling back to `options.revalidate`. Only full-document `text/html`\n * GET 200s are cached; everything else (assets, data-mode GETs, redirects, errors) passes through.\n */"
|
|
6397
7193
|
},
|
|
7194
|
+
{
|
|
7195
|
+
"name": "Worker",
|
|
7196
|
+
"kind": "interface",
|
|
7197
|
+
"package": "@nifrajs/jobs",
|
|
7198
|
+
"signature": "export interface Worker {\n /** Stop polling and await the in-flight round (graceful). */\n stop(): Promise<void>;\n readonly running: boolean;\n}"
|
|
7199
|
+
},
|
|
7200
|
+
{
|
|
7201
|
+
"name": "WorkerOptions",
|
|
7202
|
+
"kind": "interface",
|
|
7203
|
+
"package": "@nifrajs/jobs",
|
|
7204
|
+
"signature": "export interface WorkerOptions {\n /** Max jobs in flight at once. Default 1. */\n readonly concurrency?: number;\n /** How often to poll the store for due jobs (ms). Default 250. */\n readonly pollIntervalMs?: number;\n /** How long a leased job is hidden before it's considered abandoned and re-leased (ms). Default 30_000. */\n readonly leaseMs?: number;\n}"
|
|
7205
|
+
},
|
|
7206
|
+
{
|
|
7207
|
+
"name": "WrapOptions",
|
|
7208
|
+
"kind": "type",
|
|
7209
|
+
"package": "@nifrajs/cache",
|
|
7210
|
+
"signature": "export type WrapOptions = SetOptions;"
|
|
7211
|
+
},
|
|
6398
7212
|
{
|
|
6399
7213
|
"name": "wrapWebSocketMessageValidation",
|
|
6400
7214
|
"kind": "function",
|