@nifrajs/cli 5.17.0 → 5.18.1
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/CHANGELOG.md +67 -0
- package/dist/check-diagnostics.d.ts +7 -0
- package/dist/check-diagnostics.d.ts.map +1 -1
- package/dist/check-diagnostics.js +3 -0
- package/dist/check-diagnostics.js.map +1 -1
- package/dist/check-scan-sql.d.ts +95 -0
- package/dist/check-scan-sql.d.ts.map +1 -0
- package/dist/check-scan-sql.js +1190 -0
- package/dist/check-scan-sql.js.map +1 -0
- package/dist/check-scan.d.ts +5 -93
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +20 -1207
- package/dist/check-scan.js.map +1 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +9 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +2 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +249 -80
- package/dist/cli.js.map +1 -1
- package/dist/command-catalog.d.ts +3 -0
- package/dist/command-catalog.d.ts.map +1 -1
- package/dist/command-catalog.js +18 -4
- package/dist/command-catalog.js.map +1 -1
- package/dist/frontend-guidance.js +1 -1
- package/dist/frontend-guidance.js.map +1 -1
- package/dist/internal/a11y-element.d.ts +33 -0
- package/dist/internal/a11y-element.d.ts.map +1 -0
- package/dist/internal/a11y-element.js +124 -0
- package/dist/internal/a11y-element.js.map +1 -0
- package/dist/internal/a11y-jsx.d.ts +12 -0
- package/dist/internal/a11y-jsx.d.ts.map +1 -0
- package/dist/internal/a11y-jsx.js +42 -0
- package/dist/internal/a11y-jsx.js.map +1 -0
- package/dist/internal/a11y-template.d.ts +11 -0
- package/dist/internal/a11y-template.d.ts.map +1 -0
- package/dist/internal/a11y-template.js +56 -0
- package/dist/internal/a11y-template.js.map +1 -0
- package/dist/internal/aria-data.d.ts +23 -0
- package/dist/internal/aria-data.d.ts.map +1 -0
- package/dist/internal/aria-data.js +220 -0
- package/dist/internal/aria-data.js.map +1 -0
- package/dist/internal/edit-distance.d.ts +3 -0
- package/dist/internal/edit-distance.d.ts.map +1 -0
- package/dist/internal/edit-distance.js +12 -0
- package/dist/internal/edit-distance.js.map +1 -0
- package/dist/internal/imported-as.d.ts +10 -0
- package/dist/internal/imported-as.d.ts.map +1 -0
- package/dist/internal/imported-as.js +23 -0
- package/dist/internal/imported-as.js.map +1 -0
- package/dist/internal/source-facts.d.ts +3 -0
- package/dist/internal/source-facts.d.ts.map +1 -1
- package/dist/internal/source-facts.js +2 -0
- package/dist/internal/source-facts.js.map +1 -1
- package/dist/internal/template-markup.d.ts +58 -0
- package/dist/internal/template-markup.d.ts.map +1 -0
- package/dist/internal/template-markup.js +221 -0
- package/dist/internal/template-markup.js.map +1 -0
- package/dist/internal/typescript-import.d.ts.map +1 -1
- package/dist/internal/typescript-import.js +11 -0
- package/dist/internal/typescript-import.js.map +1 -1
- package/dist/mcp-exec.d.ts.map +1 -1
- package/dist/mcp-exec.js +37 -23
- package/dist/mcp-exec.js.map +1 -1
- package/dist/mcp-http.js +1 -1
- package/dist/mcp-io.d.ts.map +1 -1
- package/dist/mcp-io.js +5 -3
- package/dist/mcp-io.js.map +1 -1
- package/dist/mcp-root.js +1 -1
- package/dist/mcp-root.js.map +1 -1
- package/dist/mcp-ws.d.ts.map +1 -1
- package/dist/mcp-ws.js +3 -2
- package/dist/mcp-ws.js.map +1 -1
- package/dist/migrate-layout-config.d.ts +63 -0
- package/dist/migrate-layout-config.d.ts.map +1 -0
- package/dist/migrate-layout-config.js +507 -0
- package/dist/migrate-layout-config.js.map +1 -0
- package/dist/migrate-layout-split.d.ts +46 -0
- package/dist/migrate-layout-split.d.ts.map +1 -0
- package/dist/migrate-layout-split.js +687 -0
- package/dist/migrate-layout-split.js.map +1 -0
- package/dist/migrate-layout.d.ts +4 -24
- package/dist/migrate-layout.d.ts.map +1 -1
- package/dist/migrate-layout.js +8 -1183
- package/dist/migrate-layout.js.map +1 -1
- package/dist/output-schemas.d.ts.map +1 -1
- package/dist/output-schemas.js +78 -10
- package/dist/output-schemas.js.map +1 -1
- package/dist/recipes/5.18.0.d.ts +9 -0
- package/dist/recipes/5.18.0.d.ts.map +1 -0
- package/dist/recipes/5.18.0.js +56 -0
- package/dist/recipes/5.18.0.js.map +1 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +2 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +6 -0
- package/dist/review.js.map +1 -1
- package/dist/rules/a11y.d.ts +5 -0
- package/dist/rules/a11y.d.ts.map +1 -0
- package/dist/rules/a11y.js +78 -0
- package/dist/rules/a11y.js.map +1 -0
- package/dist/rules/codes.d.ts +6 -0
- package/dist/rules/codes.d.ts.map +1 -1
- package/dist/rules/codes.js +6 -0
- package/dist/rules/codes.js.map +1 -1
- package/dist/rules/comment-markers.js +1 -1
- package/dist/rules/comment-markers.js.map +1 -1
- package/dist/rules/explanations.d.ts.map +1 -1
- package/dist/rules/explanations.js +30 -0
- package/dist/rules/explanations.js.map +1 -1
- package/dist/rules/host-exposure.d.ts +23 -0
- package/dist/rules/host-exposure.d.ts.map +1 -0
- package/dist/rules/host-exposure.js +380 -0
- package/dist/rules/host-exposure.js.map +1 -0
- package/dist/rules/internal-links.d.ts.map +1 -1
- package/dist/rules/internal-links.js +16 -141
- package/dist/rules/internal-links.js.map +1 -1
- package/dist/rules/islands.d.ts +54 -0
- package/dist/rules/islands.d.ts.map +1 -1
- package/dist/rules/islands.js +577 -80
- package/dist/rules/islands.js.map +1 -1
- package/dist/rules/security.d.ts +1 -0
- package/dist/rules/security.d.ts.map +1 -1
- package/dist/rules/security.js +34 -7
- package/dist/rules/security.js.map +1 -1
- package/dist/runtime-differences.js +3 -3
- package/dist/runtime-differences.js.map +1 -1
- package/dist/scaffold.d.ts +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +2 -2
- package/dist/scaffold.js.map +1 -1
- package/dist/source-rewrites.d.ts.map +1 -1
- package/dist/source-rewrites.js +2 -19
- package/dist/source-rewrites.js.map +1 -1
- package/docs/examples.json +4 -4
- package/docs/llms-full.txt +422 -42
- package/docs/types.json +466 -56
- package/package.json +12 -12
- package/src/check-diagnostics.ts +11 -0
- package/src/check-scan-sql.ts +1746 -0
- package/src/check-scan.ts +34 -1754
- package/src/check.ts +10 -1
- package/src/cli.ts +258 -98
- package/src/command-catalog.ts +21 -4
- package/src/frontend-guidance.ts +1 -1
- package/src/internal/a11y-element.ts +227 -0
- package/src/internal/a11y-jsx.ts +54 -0
- package/src/internal/a11y-template.ts +74 -0
- package/src/internal/aria-data.ts +242 -0
- package/src/internal/edit-distance.ts +16 -0
- package/src/internal/imported-as.ts +30 -0
- package/src/internal/source-facts.ts +4 -0
- package/src/internal/template-markup.ts +270 -0
- package/src/internal/typescript-import.ts +15 -0
- package/src/mcp-exec.ts +43 -22
- package/src/mcp-http.ts +1 -1
- package/src/mcp-io.ts +5 -3
- package/src/mcp-root.ts +1 -1
- package/src/mcp-ws.ts +3 -2
- package/src/migrate-layout-config.ts +615 -0
- package/src/migrate-layout-split.ts +870 -0
- package/src/migrate-layout.ts +37 -1468
- package/src/output-schemas.ts +85 -17
- package/src/recipes/5.18.0.ts +63 -0
- package/src/recipes/index.ts +2 -0
- package/src/review.ts +6 -0
- package/src/rules/a11y.ts +119 -0
- package/src/rules/codes.ts +6 -0
- package/src/rules/comment-markers.ts +2 -2
- package/src/rules/explanations.ts +30 -0
- package/src/rules/host-exposure.ts +531 -0
- package/src/rules/internal-links.ts +21 -154
- package/src/rules/islands.ts +698 -86
- package/src/rules/security.ts +48 -7
- package/src/runtime-differences.ts +3 -3
- package/src/scaffold.ts +3 -3
- package/src/source-rewrites.ts +2 -15
package/docs/llms-full.txt
CHANGED
|
@@ -300,13 +300,13 @@ to full-stack later without a rewrite.
|
|
|
300
300
|
regex), but a real request also pays for middleware and validation,
|
|
301
301
|
context, and serialization. In the current matrix Nifra runs **level with Elysia on Bun** -
|
|
302
302
|
99% of Elysia on `GET /users/:id` and
|
|
303
|
-
|
|
304
|
-
**level with Fastify on Node** (
|
|
305
|
-
|
|
306
|
-
and Express behind. On **Deno** it runs at
|
|
307
|
-
GET and
|
|
303
|
+
103% on the validated `POST` - and
|
|
304
|
+
**level with Fastify on Node** (105% of Fastify on GET,
|
|
305
|
+
103% on the validated `POST`), with Elysia, Hono,
|
|
306
|
+
and Express behind. On **Deno** it runs at 113% of Elysia on
|
|
307
|
+
GET and 143% on the validated `POST`. In the realistic shape (security headers + CORS +
|
|
308
308
|
bearer auth + cookies + validated query/body + a ~2.4 KB JSON response, measured on
|
|
309
|
-
**Bun** with `oha`) Nifra runs at **
|
|
309
|
+
**Bun** with `oha`) Nifra runs at **129% of Elysia on GET and 132% on POST**. Treat benchmark
|
|
310
310
|
rows as same-run evidence, not a permanent law of nature.
|
|
311
311
|
|
|
312
312
|
-
|
|
@@ -697,6 +697,17 @@ export async function loader({ search, api }: Route.LoaderArgs) {
|
|
|
697
697
|
}
|
|
698
698
|
```
|
|
699
699
|
|
|
700
|
+
For a deterministic validator, wrap the exported schema with `memoizeSearchSchema`
|
|
701
|
+
from `@nifrajs/web/client` to reuse validation within one SSR request. The
|
|
702
|
+
validator can depend on the query alone and must leave its input unchanged. Reuse is decided
|
|
703
|
+
per reader chain: the page loader and the render validate the layout schemas and the page
|
|
704
|
+
schema, so one unwrapped schema among them turns reuse off there, while the first context
|
|
705
|
+
(guards and early hooks) validates the page schema alone. A result must also be plain data:
|
|
706
|
+
objects and arrays of primitives that are not frozen or sealed and have no accessors, class
|
|
707
|
+
instances, dates or maps. Then each reader gets an independent copy. Otherwise the validator
|
|
708
|
+
runs for each reader and its result is used as returned, so a nested object the validator
|
|
709
|
+
returns from a shared source stays shared.
|
|
710
|
+
|
|
700
711
|
Without a `searchSchema`, `ctx.search`, the `search` prop and
|
|
701
712
|
`useSearch` are the raw parsed query (`Record<string, unknown>`).
|
|
702
713
|
`useSearch` and `useParams` ship on every adapter (React, Preact, Vue,
|
|
@@ -3222,8 +3233,12 @@ Toggles a class per pair.
|
|
|
3222
3233
|
`data-bind-attr="aria-expanded:open"`
|
|
3223
3234
|
|
|
3224
3235
|
Sets an attribute per pair, removing it for `false` or
|
|
3225
|
-
`null`.
|
|
3226
|
-
|
|
3236
|
+
`null`. Event handler attributes and `srcdoc` are blocked. URL
|
|
3237
|
+
bindings accept explicit http(s), mailto, tel, and relative URLs without an authority.
|
|
3238
|
+
They are blocked on a
|
|
3239
|
+
`script`, `iframe`, `object`, `embed`,
|
|
3240
|
+
`link` or `base` element. SVG animation elements such as
|
|
3241
|
+
`<animate>` reject all attribute bindings.
|
|
3227
3242
|
|
|
3228
3243
|
`data-bind-value="query"`
|
|
3229
3244
|
|
|
@@ -3238,7 +3253,24 @@ nearest island, and nothing inside a `data-island-ignore` element binds or mount
|
|
|
3238
3253
|
- render user HTML there. Because both sides are literal, `nifra check` matches
|
|
3239
3254
|
them: `NF-C047` warns when a name has no `state("...")` key
|
|
3240
3255
|
or returned handler, and `NF-C048` when a binding sits where no
|
|
3241
|
-
`bindIsland` host will ever walk it.
|
|
3256
|
+
`bindIsland` host will ever walk it. `NF-C066` warns when a
|
|
3257
|
+
`data-bind-attr` names an attribute the runtime refuses.
|
|
3258
|
+
|
|
3259
|
+
The same check reads the host. `NF-C064` warns when a `data-island`
|
|
3260
|
+
id appears in no `mountIslands` map (it stays quiet once a map is held in a
|
|
3261
|
+
variable, spread or aliased, since the ids are then unknowable). `NF-C065`
|
|
3262
|
+
compares the props a host passes with the enhancer's type: a missing required prop, an
|
|
3263
|
+
undeclared one, or a literal of another primitive type. It reads a type literal on
|
|
3264
|
+
`defineIsland<{ ... }>` or `bindIsland` (or an
|
|
3265
|
+
annotated second parameter) and an object literal in `islandProps({...})`,
|
|
3266
|
+
`JSON.stringify({...})` or JSX `props`; the props are still
|
|
3267
|
+
JSON in an attribute at runtime, so nothing is validated in the browser.
|
|
3268
|
+
|
|
3269
|
+
In development a `data-bind-text` whose server-rendered text, or a
|
|
3270
|
+
`data-bind-show` whose hidden state, differs from the signal's first value
|
|
3271
|
+
logs one console warning: the page would change on mount. An empty text slot is not a
|
|
3272
|
+
mismatch. The check sits behind `process.env.NODE_ENV`, so a production build
|
|
3273
|
+
that defines it carries none of that code; one that does not define it keeps the warning.
|
|
3242
3274
|
|
|
3243
3275
|
### Signals
|
|
3244
3276
|
|
|
@@ -3468,14 +3500,20 @@ a binding inside a slot that belongs to an island outside it.
|
|
|
3468
3500
|
### Load strategies
|
|
3469
3501
|
|
|
3470
3502
|
A host's `data-island-strategy` defers its enhancer: `load`
|
|
3471
|
-
(default), `idle`, `visible` (mount when it scrolls into view),
|
|
3472
|
-
`
|
|
3503
|
+
(default), `idle`, `visible` (mount when it scrolls into view),
|
|
3504
|
+
`interaction` (mount on the first hover, press, focus or click on the host), or
|
|
3505
|
+
`media` with the query in
|
|
3506
|
+
`data-island-media`. A host with no matching
|
|
3473
3507
|
enhancer, or an invalid strategy, stays inert server-rendered HTML - forward-compatible,
|
|
3474
3508
|
never a runtime error. The scheduling itself is `@nifrajs/island-trigger`'s
|
|
3475
3509
|
`scheduleTrigger`, which has no DOM or framework dependency, for a runtime of
|
|
3476
3510
|
your own.
|
|
3477
3511
|
|
|
3478
|
-
|
|
3512
|
+
An interaction click mounts during capture on the host. Listeners attached during mount can
|
|
3513
|
+
receive that click at a descendant target or in the host's non-capture phase. Capture
|
|
3514
|
+
listeners added to the host during mount start with the next click.
|
|
3515
|
+
|
|
3516
|
+
## Nifra - Streaming and SSE
|
|
3479
3517
|
|
|
3480
3518
|
> Streaming SSR, Suspense, and defer() in Nifra - on every runtime including the edge.
|
|
3481
3519
|
|
|
@@ -5120,8 +5158,9 @@ must post to the app in the server's `formOrigins`; the origins
|
|
|
5120
5158
|
list, for that server's own routes only: a mounted server keeps its own policy, a
|
|
5121
5159
|
parent must list the same sites itself, and a web page action checks the backend's
|
|
5122
5160
|
`allowedOrigins` instead. Audit those origins: one named there may post a form
|
|
5123
|
-
whatever methods or credentials the CORS policy allows.
|
|
5124
|
-
|
|
5161
|
+
whatever methods or credentials the CORS policy allows. Without an `Origin` header,
|
|
5162
|
+
Core still rejects forms marked `same-site` or `cross-site` by
|
|
5163
|
+
`Sec-Fetch-Site`. Keep `csrf()` on cookie-authenticated upload routes.
|
|
5125
5164
|
|
|
5126
5165
|
-
|
|
5127
5166
|
**The form is held in memory.** Budget roughly twice `bodyLimit` per request in
|
|
@@ -5249,7 +5288,8 @@ set an explicit cap for the bytes you pass to `validateUpload`. The detection al
|
|
|
5249
5288
|
covering common image / A-V / archive types.
|
|
5250
5289
|
|
|
5251
5290
|
`signDownloadUrl` / `verifyDownloadUrl` mint short-TTL, tamper-evident
|
|
5252
|
-
download links (HMAC-SHA256 over the path
|
|
5291
|
+
download links (HMAC-SHA256 over the path, ordered query parameters, and expiry, with
|
|
5292
|
+
constant-time verification). And
|
|
5253
5293
|
`stripImageMetadata` drops EXIF/GPS by re-encoding the image - through any
|
|
5254
5294
|
@nifrajs/image backend, with no dependency on it:
|
|
5255
5295
|
|
|
@@ -5632,17 +5672,17 @@ limiter (@nifrajs/middleware), and a hardened image-resize endpoint
|
|
|
5632
5672
|
### Redacting logs
|
|
5633
5673
|
|
|
5634
5674
|
The built-in `jsonLogger` redacts values under sensitive **keys**
|
|
5635
|
-
(`password`, `authorization`, `token`, …)
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5675
|
+
(`password`, `authorization`, `token`, …) and applies
|
|
5676
|
+
`commonSecretPatterns` to string values and messages. It covers bearer tokens,
|
|
5677
|
+
JWTs, emails, and several well-known key formats. Pass `valuePatterns` to set your
|
|
5678
|
+
own rules or extend the defaults:
|
|
5639
5679
|
|
|
5640
5680
|
```ts
|
|
5641
5681
|
import { server, jsonLogger, commonSecretPatterns } from "@nifrajs/core/server"
|
|
5642
5682
|
|
|
5643
|
-
//
|
|
5683
|
+
// The default logger redacts sensitive keys and scans string values and messages.
|
|
5644
5684
|
const app = server({
|
|
5645
|
-
logger: jsonLogger(
|
|
5685
|
+
logger: jsonLogger(),
|
|
5646
5686
|
})
|
|
5647
5687
|
|
|
5648
5688
|
// logger.error("auth failed for user@example.com with Bearer abc.def")
|
|
@@ -8708,8 +8748,8 @@ starts from unless nothing else, installed or declared, names one.
|
|
|
8708
8748
|
|
|
8709
8749
|
```bash
|
|
8710
8750
|
nifra upgrade --list # the release targets this CLI knows
|
|
8711
|
-
nifra upgrade 5.
|
|
8712
|
-
nifra upgrade 5.
|
|
8751
|
+
nifra upgrade 5.18.1 # dry-run: every planned edit, nothing written
|
|
8752
|
+
nifra upgrade 5.18.1 --write # apply; it verifies with nifra check once the target is installed
|
|
8713
8753
|
# if pins were already bumped by hand, add --from <installed-version>
|
|
8714
8754
|
bun install # install the new pins
|
|
8715
8755
|
nifra check # verify against them
|
|
@@ -9707,7 +9747,7 @@ below - without starting a server:
|
|
|
9707
9747
|
```ts
|
|
9708
9748
|
# doc-check: skip - fragment: terminal output, not source.
|
|
9709
9749
|
$ nifra dev
|
|
9710
|
-
nifra dev (bun) → http://localhost:
|
|
9750
|
+
nifra dev (bun) → http://localhost:4321
|
|
9711
9751
|
bundler: bun (default; --vite to switch)
|
|
9712
9752
|
|
|
9713
9753
|
$ nifra build
|
|
@@ -9906,11 +9946,11 @@ supply that plugin yourself through your own `bunfig.toml`; plain CSS and Tailwi
|
|
|
9906
9946
|
need nothing either way.
|
|
9907
9947
|
|
|
9908
9948
|
**
|
|
9909
|
-
Server functions and
|
|
9949
|
+
Server functions and backend-only modules under `--bun`
|
|
9910
9950
|
**
|
|
9911
|
-
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9951
|
+
- the client build replaces a `*.fn.ts` module with an RPC stub and rejects
|
|
9952
|
+
browser imports that reach `backend/`, a route's `x.backend.ts`, or
|
|
9953
|
+
a module marked with `@nifrajs/web/backend-only`. Bun's dev-server bundling accepts
|
|
9914
9954
|
plugins only through `bunfig.toml` (`[serve.static] plugins`) - not
|
|
9915
9955
|
programmatically, and a runtime `Bun.plugin` never reaches it (upstream ask:
|
|
9916
9956
|
oven-sh/bun#36830). So `nifra dev --bun` generates a config under
|
|
@@ -13256,9 +13296,15 @@ A storage key was refused before any read or write: it is empty or over 1024 cha
|
|
|
13256
13296
|
|
|
13257
13297
|
#### NIFRA_STORAGE_READ_LIMIT
|
|
13258
13298
|
|
|
13259
|
-
An
|
|
13299
|
+
An object exceeds the adapter's `maxReadBytes` setting, or R2 reported invalid size metadata.
|
|
13300
|
+
|
|
13301
|
+
Use `getStream` for large objects, or raise `maxReadBytes` if buffering objects of that size is intentional.
|
|
13302
|
+
|
|
13303
|
+
#### NIFRA_STORAGE_PROVIDER
|
|
13304
|
+
|
|
13305
|
+
An S3 or Google Cloud Storage request failed or returned an invalid upload response.
|
|
13260
13306
|
|
|
13261
|
-
|
|
13307
|
+
Check the HTTP status and operation in the message. Verify the bucket, endpoint, credentials and provider permissions for that operation.
|
|
13262
13308
|
|
|
13263
13309
|
#### NIFRA_OPENAPI_IMPORT
|
|
13264
13310
|
|
|
@@ -15136,7 +15182,7 @@ the command below, which runs every recipe since its installed version. The 5.6
|
|
|
15136
15182
|
its imports and dependencies; the follow-up changes below need a hand.
|
|
15137
15183
|
|
|
15138
15184
|
```sh
|
|
15139
|
-
nifra upgrade 5.
|
|
15185
|
+
nifra upgrade 5.18.1
|
|
15140
15186
|
```
|
|
15141
15187
|
|
|
15142
15188
|
-
|
|
@@ -15567,8 +15613,8 @@ Migrate a backend. For the full
|
|
|
15567
15613
|
rendering and route model, see Loaders & actions
|
|
15568
15614
|
and Routing.
|
|
15569
15615
|
|
|
15570
|
-
The current dynamic SSR snapshot reports Nifra at
|
|
15571
|
-
of Next.js,
|
|
15616
|
+
The current dynamic SSR snapshot reports Nifra at 30× the throughput
|
|
15617
|
+
of Next.js, 15× Nuxt, 6.2× SvelteKit, and
|
|
15572
15618
|
2.3× SolidStart on the measured pages. See the
|
|
15573
15619
|
benchmark methodology and full results.
|
|
15574
15620
|
|
|
@@ -18627,7 +18673,8 @@ When more than one caller shares the route, also pass `evidenceOwner: (c) => <th
|
|
|
18627
18673
|
tenant id>`: turns are recorded and replayed under that owner, so another caller's reconnect or
|
|
18628
18674
|
reused `runId` finds none of them. Without it a turn id (by default the client's `runId`) works as a
|
|
18629
18675
|
bearer capability. The owner function runs before any replay; throwing from it refuses the request with `403`, and a
|
|
18630
|
-
thrown `Response` answers the request as built, as one thrown from `ports` does.
|
|
18676
|
+
thrown `Response` answers the request as built, as one thrown from `ports` does. `ports` also runs on
|
|
18677
|
+
a reconnect, before anything is replayed, so a budget or rate-limit charge made there is made again.
|
|
18631
18678
|
|
|
18632
18679
|
The seam performs no authentication or authorization - wrap it with your app's route guards and scope every port in `ports(c)` to the caller.
|
|
18633
18680
|
|
|
@@ -20738,6 +20785,10 @@ With `subscriptions: true`, a socket is admitted only when `authorize` accepts i
|
|
|
20738
20785
|
|
|
20739
20786
|
By default responses use the `application/graphql-response+json` media type with spec status codes: `200` for an executed result (including field errors in `errors`), `400` for a parse or validation failure, `401` for a rejected `authorize`, `405` for a mutation attempted over GET, `415` for a POST whose body is not `application/json` (or another `+json` type). The last keeps a cross-site HTML form, which can send only urlencoded, multipart or plain-text bodies, from posting a mutation with the visitor's cookies. Set `legacyJsonResponse: true` for the older always-`200` `application/json` behavior some clients expect.
|
|
20740
20787
|
|
|
20788
|
+
Over HTTP, an `authorize` that throws is answered with a `500`. The default formatter masks the cause. A custom `formatError` receives a thrown `Error` as `originalError`, and any other value as `originalError.cause`, and decides what the response shows. A thrown `Response` is the exception: it is sent as is and not logged. On a subscription socket, an `authorize` or `onConnect` that throws refuses the connection.
|
|
20789
|
+
|
|
20790
|
+
The thrown value is passed whole to `console.error`, so keep credentials out of its message, its attached properties and its `cause`. The handler adds nothing from the request to that log.
|
|
20791
|
+
|
|
20741
20792
|
## License
|
|
20742
20793
|
|
|
20743
20794
|
MIT
|
|
@@ -20959,9 +21010,13 @@ const dispose = scheduleTrigger({ media: "(min-width: 768px)" }, () => {
|
|
|
20959
21010
|
dispose() // cancel before the trigger fires
|
|
20960
21011
|
```
|
|
20961
21012
|
|
|
20962
|
-
`load`, `idle`, `visible`, and media-query triggers are one-shot. Idle and visibility
|
|
20963
|
-
fall back safely when the browser capability is unavailable; malformed or oversized media
|
|
20964
|
-
remain inert.
|
|
21013
|
+
`load`, `idle`, `visible`, `interaction`, and media-query triggers are one-shot. Idle and visibility
|
|
21014
|
+
strategies fall back safely when the browser capability is unavailable; malformed or oversized media
|
|
21015
|
+
queries remain inert. `interaction` waits for the first `pointerover`, `pointerdown`, `focusin` or
|
|
21016
|
+
`click` on the `target`. A click mounts during capture on the host. Listeners attached during mount
|
|
21017
|
+
can receive it at a descendant target or in the host's non-capture phase. Capture listeners added to
|
|
21018
|
+
the host during mount start with the next click. The callback runs at once when the target cannot take
|
|
21019
|
+
listeners. Each island runtime owns its own markers,
|
|
20965
21020
|
registry, signals, and framework integration.
|
|
20966
21021
|
|
|
20967
21022
|
For AI agents, see [`LLM.md`](./LLM.md). The wider reference is in
|
|
@@ -21660,6 +21715,325 @@ one cheap read instead of the whole corpus. For the wider framework: the repo's
|
|
|
21660
21715
|
[`llms-full.txt`](../../llms-full.txt) is the full machine-readable corpus. Run `nifra check` as the
|
|
21661
21716
|
done-gate, or `nifra mcp` to give the agent live project tools.
|
|
21662
21717
|
|
|
21718
|
+
## @nifrajs/node-engine
|
|
21719
|
+
|
|
21720
|
+
**Experimental.** Serve a nifra app from Node on Nifra's own Rust engine (`native/nifra-engine`): a native HTTP/1.1, HTTP/2 and WebSocket server with in-process TLS, polled by Node's libuv loop and reached through a N-API addon (`nifra-napi`).
|
|
21721
|
+
|
|
21722
|
+
It is a sibling of `@nifrajs/node` and `@nifrajs/node-uws`. The engine hands requests over in batches through shared buffers, with the head and body complete, so requests reach the app through the node-direct lane with no `http.Server` underneath and no Web `Request` unless a route asks for one.
|
|
21723
|
+
|
|
21724
|
+
```ts
|
|
21725
|
+
import { server } from "@nifrajs/core"
|
|
21726
|
+
import { serve } from "@nifrajs/node-engine"
|
|
21727
|
+
|
|
21728
|
+
const app = server().get("/hello", () => ({ hello: "world" }))
|
|
21729
|
+
const running = await serve(app, { port: 3000 })
|
|
21730
|
+
// later
|
|
21731
|
+
await running.stop()
|
|
21732
|
+
```
|
|
21733
|
+
|
|
21734
|
+
Requires Node 22 or newer and the built addon (`win32`, `darwin`, and `linux`, with `NIFRA_ENGINE_TRANSPORT=uring|epoll|uv` on Linux; pass `fallback: true` to fall back to `@nifrajs/node` if no native binary is available). `@nifrajs/node` is a peer dependency: this package reuses its Host policy, lifecycle and outcome runtime.
|
|
21735
|
+
|
|
21736
|
+
Build `nifra-napi` with Cargo from `native/nifra-engine` (or stage prebuilt `.node` binaries via `bun run scripts/stage-native-addon.ts`); `serve()` loads from `NIFRA_RUST_ENGINE_PATH`, installed platform packages (`@nifrajs/node-engine-<platform>-<arch>[-gnu|-musl]`), local `packages/node-engine/prebuilds/`, or `native/nifra-engine/target/{release,debug}`. The loader opens the shared library in place.
|
|
21737
|
+
|
|
21738
|
+
Run the TypeScript integration tests from the repository root on Node 22.18 or newer. On macOS:
|
|
21739
|
+
|
|
21740
|
+
```sh
|
|
21741
|
+
cargo build --release --manifest-path native/nifra-engine/Cargo.toml -p nifra-napi
|
|
21742
|
+
bun run --filter @nifrajs/node-engine build
|
|
21743
|
+
cp native/nifra-engine/target/release/libnifra_napi.dylib /tmp/nifra_napi.node
|
|
21744
|
+
NIFRA_RUST_ENGINE_PATH=/tmp/nifra_napi.node node --test packages/node-engine/test-node/*.test.ts packages/node-engine/test/rust-runtime.test.mjs
|
|
21745
|
+
```
|
|
21746
|
+
|
|
21747
|
+
On Linux, use `libnifra_napi.so`.
|
|
21748
|
+
|
|
21749
|
+
Set `NIFRA_ENGINE_TEST_DENO=1` with Deno on `PATH` to include the live adapter comparison in
|
|
21750
|
+
`parity.test.ts`. CI enables this comparison.
|
|
21751
|
+
|
|
21752
|
+
## Robustness checks
|
|
21753
|
+
|
|
21754
|
+
- Parser fuzzing: `cargo test --manifest-path native/nifra-engine/Cargo.toml -p nifra-http -p nifra-ws --test fuzz`; `NIFRA_FUZZ_CASES` lengthens it.
|
|
21755
|
+
- WebSocket conformance (Docker): `node packages/node-engine/conformance/autobahn.mjs`.
|
|
21756
|
+
- HTTP/2 conformance: `H2SPEC=/path/to/h2spec node packages/node-engine/conformance/h2spec.mjs`.
|
|
21757
|
+
- Soak: `SOAK_SECONDS=600 node packages/node-engine/conformance/soak.mjs`. Run it on Linux; macOS
|
|
21758
|
+
runs short of client ports at this connection rate.
|
|
21759
|
+
|
|
21760
|
+
Each takes the addon from `NIFRA_RUST_ENGINE_PATH` and the package's built `dist`. A panic in the
|
|
21761
|
+
engine closes the connection or fails the request that raised it; an out-of-memory abort or a stack
|
|
21762
|
+
overflow still ends the process.
|
|
21763
|
+
|
|
21764
|
+
## `serve(app, options)`
|
|
21765
|
+
|
|
21766
|
+
Resolves to an `EngineServer` once the port is bound. Invalid options throw before anything is started.
|
|
21767
|
+
|
|
21768
|
+
| Option | Meaning |
|
|
21769
|
+
|---|---|
|
|
21770
|
+
| `port` | Required unless `path` is set. `0` picks a free port; read it from `running.port`. |
|
|
21771
|
+
| `hostname` | Interface to bind. Default: all. |
|
|
21772
|
+
| `path` | Unix domain socket path to listen on instead of TCP `hostname`/`port`. |
|
|
21773
|
+
| `protocol` | The scheme `Request.url` carries. `"https"` when `tls` is set, else `"http"`. |
|
|
21774
|
+
| `tls` | In-process TLS (rustls): inline `cert` / `key`, or `cert_file_name` / `key_file_name`, optional `serverNames` SNI entries, plus optional `ticketKeys`. |
|
|
21775
|
+
| `http2` | HTTP/2 beside HTTP/1.1 on the same port (including RFC 8441 WebSocket over HTTP/2). `true`, or an object of settings. |
|
|
21776
|
+
| `compression` | Native response compression (`zstd`, `br`, `gzip`, `deflate`) via `Accept-Encoding`. |
|
|
21777
|
+
| `fallback` | Fall back to `@nifrajs/node` (`node:http`/`node:https`) when no native addon can be loaded. |
|
|
21778
|
+
| `static` | Static file middleware (`serveStatic(...)`) or handler consulted before routes on GET/HEAD. |
|
|
21779
|
+
| `fastResponse` | Swap `globalThis.Response` for the lazy direct-write wrapper to skip stream drains. |
|
|
21780
|
+
| `maxBodySize` | Largest request body, in bytes (default 1 MiB) when buffering request bodies. |
|
|
21781
|
+
| `oversizeWindow` | Bytes past `maxBodySize` still buffered so the app can answer with its own 413 body. Default 1 MiB; `0` turns it off. |
|
|
21782
|
+
| `wsMaxMessageSize` | Largest WebSocket message before the engine fails the connection with 1009. |
|
|
21783
|
+
| `wsDeflate` | Enable RFC 7692 WebSocket `permessage-deflate` compression (`true` or options); individual routes may override via `handler.deflate`. |
|
|
21784
|
+
| `allowedHosts`, `canonicalHost`, `normalizeTarget` | The same Host and target policy `@nifrajs/node` applies. |
|
|
21785
|
+
| `validateHost` | `true` checks every request's `Host`. Off by default; setting `allowedHosts` or `canonicalHost` turns it on. |
|
|
21786
|
+
| `engine` | Engine limits & streaming: `streamRequestBodies`, `wsMaxBackpressure`, `wsCloseOnBackpressureLimit`, `idleTimeoutMs`, `headersTimeoutMs`, `requestTimeoutMs`, `maxHeaderBytes`, `maxConnections`, `reusePort`. |
|
|
21787
|
+
| `gracefulSignals` | `true`, or stop options: SIGTERM and SIGINT call `stop()`. Off by default. |
|
|
21788
|
+
|
|
21789
|
+
### The server handle
|
|
21790
|
+
|
|
21791
|
+
| Member | Meaning |
|
|
21792
|
+
|---|---|
|
|
21793
|
+
| `port` | The bound port (`0` for Unix domain sockets). |
|
|
21794
|
+
| `path` | The bound Unix domain socket path when started with `path`. |
|
|
21795
|
+
| `stop({ drainMs, delayMs })` | Runs the app's `onStopping` hooks, keeps serving for `delayMs`, stops accepting, lets in-flight requests and sockets finish for up to `drainMs` (default 10 s), closes what is left, then runs `onStop`. Open WebSockets are closed with 1001 "server shutting down". |
|
|
21796
|
+
| `reloadTls(tls?)` | Swaps the certificate for every new handshake. See below. |
|
|
21797
|
+
| `addServerName(entry)` / `removeServerName(host)` | Adds/replaces or removes an SNI certificate at runtime. |
|
|
21798
|
+
| `[Symbol.asyncDispose]()` | `await using` support; same as `stop()`. |
|
|
21799
|
+
|
|
21800
|
+
## Request bodies
|
|
21801
|
+
|
|
21802
|
+
By default the engine buffers a request whole before the app runs, so `maxBodySize` bounds the memory one request can hold. This section describes that mode; with `engine.streamRequestBodies` on, see [buffered vs streaming request bodies](#notes-on-buffered-vs-streaming-request-bodies). The default is 1 MiB, or the largest `maxBodyBytes` among the app and the apps mounted in it when that is more; a route with its own larger `schema.bodyLimit` needs `maxBodySize` set to match.
|
|
21803
|
+
|
|
21804
|
+
A body over `maxBodySize` gets a 413. The engine buffers up to `oversizeWindow` (default 1 MiB) past the cap so that a body only a little over it is answered with the same JSON body the app's own 413 carries (`{"ok":false,"error":"payload_too_large"}`), on a connection that stays usable. Past the window the engine refuses natively and closes the connection as the body passes it: a declared `Content-Length` is refused before any body is read, and a chunked upload is cut off a chunk or so past the window. That refusal has an empty body, which the engine gives no way to change. `oversizeWindow: 0` skips the window: every body over the cap is refused natively and the request path does no size check. A request therefore holds at most `maxBodySize` plus `oversizeWindow` in memory.
|
|
21805
|
+
|
|
21806
|
+
## Headers
|
|
21807
|
+
|
|
21808
|
+
The engine hands headers over one call at a time or all at once, and the second costs more the more headers a request carries. The request path asks for the few it needs (`Host`, `Content-Length`, `Content-Type`, `Transfer-Encoding`, `Upgrade`) and reads the whole list only if the app asks for another header or for `Headers`. A repeated `Content-Type` reads as its first value, as on Node; the engine refuses a repeated `Host`, a conflicting `Content-Length` and a repeated `Transfer-Encoding` before the app runs. A request's headers are read from the engine while it is being answered, so a handler still running after its client disconnected finds none that it had not already read.
|
|
21809
|
+
|
|
21810
|
+
### Host validation
|
|
21811
|
+
|
|
21812
|
+
Off by default, as `validateHost` is on the Bun and Deno server. With it off, `Host` is read only when `req.url` is asked for, as sent. It never takes part in routing here, which comes from the request target the engine parsed. A `Host` holding a path, query, fragment or userinfo delimiter is refused with a 400, and an empty one reads as `localhost`, so `req.url` never names a path the router did not see. What gets through is a `Host` the URL parser refuses, such as an out-of-range port: the request is answered, and reading `req.url` then throws.
|
|
21813
|
+
|
|
21814
|
+
`validateHost: true` reads and checks every request's `Host` before the app runs: a malformed one is refused with a 400, and `req.url` is built from the normalized authority. It costs one engine call per request. Turn it on for a server that clients reach directly. Behind a proxy or CDN that already checks `Host`, leave it off. `allowedHosts` and `canonicalHost` need every `Host` read, so setting either turns it on, and `validateHost: false` beside them is refused. Fixed replies answered inside the engine are skipped while it is on, since they would not be checked.
|
|
21815
|
+
|
|
21816
|
+
## Fixed replies
|
|
21817
|
+
|
|
21818
|
+
`staticResponse()` (`GET` and `POST`) and `echoParam()` `GET` routes are registered with the engine, which answers them without calling into JS. They are skipped under a Host policy (every request's Host must be read), `GET` fast paths are skipped when `static` middleware is active, and a fixed `POST` carrying browser origin headers (`Origin` / `Sec-Fetch-Site`) stays on the router for cross-site checks.
|
|
21819
|
+
|
|
21820
|
+
## HTTP/2
|
|
21821
|
+
|
|
21822
|
+
```ts
|
|
21823
|
+
await serve(app, { port: 443, tls: { cert, key }, http2: true })
|
|
21824
|
+
```
|
|
21825
|
+
|
|
21826
|
+
With `tls`, clients negotiate `h2` by ALPN. Without it, a client opening with the HTTP/2 preface is served (prior knowledge, `curl --http2-prior-knowledge`). Every other client gets HTTP/1.1 on the same port. A request on an HTTP/2 stream reaches the app identically to an HTTP/1 request, including RFC 8441 Extended CONNECT WebSocket upgrades (`:protocol: websocket`) and streaming request/response bodies. Server push is not supported.
|
|
21827
|
+
|
|
21828
|
+
`engine.requestTimeoutMs` bounds reception of each HTTP/2 request from its initial headers.
|
|
21829
|
+
An upload that exceeds the deadline is cancelled while other streams keep running.
|
|
21830
|
+
If the deadline expires inside an unfinished frame or HPACK header block, the connection closes.
|
|
21831
|
+
|
|
21832
|
+
Response header fields are compressed (Huffman coding and the HPACK dynamic table). `set-cookie` is sent as never-indexed.
|
|
21833
|
+
|
|
21834
|
+
`stop()` shuts each connection down in two steps: a `GOAWAY` that refuses nothing and a `PING`, then, once the peer answers or after one second, the final `GOAWAY`. Requests already on their way are served.
|
|
21835
|
+
|
|
21836
|
+
### Settings
|
|
21837
|
+
|
|
21838
|
+
`http2` also takes an object. A value out of range makes `serve()` throw.
|
|
21839
|
+
|
|
21840
|
+
| Setting | Default | Meaning |
|
|
21841
|
+
|---|---|---|
|
|
21842
|
+
| `maxConcurrentStreams` | 128 | Streams open at once on a connection. |
|
|
21843
|
+
| `initialWindowSize` | 1 MiB | Flow-control window of each request body. |
|
|
21844
|
+
| `connectionWindowSize` | 4 MiB | Flow-control window of the connection, 65535 or more. |
|
|
21845
|
+
| `maxFrameSize` | 16384 | Largest frame accepted. |
|
|
21846
|
+
| `headerTableSize` | 4096 | Bytes of each HPACK table, request and response side. 0 to 65536. |
|
|
21847
|
+
| `maxSendBuffer` | 16 MiB | Queued response bytes per connection. At this limit the next buffered response with a body is reset with `ENHANCE_YOUR_CALM`, and past it a streamed one is told to wait. |
|
|
21848
|
+
| `pingIntervalMs` | 0 (off) | Quiet time after which a `PING` is sent, checked once a second. A peer that answers is not idle: set this below `idleTimeoutMs` to keep a live one open. |
|
|
21849
|
+
| `pingTimeoutMs` | 20000 | Budget for the answer before the connection closes. |
|
|
21850
|
+
|
|
21851
|
+
### Response trailers
|
|
21852
|
+
|
|
21853
|
+
HTTP/2 only:
|
|
21854
|
+
|
|
21855
|
+
```ts
|
|
21856
|
+
import { setResponseTrailers } from "@nifrajs/node-engine"
|
|
21857
|
+
|
|
21858
|
+
app.get("/report", (c) => {
|
|
21859
|
+
setResponseTrailers(c.req, { "x-checksum": "abc123" })
|
|
21860
|
+
return { ok: true }
|
|
21861
|
+
})
|
|
21862
|
+
```
|
|
21863
|
+
|
|
21864
|
+
Pass the `Request` the engine made (`c.req`, or the first `fetch` argument), not a copy, and call it before the body ends: a streamed body can call it from its last `pull`. It returns `false`, and sets nothing, on HTTP/1.1, once the response is complete, or for a name that cannot be a trailer (a pseudo-header, a connection field, `content-length`, `host`, `te`).
|
|
21865
|
+
|
|
21866
|
+
### HTTP/2 benchmarks
|
|
21867
|
+
|
|
21868
|
+
There are none yet. HTTP/2 here is covered by correctness tests only, and no throughput or latency figure for it has been measured or is quoted anywhere in this package. Figures for this repository's public pages come from the benchmark-accuracy CI run, not from a developer machine, and that run has no HTTP/2 target.
|
|
21869
|
+
|
|
21870
|
+
To measure it, use a client that speaks HTTP/2 and is not itself the limit:
|
|
21871
|
+
|
|
21872
|
+
```bash
|
|
21873
|
+
# cleartext, prior knowledge
|
|
21874
|
+
h2load -c 64 -m 10 -D 10 http://127.0.0.1:3000/hello
|
|
21875
|
+
# TLS, negotiated by ALPN
|
|
21876
|
+
h2load -c 64 -m 10 -D 10 https://127.0.0.1:3000/hello
|
|
21877
|
+
# the same server over HTTP/1.1, for the comparison that matters
|
|
21878
|
+
h2load -c 64 -m 10 -D 10 --h1 http://127.0.0.1:3000/hello
|
|
21879
|
+
```
|
|
21880
|
+
|
|
21881
|
+
`h2load` ships with nghttp2. `oha --http2` and `bombardier --http2` also work, but on a fast server they run out of client before the server does, so a figure from them says little about the server. A comparison is only fair against another server on the same machine, with the same route, the same TLS settings, and `http2: true` on this one. Report the scope with every number: runtime and engine version, cleartext or TLS, connections and streams per connection, and whether the client was the bottleneck.
|
|
21882
|
+
|
|
21883
|
+
## WebSockets
|
|
21884
|
+
|
|
21885
|
+
An app that exposes `resolveWebSocketUpgrade` (every nifra app does) serves its `app.ws()` routes. A plain `{ fetch }` handler cannot, and a handshake to it is refused with 501.
|
|
21886
|
+
|
|
21887
|
+
- A guard's rejection answers the handshake with its own status, headers and body. A path with no socket route is answered by its HTTP route.
|
|
21888
|
+
- Text arrives as a `string`, binary as a `Uint8Array`. A handler that throws reaches the route's `error()` and never ends the connection.
|
|
21889
|
+
- `ws.close()` refuses a code or reason a server may not send, with a `RangeError`, as on the other adapters.
|
|
21890
|
+
- `ws.raw` is an `EngineSocket`: `id`, `headers()`, `query()` and `remoteAddress()` of the handshake. The engine keeps no socket object to hand out.
|
|
21891
|
+
- The engine takes one message cap per listener. Unless `wsMaxMessageSize` is set, it is the largest `wsMaxPayloadBytes` among the app and the apps mounted in it that serve sockets, else the engine's 16 MiB. A route whose app declares less is held to its own, and a message over it closes the socket with 1009.
|
|
21892
|
+
|
|
21893
|
+
- The peer's close code and close reason (`ws.close` / `handler.close`) are reported verbatim, and `ws.getBufferedAmount()` / `handler.drain` track per-socket backpressure.
|
|
21894
|
+
|
|
21895
|
+
## Notes on buffered vs streaming request bodies
|
|
21896
|
+
|
|
21897
|
+
- By default, request bodies are buffered up to `maxBodySize` plus `oversizeWindow`; a body past the window gets the engine's empty 413 rather than the app's own error.
|
|
21898
|
+
- Set `engine.streamRequestBodies: true` to stream HTTP/1.1 and HTTP/2 request bodies incrementally with socket/window backpressure. `requestTimeoutMs` bounds the whole upload, and an HTTP/2 peer that sends more than the larger of `http2.initialWindowSize` and 65535 bytes into a paused stream has that stream reset. `maxBodySize` does not apply to a streamed body: the route's `bodyLimit` does, except that `c.boundedBody(maxBytes)` and `c.boundedJson(maxBytes)` use the cap they are given, which may be larger. Where no route limit applies (a `bodyLimit: "unlimited"` route, or an `onRequest` hook), the request's own readers (`text()`, `json()`, `arrayBuffer()`, `bytes()`, `blob()`, `formData()`, `clone()`) are held to `maxBodySize` and answer 413 past it; reading `req.body` yourself has no cap.
|
|
21899
|
+
|
|
21900
|
+
## Certificate reload
|
|
21901
|
+
|
|
21902
|
+
```ts
|
|
21903
|
+
running.reloadTls({ cert, key }) // a new certificate
|
|
21904
|
+
running.reloadTls() // read the current files again
|
|
21905
|
+
```
|
|
21906
|
+
|
|
21907
|
+
New handshakes, HTTP/1.1 and HTTP/2, get the new certificate; connections already open keep theirs. The argument is the whole `tls` shape, not a diff. With none, the current `tls` options are read again, which is how rotated certificate files are picked up. Session tickets carry over, so resumption survives the new certificate. It throws, leaving the certificate in place, on material the engine refuses, on a server without `tls`, and after `stop()`. Nothing watches the files; call it from a signal handler or a timer.
|
|
21908
|
+
|
|
21909
|
+
## Failed streams
|
|
21910
|
+
|
|
21911
|
+
When a streamed body fails after its head is out, the response is cut so the client sees a failure instead of a complete answer. The engine has no call that cuts one connection, so this uses two of its own behaviours:
|
|
21912
|
+
|
|
21913
|
+
| Response | HTTP/1.1 | HTTP/2 |
|
|
21914
|
+
|---|---|---|
|
|
21915
|
+
| Declared `Content-Length`, body falls short | Connection closed | Stream reset |
|
|
21916
|
+
| No declared length | Connection closed, no chunk terminator | Stream reset |
|
|
21917
|
+
|
|
21918
|
+
The failure is also reported through the app's error hook.
|
|
21919
|
+
|
|
21920
|
+
## Clustering
|
|
21921
|
+
|
|
21922
|
+
```ts
|
|
21923
|
+
import { serveCluster } from "@nifrajs/node-engine/cluster"
|
|
21924
|
+
|
|
21925
|
+
const node = await serveCluster(() => buildApp(), { port: 3000, workers: 4 })
|
|
21926
|
+
if (node.role === "primary") {
|
|
21927
|
+
// node.workers(), node.stop(), node.restart(), node.reloadTls()
|
|
21928
|
+
}
|
|
21929
|
+
```
|
|
21930
|
+
|
|
21931
|
+
A primary process supervises worker processes that each run the engine on the same port with `SO_REUSEPORT`, so the kernel spreads accepted connections across them. The file runs in the primary and again in every worker, as with `node:cluster`; the app is built only in workers. `serveCluster` takes every `serve()` option plus:
|
|
21932
|
+
|
|
21933
|
+
| Option | Meaning |
|
|
21934
|
+
|---|---|
|
|
21935
|
+
| `workers` | Worker processes. Default: one per core. |
|
|
21936
|
+
| `respawn` | Replace a worker that dies. Default `true`; a worker that keeps dying within seconds of starting is given up on after ten tries. |
|
|
21937
|
+
| `onWorkerEvent` | Called in the primary with `listening` and `exit` events. |
|
|
21938
|
+
|
|
21939
|
+
The primary resolves once every worker is listening, and rejects after stopping the others if one cannot start. `stop()` and `gracefulSignals` drain every worker; one still alive well past the drain is killed. Workers share a set of TLS session-ticket keys, and the primary's `reloadTls()` reloads the certificate in every worker (PEM text or file names only, since it crosses a process boundary).
|
|
21940
|
+
|
|
21941
|
+
### Rolling restart
|
|
21942
|
+
|
|
21943
|
+
```ts
|
|
21944
|
+
process.on("SIGUSR2", () => void node.restart({ drainMs: 10_000 }))
|
|
21945
|
+
```
|
|
21946
|
+
|
|
21947
|
+
`restart()` replaces the workers one at a time: a new worker starts and is listening before the one it replaces is stopped, so the port is always served and capacity never drops. Each old worker gets the usual graceful stop (`drainMs`, `delayMs`). New workers run whatever the entry file and its imports are on disk when they start, which is how a deploy picks up new code without dropping the port. It resolves once the last old worker has exited.
|
|
21948
|
+
|
|
21949
|
+
If a new worker does not start within `startTimeoutMs` (default 30 s), the restart stops there and rejects: workers not yet replaced keep serving, and the ones already replaced stay replaced. `stop()` during a restart ends it. A second call while one is under way returns the first.
|
|
21950
|
+
|
|
21951
|
+
On Linux, closing a worker's listening socket resets the connections that were still being accepted on it, so a client can see a reset on a connection it opened in that instant. It is a small fraction of new connections and it scales with the connection rate. A client that retries an idempotent request once, as any client behind a load balancer does, does not notice: in testing, a second attempt never failed. On macOS no request failed. Setting `net.ipv4.tcp_migrate_req=1` makes the kernel hand those connections to the other workers, which reduced the resets in testing but also left some requests stalled until the client timed out, so it is not recommended with this engine.
|
|
21952
|
+
|
|
21953
|
+
`port` must be fixed: workers cannot share an ephemeral one. Windows has no `SO_REUSEPORT` and is refused. The Linux kernel balances accepts across the workers; macOS and BSD accept the shared bind but send new connections to one worker, so use it there for development only.
|
|
21954
|
+
|
|
21955
|
+
## Feature parity
|
|
21956
|
+
|
|
21957
|
+
`@nifrajs/node-engine` supports `static`, `fastResponse`, `compression`, `path` (Unix domain sockets), SNI multi-cert (`tls.serverNames` + `addServerName`/`removeServerName`), WebSocket native pub/sub + backpressure + peer close reason + RFC 8441 over HTTP/2, `> 4 GiB` response framing, and incremental streaming request bodies (`engine.streamRequestBodies`).
|
|
21958
|
+
|
|
21959
|
+
## Benchmark
|
|
21960
|
+
|
|
21961
|
+
`bench/compare.mjs` runs a rotated, serial `wrk` comparison on one Linux box, in two tiers:
|
|
21962
|
+
|
|
21963
|
+
- **Frameworks**, each answering the same three routes as an ordinary app: nifra on the Rust engine (`nifra-engine`, and `nifra-engine-host` with `validateHost`), on `@nifrajs/node-uws` (`nifra-uws`) and on `node:http` (`nifra-node`), and the Moro framework (`moro`). Workloads are a path-parameter GET, the same with a browser-sized header set, and 13 B and 1 KiB JSON POSTs with validation.
|
|
21964
|
+
- **Raw engines**, each driven directly by one shared handler (`bench/raw-handler.mjs`) with no router, hooks or content-type check, so every engine does the same work for the same bytes: `raw-nifra-engine` (the addon on its batch ABI), `raw-uws`, `raw-node` and `raw-moro-engine` (`@morojs/engine`).
|
|
21965
|
+
|
|
21966
|
+
The first table reports median req/s, spread, and each row's ratio to `moro` and to `nifra-uws`. The second divides each framework by its own raw engine, which is that framework's layer cost; comparing raw engines to each other is the engine gap. `nifra-engine#2` is an A/A control, so its gap to `nifra-engine` is noise. A framework row set against a raw row of another stack is not a like-for-like comparison.
|
|
21967
|
+
|
|
21968
|
+
Moro is a benchmark competitor only. No nifra package depends on it: `bench/moro` holds its own `package.json` and `package-lock.json` (outside the workspace), installed with `npm ci` and found through `MORO_DIR`.
|
|
21969
|
+
|
|
21970
|
+
```sh
|
|
21971
|
+
npm ci --prefix packages/node-engine/bench/moro --ignore-scripts
|
|
21972
|
+
ROOT="$PWD" MORO_DIR="$PWD/packages/node-engine/bench/moro" NIFRA_RUST_ENGINE_PATH=/path/to/nifra_napi.node node packages/node-engine/bench/compare.mjs
|
|
21973
|
+
```
|
|
21974
|
+
|
|
21975
|
+
Numbers that are reported come from the `Engine compare` workflow (manual dispatch), not from a developer machine. Configuration is environment: `ROUNDS`, `DURATION`, `TARGETS`, `WORKLOADS`, `OUT`.
|
|
21976
|
+
|
|
21977
|
+
## For AI agents
|
|
21978
|
+
|
|
21979
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
21980
|
+
|
|
21981
|
+
## @nifrajs/node-engine-darwin-arm64
|
|
21982
|
+
|
|
21983
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `darwin-arm64`.
|
|
21984
|
+
|
|
21985
|
+
## For AI agents
|
|
21986
|
+
|
|
21987
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-darwin-arm64/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
21988
|
+
|
|
21989
|
+
## @nifrajs/node-engine-darwin-x64
|
|
21990
|
+
|
|
21991
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `darwin-x64`.
|
|
21992
|
+
|
|
21993
|
+
## For AI agents
|
|
21994
|
+
|
|
21995
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-darwin-x64/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
21996
|
+
|
|
21997
|
+
## @nifrajs/node-engine-linux-arm64-gnu
|
|
21998
|
+
|
|
21999
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `linux-arm64-gnu`.
|
|
22000
|
+
|
|
22001
|
+
## For AI agents
|
|
22002
|
+
|
|
22003
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-linux-arm64-gnu/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
22004
|
+
|
|
22005
|
+
## @nifrajs/node-engine-linux-arm64-musl
|
|
22006
|
+
|
|
22007
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `linux-arm64-musl`.
|
|
22008
|
+
|
|
22009
|
+
## For AI agents
|
|
22010
|
+
|
|
22011
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-linux-arm64-musl/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
22012
|
+
|
|
22013
|
+
## @nifrajs/node-engine-linux-x64-gnu
|
|
22014
|
+
|
|
22015
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `linux-x64-gnu`.
|
|
22016
|
+
|
|
22017
|
+
## For AI agents
|
|
22018
|
+
|
|
22019
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-linux-x64-gnu/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
22020
|
+
|
|
22021
|
+
## @nifrajs/node-engine-linux-x64-musl
|
|
22022
|
+
|
|
22023
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `linux-x64-musl`.
|
|
22024
|
+
|
|
22025
|
+
## For AI agents
|
|
22026
|
+
|
|
22027
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-linux-x64-musl/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
22028
|
+
|
|
22029
|
+
## @nifrajs/node-engine-win32-x64
|
|
22030
|
+
|
|
22031
|
+
Prebuilt native Rust engine binary for `@nifrajs/node-engine` on `win32-x64`.
|
|
22032
|
+
|
|
22033
|
+
## For AI agents
|
|
22034
|
+
|
|
22035
|
+
See the [package contract card](https://github.com/nifrajs/nifra/blob/main/packages/node-engine-win32-x64/LLM.md) and the [full Nifra corpus](https://github.com/nifrajs/nifra/blob/main/llms-full.txt).
|
|
22036
|
+
|
|
21663
22037
|
## @nifrajs/node-uws
|
|
21664
22038
|
|
|
21665
22039
|
Serve a [nifra](../../README.md) app on [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js)
|
|
@@ -22415,10 +22789,12 @@ import { assertSafeKey, StorageKeyError } from "@nifrajs/storage"
|
|
|
22415
22789
|
|
|
22416
22790
|
## API
|
|
22417
22791
|
|
|
22418
|
-
- `new MemoryStorage()` · `new FileStorage(root)` · `new R2Storage(bucket, { maxReadBytes? })`.
|
|
22792
|
+
- `new MemoryStorage()` · `new FileStorage(root, { maxReadBytes?, maxMetadataBytes? })` · `new R2Storage(bucket, { maxReadBytes? })`.
|
|
22419
22793
|
- `put(key, data, { contentType?, metadata? })` - `data` is `Uint8Array | ArrayBuffer | string`.
|
|
22420
22794
|
- `get(key)` → `{ body, size, contentType?, metadata? } | null` · `delete(key)` · `exists(key)` · `list({ prefix?, limit? })`.
|
|
22421
|
-
`R2Storage.get`
|
|
22795
|
+
`R2Storage.get` and `FileStorage.get` default to a 16 MiB read limit and throw a `RangeError` for
|
|
22796
|
+
oversized objects. `FileStorage` applies a separate 16 MiB limit, `maxMetadataBytes`, to an object's
|
|
22797
|
+
metadata file. `put` has no limit: raise the read limit to read back larger objects.
|
|
22422
22798
|
`FileStorage.list` reads and sorts each directory it enters, so even `limit: 1` costs time in
|
|
22423
22799
|
proportion to those directories' entries; split a very large store across key prefixes.
|
|
22424
22800
|
- `assertSafeKey(key)` / `StorageKeyError` · `toBytes(data)`.
|
|
@@ -23319,7 +23695,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
23319
23695
|
|
|
23320
23696
|
## @nifrajs/coding-agent
|
|
23321
23697
|
|
|
23322
|
-
`AGENT_CAPABILITY_MANIFEST_VERSION`, `AGENT_PRESETS`, `APPROVAL_NEVER_EXPIRES_AT`, `AgentCapability`, `AgentCapabilityManifest`, `AgentPlan`, `AgentPreset`, `AgentPresetName`, `ApprovalDecision`, `ApprovalManager`, `ApprovalManagerOptions`, `ApprovalMatchRejection`, `ApprovalMatchResult`, `ApprovalRequest`, `ApprovalTimeout`, `BoundedSubagentRunner`, `BoundedText`, `CapabilityDescriptor`, `CiDeploymentAdapter`, `CodingAgentExtension`, `CodingAgentHost`, `CodingAgentHostOptions`, `CodingAgentRpcServer`, `CodingAgentRpcServerHandle`, `CodingAgentRpcServerOptions`, `CompactionReport`, `ContextRecord`, `ContextWindow`, `ContextWindowOptions`, `DEPLOYMENT_REFERENCE_PROFILES`, `ExtensionCommand`, `ExtensionContext`, `ExtensionDescriptorOptions`, `ExtensionDescriptorSource`, `ExtensionEventHandler`, `ExtensionHost`, `ExtensionHostOptions`, `ExtensionProvider`, `ExtensionReloadResult`, `ExtensionSubagent`, `ExtensionTool`, `FileSessionStore`, `FileSessionStoreOptions`, `HandoffCoordinator`, `HandoffCoordinatorOptions`, `HandoffDecision`, `HandoffError`, `HandoffRejection`, `HandoffView`, `HealingEvent`, `HealingOptions`, `HealingResult`, `IsolatedExtensionSnapshot`, `IsolatedExtensionTool`, `IsolatedExtensionWorker`, `IsolatedExtensionWorkerOptions`, `LocalProcessDeploymentAdapter`, `MigrateLegacySessionOptions`, `NIFRA_AGENT_INSTRUCTIONS`, `NativeApprovalPort`, `NativeApprovalRequest`, `NativeGatewayModelPortOptions`, `NativeMessage`, `NativeModelChunk`, `NativeModelPort`, `NativeModelRequest`, `NativeModelResponse`, `NativeReviewAnswer`, `NativeTool`, `NifraAgentTool`, `NifraBackend`, `NifraBackendOptions`, `NifraContextOptions`, `NifraContextResult`, `OpenHandoffInput`, `PiBackend`, `PiBackendOptions`, `PlanEvent`, `PlanPhase`, `PlanResult`, `PlanRunner`, `PlanRunnerOptions`, `ProjectDiffOptions`, `ProjectDiffResult`, `RepairProposal`, `ReplayBackend`, `ReplayBackendOptions`, `ReplayDeploymentAdapter`, `ReviewExecutionErrorCode`, `ReviewExecutionResult`, `ReviewOptions`, `SESSION_EVIDENCE_VERSION`, `SelfHealingController`, `SessionEvidenceRecord`, `SessionLogEntry`, `SessionMigrationError`, `SessionMigrationReport`, `SessionStore`, `SubagentAbandonment`, `SubagentAbandonmentLedger`, `SubagentChildLedger`, `SubagentExecutor`, `SubagentResult`, `SubagentRunnerOptions`, `SubagentSpec`, `UiExtensionHost`, `UiExtensionHostOptions`, `UiExtensionManifest`, `UiExtensionSlot`, `UiReloadResult`, `UiStatusWidget`, `UiThemeDescriptor`, `VerificationOptions`, `VerificationRepairTask`, `VerificationResult`, `WorkflowContext`, `WorkflowEvent`, `WorkflowResult`, `WorkflowRunner`, `WorkflowRunnerOptions`, `WorkflowStep`, `approvalRequestFromEvent`, `approvalResolvedEvent`, `createCapabilityManifest`, `createCiDeploymentAdapter`, `createLocalProcessDeploymentAdapter`, `createNativeGatewayModelPort`, `createNifraTools`, `createPresetSpec`, `createReplayDeploymentAdapter`, `createVerificationRepairTask`, `deniedCapabilities`, `discoverExtensions`, `extensionDescriptor`, `extensionDescriptors`, `getAgentPreset`, `isSafeReviewDiff`, `isVerificationAvailable`, `migrateLegacySession`, `parseCapabilityManifest`, `parseSessionEvidenceRecord`, `readBoundedText`, `readProjectDiff`, `readReplayEvents`, `runNifraContext`, `runNifraReview`, `runNifraVerification`, `stableSessionEventCode`, `validateExtensionModule`
|
|
23698
|
+
`AGENT_CAPABILITY_MANIFEST_VERSION`, `AGENT_PRESETS`, `APPROVAL_NEVER_EXPIRES_AT`, `AgentCapability`, `AgentCapabilityManifest`, `AgentPlan`, `AgentPreset`, `AgentPresetName`, `ApprovalDecision`, `ApprovalManager`, `ApprovalManagerOptions`, `ApprovalMatchRejection`, `ApprovalMatchResult`, `ApprovalRequest`, `ApprovalTimeout`, `BoundedSubagentRunner`, `BoundedText`, `CapabilityDescriptor`, `CiDeploymentAdapter`, `CodingAgentExtension`, `CodingAgentHost`, `CodingAgentHostOptions`, `CodingAgentRpcServer`, `CodingAgentRpcServerHandle`, `CodingAgentRpcServerOptions`, `CompactionReport`, `ContainerSandboxProfile`, `ContextRecord`, `ContextWindow`, `ContextWindowOptions`, `CustomSandboxProfile`, `DEPLOYMENT_REFERENCE_PROFILES`, `ExtensionCommand`, `ExtensionContext`, `ExtensionDescriptorOptions`, `ExtensionDescriptorSource`, `ExtensionEventHandler`, `ExtensionHost`, `ExtensionHostOptions`, `ExtensionProvider`, `ExtensionReloadResult`, `ExtensionSandboxProfile`, `ExtensionSubagent`, `ExtensionTool`, `FileSessionStore`, `FileSessionStoreOptions`, `HandoffCoordinator`, `HandoffCoordinatorOptions`, `HandoffDecision`, `HandoffError`, `HandoffRejection`, `HandoffView`, `HealingEvent`, `HealingOptions`, `HealingResult`, `IsolatedExtensionSnapshot`, `IsolatedExtensionTool`, `IsolatedExtensionWorker`, `IsolatedExtensionWorkerOptions`, `LocalProcessDeploymentAdapter`, `MacOsSeatbeltSandboxProfile`, `MigrateLegacySessionOptions`, `NIFRA_AGENT_INSTRUCTIONS`, `NativeApprovalPort`, `NativeApprovalRequest`, `NativeGatewayModelPortOptions`, `NativeMessage`, `NativeModelChunk`, `NativeModelPort`, `NativeModelRequest`, `NativeModelResponse`, `NativeReviewAnswer`, `NativeTool`, `NifraAgentTool`, `NifraBackend`, `NifraBackendOptions`, `NifraContextOptions`, `NifraContextResult`, `OpenHandoffInput`, `PiBackend`, `PiBackendOptions`, `PlanEvent`, `PlanPhase`, `PlanResult`, `PlanRunner`, `PlanRunnerOptions`, `ProjectDiffOptions`, `ProjectDiffResult`, `RepairProposal`, `ReplayBackend`, `ReplayBackendOptions`, `ReplayDeploymentAdapter`, `ReviewExecutionErrorCode`, `ReviewExecutionResult`, `ReviewOptions`, `SESSION_EVIDENCE_VERSION`, `SandboxedSpawnSpec`, `SelfHealingController`, `SessionEvidenceRecord`, `SessionLogEntry`, `SessionMigrationError`, `SessionMigrationReport`, `SessionStore`, `SubagentAbandonment`, `SubagentAbandonmentLedger`, `SubagentChildLedger`, `SubagentExecutor`, `SubagentResult`, `SubagentRunnerOptions`, `SubagentSpec`, `UiExtensionHost`, `UiExtensionHostOptions`, `UiExtensionManifest`, `UiExtensionSlot`, `UiReloadResult`, `UiStatusWidget`, `UiThemeDescriptor`, `VerificationOptions`, `VerificationRepairTask`, `VerificationResult`, `WorkflowContext`, `WorkflowEvent`, `WorkflowResult`, `WorkflowRunner`, `WorkflowRunnerOptions`, `WorkflowStep`, `approvalRequestFromEvent`, `approvalResolvedEvent`, `buildSandboxedSpawn`, `buildSeatbeltProfile`, `createCapabilityManifest`, `createCiDeploymentAdapter`, `createLocalProcessDeploymentAdapter`, `createNativeGatewayModelPort`, `createNifraTools`, `createPresetSpec`, `createReplayDeploymentAdapter`, `createVerificationRepairTask`, `deniedCapabilities`, `discoverExtensions`, `extensionDescriptor`, `extensionDescriptors`, `getAgentPreset`, `isSafeReviewDiff`, `isVerificationAvailable`, `migrateLegacySession`, `parseCapabilityManifest`, `parseSessionEvidenceRecord`, `readBoundedText`, `readProjectDiff`, `readReplayEvents`, `runNifraContext`, `runNifraReview`, `runNifraVerification`, `stableSessionEventCode`, `validateExtensionModule`
|
|
23323
23699
|
|
|
23324
23700
|
## @nifrajs/content
|
|
23325
23701
|
|
|
@@ -23401,6 +23777,10 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
23401
23777
|
|
|
23402
23778
|
`FetchHandler`, `HashedFiles`, `NodeServer`, `NodeStopOptions`, `RequestProtocol`, `RequestProtocolOption`, `ServeOptions`, `ServeStaticOptions`, `serve`, `serveStatic`
|
|
23403
23779
|
|
|
23780
|
+
## @nifrajs/node-engine
|
|
23781
|
+
|
|
23782
|
+
`CompressionOptions`, `ConnectHandler`, `EngineServer`, `EngineSocket`, `EngineTuning`, `FetchHandler`, `Http2Options`, `NodeCompatPair`, `NodeMiddleware`, `NodeMiddlewareContextLike`, `NodeRequestListener`, `NodeStopOptions`, `PeerCertificateInfo`, `ProbeResult`, `ServeOptions`, `TlsOptions`, `TlsSniEntry`, `WsDeflateOptions`, `bodyCeiling`, `createNodeCompat`, `fromNodeHandler`, `fromNodeMiddleware`, `getPeerCertificate`, `isNativeAvailable`, `mayServeSockets`, `payloadCeiling`, `probe`, `serve`, `serveStatic`, `setResponseTrailers`, `writeEarlyHints`, `writeInformational`
|
|
23783
|
+
|
|
23404
23784
|
## @nifrajs/node-uws
|
|
23405
23785
|
|
|
23406
23786
|
`FetchHandler`, `NodeStopOptions`, `ServeOptions`, `UwsServer`, `UwsTlsOptions`, `serve`
|
|
@@ -23431,7 +23811,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
23431
23811
|
|
|
23432
23812
|
## @nifrajs/storage
|
|
23433
23813
|
|
|
23434
|
-
`BeaconingStorageAdapter`, `CapabilityBeacon`, `FileStorage`, `ListOptions`, `MemoryStorage`, `MovableStorageAdapter`, `PagedStorageAdapter`, `PresignableStorageAdapter`, `PutOptions`, `R2BucketLike`, `R2ObjectLike`, `R2Storage`, `StorageAdapter`, `StorageAdapterConformanceError`, `StorageAdapterConformanceOptions`, `StorageBeaconOptions`, `StorageCapabilities`, `StorageData`, `StorageKeyError`, `StorageListPage`, `StorageListPageOptions`, `StorageObject`, `StoragePresignOperation`, `StoragePresignOptions`, `StoragePresignedUrl`, `assertSafeKey`, `assertStorageAdapterConformance`, `toBytes`, `withCapabilityBeacon`
|
|
23814
|
+
`BeaconingStorageAdapter`, `CapabilityBeacon`, `FileStorage`, `GcsStorage`, `GcsStorageOptions`, `ListOptions`, `MemoryStorage`, `MovableStorageAdapter`, `PagedStorageAdapter`, `PresignableStorageAdapter`, `PutOptions`, `R2BucketLike`, `R2ObjectLike`, `R2Storage`, `S3Storage`, `S3StorageOptions`, `StorageAdapter`, `StorageAdapterConformanceError`, `StorageAdapterConformanceOptions`, `StorageBeaconOptions`, `StorageCapabilities`, `StorageData`, `StorageKeyError`, `StorageListPage`, `StorageListPageOptions`, `StorageObject`, `StorageObjectMetadata`, `StoragePresignOperation`, `StoragePresignOptions`, `StoragePresignedUrl`, `StorageStreamObject`, `StreamableStorageAdapter`, `assertSafeKey`, `assertStorageAdapterConformance`, `toBytes`, `withCapabilityBeacon`
|
|
23435
23815
|
|
|
23436
23816
|
## @nifrajs/testing
|
|
23437
23817
|
|
|
@@ -23451,7 +23831,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
23451
23831
|
|
|
23452
23832
|
## @nifrajs/web
|
|
23453
23833
|
|
|
23454
|
-
`ACTION_GLOBAL`, `Action`, `BOUNDARY_GLOBAL`, `BackendOnly`, `Blocker`, `BlockerController`, `BlockerFunction`, `BlockerLocation`, `BlockerState`, `Boundary`, `BoundaryDescriptor`, `BoundaryError`, `BoundaryLoaderEntry`, `BoundaryLoadersOf`, `BoundaryMode`, `BoundaryRegistration`, `BoundaryRequestCtx`, `BoundaryState`, `BoundaryStates`, `BoundaryStatus`, `BrowserNavigate`, `BuildAssetSet`, `CacheStore`, `CachedResponse`, `CdnPurgeOutcome`, `CdnPurgeTarget`, `ClientAction`, `ClientActionArgs`, `ClientActionResult`, `ClientLoader`, `ClientLoaderArgs`, `ClientRequestBody`, `ClientRouteHooks`, `ClientRouter`, `ClientRouterOptions`, `CreateCspPolicyOptions`, `CreateNonceResolverOptions`, `CreateWebAppOptions`, `CspHeaderContext`, `CspPolicy`, `CssLoadingMode`, `DATA_GLOBAL`, `DATA_HEADER`, `DEFAULT_CSS_LOADING`, `DEFAULT_DEV_PORT`, `DRAFT_COOKIE`, `DataText`, `Deferred`, `DehydrateOptions`, `DehydratedQueryInfo`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `Href`, `HrefOptions`, `HrefRefusal`, `HtmlSanitizer`, `IDLE_BLOCKER`, `ISRApp`, `ISROptions`, `ISRPlatform`, `ISRQuery`, `ISRStoreOp`, `ISR_REVALIDATE_HEADER`, `ISR_REVALIDATE_TAGS_HEADER`, `ISR_STATUS_HEADER`, `IdentityEpochContext`, `InertScriptType`, `InfiniteData`, `InfiniteQueryHandle`, `InfiniteQueryOptions`, `InterceptBoundary`, `Intercepted`, `KVCacheStore`, `KVCacheStoreOptions`, `KVNamespaceLike`, `KeepAliveOptions`, `KeepAliveServerOptions`, `KeptPage`, `LAYOUT_DATA_GLOBAL`, `LOCALES_GLOBAL`, `LayoutEntry`, `LinkDescriptor`, `LiveClientEntry`, `Loader`, `LoaderContext`, `LoaderResponseControls`, `LoadingEntry`, `Manifest`, `MatchChain`, `MemoryCacheStore`, `MemoryCacheStoreOptions`, `MemoryStaticBoundaryCache`, `Meta`, `MetaArgs`, `MetaDescriptor`, `MetaInput`, `MiddlewareOutcome`, `MountRouterOptions`, `MutationCallbacks`, `MutationCancelledError`, `MutationContext`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `ParamsOfFrom`, `PendingBoundary`, `PlainKeyDefault`, `PlainQueryKey`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `QueryClient`, `QueryClientOptions`, `QueryHandle`, `QueryKey`, `QueryOptions`, `QueryState`, `QueryStatus`, `REDIRECT_HEADER`, `RETAIN_HEADER`, `REVALIDATE_HEADER`, `ROOT_ATTRIBUTE`, `ROUTE_GLOBAL`, `RedirectOptions`, `RenderAdapter`, `RenderAdapterConformanceError`, `RenderAdapterConformanceFixture`, `RenderAssemblyCache`, `RenderPageInput`, `RenderPageOptions`, `RenderProps`, `RenderStreamOptions`, `RenderedPage`, `RevalidateEndpointOptions`, `RevalidateOptions`, `RevalidateResult`, `RevalidateTags`, `RevalidateTagsInput`, `RouteEntry`, `RouteFrom`, `RouteMatch`, `RouteMiddleware`, `RouteModule`, `RouteParamsOf`, `RoutePattern`, `RouteSearchInOf`, `RouteSearchOf`, `RouteSlotName`, `RouteSlotPatternsOf`, `RouteSlotRegistry`, `RouteSlotTarget`, `RouteTable`, `RouteTablePattern`, `RouterState`, `SERVER_FN_MODULE`, `STATUS_HEADER`, `SanitizedHtml`, `ScriptDescriptor`, `SearchInputOf`, `SearchOf`, `SearchOfFrom`, `SharedBoundary`, `SharedHoleCtx`, `ShellCtx`, `ShouldRevalidate`, `ShouldRevalidateArgs`, `SsrModuleLoader`, `StaticBoundary`, `StaticBoundaryCache`, `StaticBoundaryImportEdge`, `StaticBoundaryRoot`, `StaticCtx`, `StaticPath`, `StaticPaths`, `StaticRoutes`, `StatusPageOptions`, `Submission`, `SubmitOptions`, `TrustedHtml`, `UIMatch`, `UnsafeScriptDescriptor`, `WebAppI18n`, `assertCssLoadingCompatible`, `assertRenderAdapterConformance`, `assertStaticBoundaryImports`, `boundaryDescriptors`, `boundaryModeKey`, `buildManifest`, `canonical`, `closeBoundary`, `createClientRouter`, `createCspPolicy`, `createHostPolicy`, `createMatcher`, `createMutation`, `createNonceResolver`, `createQueryClient`, `createWebApp`, `defer`, `disableDraft`, `enableDraft`, `enumerateStaticRoutes`, `filePathToPattern`, `filePathToPatterns`, `fontFace`, `fontPreload`, `generateClientEntry`, `generateServerManifest`, `getBrowserNavigate`, `gone`, `hashQueryKey`, `href`, `isCacheablePage`, `isDraftEnabled`, `isHostPolicy`, `isInertHref`, `jsonLd`, `localeOfProps`, `mergeHeads`, `nifraScriptHashes`, `normalizeCssLoading`, `notFound`, `onHrefRefused`, `openGraph`, `pageLocaleIn`, `prerenderedPageReader`, `previewEndpoint`, `queryKey`, `rawHref`, `redirect`, `registerBlocker`, `renderPage`, `renderPageResult`, `resolveChainMeta`, `resolveDynamicBoundaries`, `resolveMeta`, `resolvePublicPath`, `resolveStaticBoundaries`, `revalidate`, `revalidateEndpoint`, `rotateIdentityEpoch`, `sanitizeHtml`, `sanitizedHtml`, `searchOf`, `searchOfChain`, `serializeData`, `serializeSearch`, `setBlockerController`, `setBrowserNavigate`, `setSsrModuleLoader`, `ssrModuleLoader`, `startDynamicBoundaries`, `statusPage`, `trustHtml`, `unsafeInlineScript`, `webProjectEvidence`, `withISR`
|
|
23834
|
+
`ACTION_GLOBAL`, `Action`, `BOUNDARY_GLOBAL`, `BackendOnly`, `Blocker`, `BlockerController`, `BlockerFunction`, `BlockerLocation`, `BlockerState`, `Boundary`, `BoundaryDescriptor`, `BoundaryError`, `BoundaryLoaderEntry`, `BoundaryLoadersOf`, `BoundaryMode`, `BoundaryRegistration`, `BoundaryRequestCtx`, `BoundaryState`, `BoundaryStates`, `BoundaryStatus`, `BrowserNavigate`, `BuildAssetSet`, `CacheStore`, `CachedResponse`, `CdnPurgeOutcome`, `CdnPurgeTarget`, `ClientAction`, `ClientActionArgs`, `ClientActionResult`, `ClientLoader`, `ClientLoaderArgs`, `ClientRequestBody`, `ClientRouteHooks`, `ClientRouter`, `ClientRouterOptions`, `CreateCspPolicyOptions`, `CreateNonceResolverOptions`, `CreateWebAppOptions`, `CspHeaderContext`, `CspPolicy`, `CssLoadingMode`, `DATA_GLOBAL`, `DATA_HEADER`, `DEFAULT_CSS_LOADING`, `DEFAULT_DEV_PORT`, `DRAFT_COOKIE`, `DataText`, `Deferred`, `DehydrateOptions`, `DehydratedQueryInfo`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `Href`, `HrefOptions`, `HrefRefusal`, `HtmlSanitizer`, `IDLE_BLOCKER`, `ISRApp`, `ISROptions`, `ISRPlatform`, `ISRQuery`, `ISRStoreOp`, `ISR_REVALIDATE_HEADER`, `ISR_REVALIDATE_TAGS_HEADER`, `ISR_STATUS_HEADER`, `IdentityEpochContext`, `InertScriptType`, `InfiniteData`, `InfiniteQueryHandle`, `InfiniteQueryOptions`, `InterceptBoundary`, `Intercepted`, `KVCacheStore`, `KVCacheStoreOptions`, `KVNamespaceLike`, `KeepAliveOptions`, `KeepAliveServerOptions`, `KeptPage`, `LAYOUT_DATA_GLOBAL`, `LOCALES_GLOBAL`, `LayoutEntry`, `LinkDescriptor`, `LiveClientEntry`, `Loader`, `LoaderContext`, `LoaderResponseControls`, `LoadingEntry`, `Manifest`, `MatchChain`, `MemoryCacheStore`, `MemoryCacheStoreOptions`, `MemoryStaticBoundaryCache`, `Meta`, `MetaArgs`, `MetaDescriptor`, `MetaInput`, `MiddlewareOutcome`, `MountRouterOptions`, `MutationCallbacks`, `MutationCancelledError`, `MutationContext`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `ParamsOfFrom`, `PendingBoundary`, `PlainKeyDefault`, `PlainQueryKey`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `QueryClient`, `QueryClientOptions`, `QueryHandle`, `QueryKey`, `QueryOptions`, `QueryState`, `QueryStatus`, `REDIRECT_HEADER`, `RETAIN_HEADER`, `REVALIDATE_HEADER`, `ROOT_ATTRIBUTE`, `ROUTE_GLOBAL`, `RedirectOptions`, `RenderAdapter`, `RenderAdapterConformanceError`, `RenderAdapterConformanceFixture`, `RenderAssemblyCache`, `RenderPageInput`, `RenderPageOptions`, `RenderProps`, `RenderStreamOptions`, `RenderedPage`, `RevalidateEndpointOptions`, `RevalidateOptions`, `RevalidateResult`, `RevalidateTags`, `RevalidateTagsInput`, `RouteEntry`, `RouteFrom`, `RouteMatch`, `RouteMiddleware`, `RouteModule`, `RouteParamsOf`, `RoutePattern`, `RouteSearchInOf`, `RouteSearchOf`, `RouteSlotName`, `RouteSlotPatternsOf`, `RouteSlotRegistry`, `RouteSlotTarget`, `RouteTable`, `RouteTablePattern`, `RouterState`, `SERVER_FN_MODULE`, `STATUS_HEADER`, `SanitizedHtml`, `ScriptDescriptor`, `SearchInputOf`, `SearchOf`, `SearchOfFrom`, `SharedBoundary`, `SharedHoleCtx`, `ShellCtx`, `ShouldRevalidate`, `ShouldRevalidateArgs`, `SsrModuleLoader`, `StaticBoundary`, `StaticBoundaryCache`, `StaticBoundaryImportEdge`, `StaticBoundaryRoot`, `StaticCtx`, `StaticPath`, `StaticPaths`, `StaticRoutes`, `StatusPageOptions`, `Submission`, `SubmitOptions`, `TrustedHtml`, `UIMatch`, `UnsafeScriptDescriptor`, `WebAppI18n`, `assertCssLoadingCompatible`, `assertRenderAdapterConformance`, `assertStaticBoundaryImports`, `boundaryDescriptors`, `boundaryModeKey`, `buildManifest`, `canonical`, `closeBoundary`, `createClientRouter`, `createCspPolicy`, `createHostPolicy`, `createMatcher`, `createMutation`, `createNonceResolver`, `createQueryClient`, `createWebApp`, `defer`, `disableDraft`, `enableDraft`, `enumerateStaticRoutes`, `filePathToPattern`, `filePathToPatterns`, `fontFace`, `fontPreload`, `generateClientEntry`, `generateServerManifest`, `getBrowserNavigate`, `gone`, `hashQueryKey`, `href`, `isCacheablePage`, `isDraftEnabled`, `isHostPolicy`, `isInertHref`, `jsonLd`, `localeOfProps`, `memoizeSearchSchema`, `mergeHeads`, `nifraScriptHashes`, `normalizeCssLoading`, `notFound`, `onHrefRefused`, `openGraph`, `pageLocaleIn`, `prerenderedPageReader`, `previewEndpoint`, `queryKey`, `rawHref`, `redirect`, `registerBlocker`, `renderPage`, `renderPageResult`, `resolveChainMeta`, `resolveDynamicBoundaries`, `resolveMeta`, `resolvePublicPath`, `resolveStaticBoundaries`, `revalidate`, `revalidateEndpoint`, `rotateIdentityEpoch`, `sanitizeHtml`, `sanitizedHtml`, `searchOf`, `searchOfChain`, `serializeData`, `serializeSearch`, `setBlockerController`, `setBrowserNavigate`, `setSsrModuleLoader`, `ssrModuleLoader`, `startDynamicBoundaries`, `statusPage`, `trustHtml`, `unsafeInlineScript`, `webProjectEvidence`, `withISR`
|
|
23455
23835
|
|
|
23456
23836
|
## @nifrajs/web-preact
|
|
23457
23837
|
|