@nifrajs/cli 5.7.0 → 5.9.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/CHANGELOG.md +150 -0
- package/dist/agent-files.d.ts +0 -22
- package/dist/agent-files.d.ts.map +1 -1
- package/dist/agent-files.js +3 -1
- package/dist/agent-files.js.map +1 -1
- package/dist/assure-hydration.d.ts.map +1 -1
- package/dist/assure-hydration.js +2 -10
- package/dist/assure-hydration.js.map +1 -1
- package/dist/assure.d.ts.map +1 -1
- package/dist/assure.js +3 -3
- package/dist/assure.js.map +1 -1
- package/dist/check-scan.d.ts +2 -0
- package/dist/check-scan.d.ts.map +1 -1
- package/dist/check-scan.js +54 -86
- package/dist/check-scan.js.map +1 -1
- package/dist/check.d.ts +3 -0
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +20 -23
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +42 -13
- package/dist/cli.js.map +1 -1
- package/dist/command-catalog.d.ts.map +1 -1
- package/dist/command-catalog.js +20 -30
- package/dist/command-catalog.js.map +1 -1
- package/dist/config-target.js +1 -1
- package/dist/config-target.js.map +1 -1
- package/dist/db-child.js +3 -10
- package/dist/db-child.js.map +1 -1
- package/dist/db-config.d.ts +2 -0
- package/dist/db-config.d.ts.map +1 -1
- package/dist/db-config.js +2 -0
- package/dist/db-config.js.map +1 -1
- package/dist/doctor.d.ts +14 -3
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +91 -6
- package/dist/doctor.js.map +1 -1
- package/dist/frontend-guidance.d.ts +19 -0
- package/dist/frontend-guidance.d.ts.map +1 -1
- package/dist/frontend-guidance.js +267 -23
- package/dist/frontend-guidance.js.map +1 -1
- package/dist/hand-built-manifest.d.ts.map +1 -1
- package/dist/hand-built-manifest.js +1 -1
- package/dist/hand-built-manifest.js.map +1 -1
- package/dist/internal/control-character.d.ts +3 -0
- package/dist/internal/control-character.d.ts.map +1 -0
- package/dist/internal/control-character.js +10 -0
- package/dist/internal/control-character.js.map +1 -0
- package/dist/internal/escape-regexp.d.ts +3 -0
- package/dist/internal/escape-regexp.d.ts.map +1 -0
- package/dist/internal/escape-regexp.js +5 -0
- package/dist/internal/escape-regexp.js.map +1 -0
- package/dist/internal/line-at.d.ts +3 -0
- package/dist/internal/line-at.d.ts.map +1 -0
- package/dist/internal/line-at.js +5 -0
- package/dist/internal/line-at.js.map +1 -0
- package/dist/internal/nifra-project.d.ts.map +1 -1
- package/dist/internal/nifra-project.js +35 -41
- package/dist/internal/nifra-project.js.map +1 -1
- package/dist/internal/posix-path.d.ts +3 -0
- package/dist/internal/posix-path.d.ts.map +1 -0
- package/dist/internal/posix-path.js +5 -0
- package/dist/internal/posix-path.js.map +1 -0
- package/dist/internal/project-specifiers.d.ts.map +1 -1
- package/dist/internal/project-specifiers.js +3 -10
- package/dist/internal/project-specifiers.js.map +1 -1
- package/dist/internal/realpath-or-self.d.ts +3 -0
- package/dist/internal/realpath-or-self.d.ts.map +1 -0
- package/dist/internal/realpath-or-self.js +11 -0
- package/dist/internal/realpath-or-self.js.map +1 -0
- package/dist/internal/record.d.ts +3 -0
- package/dist/internal/record.d.ts.map +1 -0
- package/dist/internal/record.js +5 -0
- package/dist/internal/record.js.map +1 -0
- package/dist/internal/source-facts.d.ts.map +1 -1
- package/dist/internal/source-facts.js +28 -25
- package/dist/internal/source-facts.js.map +1 -1
- package/dist/introspect.d.ts +0 -22
- package/dist/introspect.d.ts.map +1 -1
- package/dist/introspect.js +11 -151
- package/dist/introspect.js.map +1 -1
- package/dist/levels-tool.d.ts +2 -0
- package/dist/levels-tool.d.ts.map +1 -1
- package/dist/levels-tool.js +54 -64
- package/dist/levels-tool.js.map +1 -1
- package/dist/load.d.ts +6 -1
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js.map +1 -1
- package/dist/local-cli.d.ts +7 -0
- package/dist/local-cli.d.ts.map +1 -1
- package/dist/local-cli.js +13 -0
- package/dist/local-cli.js.map +1 -1
- package/dist/mcp-docs-tools.d.ts +1 -1
- package/dist/mcp-docs-tools.d.ts.map +1 -1
- package/dist/mcp-docs-tools.js +46 -3
- package/dist/mcp-docs-tools.js.map +1 -1
- package/dist/mcp-http.d.ts +1 -1
- package/dist/mcp-http.js +2 -2
- package/dist/mcp-io.d.ts +16 -0
- package/dist/mcp-io.d.ts.map +1 -1
- package/dist/mcp-io.js +63 -0
- package/dist/mcp-io.js.map +1 -1
- package/dist/mcp-isolate.d.ts.map +1 -1
- package/dist/mcp-isolate.js +2 -1
- package/dist/mcp-isolate.js.map +1 -1
- package/dist/mcp-project-child.d.ts.map +1 -1
- package/dist/mcp-project-child.js +5 -12
- package/dist/mcp-project-child.js.map +1 -1
- package/dist/mcp-render.d.ts.map +1 -1
- package/dist/mcp-render.js +9 -51
- package/dist/mcp-render.js.map +1 -1
- package/dist/mcp-root.js +1 -1
- package/dist/mcp-root.js.map +1 -1
- package/dist/mcp-run.d.ts.map +1 -1
- package/dist/mcp-run.js +3 -46
- package/dist/mcp-run.js.map +1 -1
- package/dist/mcp-ws.d.ts.map +1 -1
- package/dist/mcp-ws.js +2 -18
- package/dist/mcp-ws.js.map +1 -1
- package/dist/migrate-layout.d.ts.map +1 -1
- package/dist/migrate-layout.js +36 -57
- package/dist/migrate-layout.js.map +1 -1
- package/dist/output-schemas.d.ts.map +1 -1
- package/dist/output-schemas.js +7 -7
- package/dist/output-schemas.js.map +1 -1
- package/dist/port.d.ts.map +1 -1
- package/dist/port.js +1 -2
- package/dist/port.js.map +1 -1
- package/dist/ppr-read-fix.js +2 -2
- package/dist/ppr-read-fix.js.map +1 -1
- package/dist/recipes/5.8.0.d.ts +9 -0
- package/dist/recipes/5.8.0.d.ts.map +1 -0
- package/dist/recipes/5.8.0.js +20 -0
- package/dist/recipes/5.8.0.js.map +1 -0
- package/dist/recipes/5.9.0.d.ts +10 -0
- package/dist/recipes/5.9.0.d.ts.map +1 -0
- package/dist/recipes/5.9.0.js +41 -0
- package/dist/recipes/5.9.0.js.map +1 -0
- package/dist/recipes/index.d.ts +5 -0
- package/dist/recipes/index.d.ts.map +1 -1
- package/dist/recipes/index.js +4 -0
- package/dist/recipes/index.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +9 -13
- package/dist/review.js.map +1 -1
- package/dist/rules/contract-visibility.d.ts.map +1 -1
- package/dist/rules/contract-visibility.js +3 -9
- package/dist/rules/contract-visibility.js.map +1 -1
- package/dist/rules/data-guard.d.ts.map +1 -1
- package/dist/rules/data-guard.js +3 -10
- package/dist/rules/data-guard.js.map +1 -1
- package/dist/rules/pages.d.ts.map +1 -1
- package/dist/rules/pages.js +41 -58
- package/dist/rules/pages.js.map +1 -1
- package/dist/rules/routes.d.ts.map +1 -1
- package/dist/rules/routes.js +20 -27
- package/dist/rules/routes.js.map +1 -1
- package/dist/rules/security.d.ts.map +1 -1
- package/dist/rules/security.js +206 -313
- package/dist/rules/security.js.map +1 -1
- package/dist/rules/zones.d.ts.map +1 -1
- package/dist/rules/zones.js +3 -10
- package/dist/rules/zones.js.map +1 -1
- package/dist/runtime-differences.d.ts +62 -0
- package/dist/runtime-differences.d.ts.map +1 -0
- package/dist/runtime-differences.js +222 -0
- package/dist/runtime-differences.js.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +43 -43
- package/dist/sdk.js.map +1 -1
- package/dist/smoke.d.ts.map +1 -1
- package/dist/smoke.js +4 -12
- package/dist/smoke.js.map +1 -1
- package/dist/source-rewrites.d.ts +27 -0
- package/dist/source-rewrites.d.ts.map +1 -0
- package/dist/source-rewrites.js +402 -0
- package/dist/source-rewrites.js.map +1 -0
- package/dist/stylex-migrate.d.ts.map +1 -1
- package/dist/stylex-migrate.js +1 -1
- package/dist/stylex-migrate.js.map +1 -1
- package/dist/symptom-search.d.ts +5 -0
- package/dist/symptom-search.d.ts.map +1 -0
- package/dist/symptom-search.js +21 -0
- package/dist/symptom-search.js.map +1 -0
- package/dist/upgrade.d.ts +28 -3
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +153 -64
- package/dist/upgrade.js.map +1 -1
- package/dist/verification-plan.d.ts.map +1 -1
- package/dist/verification-plan.js +5 -3
- package/dist/verification-plan.js.map +1 -1
- package/docs/examples.json +32 -2
- package/docs/llms-full.txt +749 -95
- package/docs/types.json +300 -61
- package/package.json +11 -11
- package/src/agent-files.ts +4 -1
- package/src/assure-hydration.ts +2 -9
- package/src/assure.ts +3 -4
- package/src/check-scan.ts +65 -82
- package/src/check.ts +25 -23
- package/src/cli.ts +61 -13
- package/src/command-catalog.ts +22 -32
- package/src/config-target.ts +1 -1
- package/src/db-child.ts +3 -10
- package/src/db-config.ts +4 -0
- package/src/doctor.ts +128 -12
- package/src/frontend-guidance.ts +344 -25
- package/src/hand-built-manifest.ts +1 -2
- package/src/internal/control-character.ts +8 -0
- package/src/internal/escape-regexp.ts +4 -0
- package/src/internal/line-at.ts +4 -0
- package/src/internal/nifra-project.ts +39 -35
- package/src/internal/posix-path.ts +4 -0
- package/src/internal/project-specifiers.ts +3 -10
- package/src/internal/realpath-or-self.ts +10 -0
- package/src/internal/record.ts +4 -0
- package/src/internal/source-facts.ts +39 -29
- package/src/introspect.ts +16 -156
- package/src/levels-tool.ts +71 -78
- package/src/load.ts +6 -1
- package/src/local-cli.ts +12 -0
- package/src/mcp-docs-tools.ts +51 -3
- package/src/mcp-http.ts +2 -2
- package/src/mcp-io.ts +77 -0
- package/src/mcp-isolate.ts +2 -3
- package/src/mcp-project-child.ts +5 -14
- package/src/mcp-render.ts +11 -59
- package/src/mcp-root.ts +1 -1
- package/src/mcp-run.ts +5 -54
- package/src/mcp-ws.ts +2 -19
- package/src/migrate-layout.ts +52 -72
- package/src/output-schemas.ts +7 -8
- package/src/port.ts +1 -4
- package/src/ppr-read-fix.ts +2 -2
- package/src/recipes/5.8.0.ts +21 -0
- package/src/recipes/5.9.0.ts +42 -0
- package/src/recipes/index.ts +9 -0
- package/src/review.ts +12 -15
- package/src/rules/contract-visibility.ts +3 -8
- package/src/rules/data-guard.ts +3 -10
- package/src/rules/pages.ts +47 -58
- package/src/rules/routes.ts +21 -27
- package/src/rules/security.ts +224 -255
- package/src/rules/zones.ts +3 -10
- package/src/runtime-differences.ts +302 -0
- package/src/sdk.ts +55 -58
- package/src/smoke.ts +4 -13
- package/src/source-rewrites.ts +463 -0
- package/src/stylex-migrate.ts +1 -3
- package/src/symptom-search.ts +27 -0
- package/src/upgrade.ts +194 -74
- package/src/verification-plan.ts +10 -4
package/docs/llms-full.txt
CHANGED
|
@@ -2067,6 +2067,11 @@ function Row({ id }: { id: string }) {
|
|
|
2067
2067
|
const anyPending = useFetchers().some((f) => f.snapshot().pending)
|
|
2068
2068
|
```
|
|
2069
2069
|
|
|
2070
|
+
A fetcher holds nothing for the next visitor: `identityChanged()` returns every
|
|
2071
|
+
fetcher to idle, and a load still in flight loads once more for the new visitor. In an app with a [keepAlive](/docs/keep-alive#sign-in) route, so
|
|
2072
|
+
does the identity epoch cookie a sign-in or sign-out response rotates, on the next
|
|
2073
|
+
`useFetcher` read.
|
|
2074
|
+
|
|
2070
2075
|
## Nifra - Rendering: SSR, streaming, SSG & ISR
|
|
2071
2076
|
|
|
2072
2077
|
> Render critical HTML first, stream deferred data progressively, prerender static routes, and cache rendered pages with stale-while-revalidate - on every runtime including the edge.
|
|
@@ -3174,6 +3179,15 @@ In an app with [live refresh](/docs/live), a query can name the live keys its da
|
|
|
3174
3179
|
depends on: `useQuery(key, fn, { live: [`post:${id}`] })` refetches whenever
|
|
3175
3180
|
the server publishes one of them.
|
|
3176
3181
|
|
|
3182
|
+
### Sign-in and sign-out
|
|
3183
|
+
|
|
3184
|
+
A cached query never answers for the next visitor. `identityChanged()` from
|
|
3185
|
+
`@nifrajs/web/client` clears every query client in the page: mounted queries go
|
|
3186
|
+
back to pending and refetch, the rest drop their data. A fetch still loading loads once more
|
|
3187
|
+
for the new visitor before it settles. In an app with a
|
|
3188
|
+
[keepAlive](/docs/keep-alive#sign-in) route, the identity epoch cookie a sign-in
|
|
3189
|
+
or sign-out response rotates does the same on the client's next read.
|
|
3190
|
+
|
|
3177
3191
|
It's the same agnostic core under every adapter: the cache, dedup, and invalidation logic
|
|
3178
3192
|
live in `@nifrajs/web`; each binding is a thin wrapper in its framework's own
|
|
3179
3193
|
reactivity (`useSyncExternalStore`, a signal, a `shallowRef`, a store).
|
|
@@ -3571,6 +3585,51 @@ sent. When none answers, the error is logged and the client gets the default
|
|
|
3571
3585
|
`500`. A thrown `Response` or `status()` value is sent as
|
|
3572
3586
|
if returned.
|
|
3573
3587
|
|
|
3588
|
+
#### State that follows the request
|
|
3589
|
+
|
|
3590
|
+
A value tied to one request - a verified client IP, a request id, an auth decision - is often
|
|
3591
|
+
kept in a `WeakMap<Request, T>`, which loses it at the first copy of the
|
|
3592
|
+
request. nifra copies requests itself: a `mount()` that strips its prefix, a
|
|
3593
|
+
WebSocket pass reused for HTTP, a target it resolves, and the transport and idempotency
|
|
3594
|
+
lanes, as do `methodOverride()`, a rewriting `trimTrailingSlash()` or
|
|
3595
|
+
`appendTrailingSlash()`, and a live load. `requestLocal<T>()` from
|
|
3596
|
+
`@nifrajs/core/server` is a slot with `get`, `set`,
|
|
3597
|
+
`has` and `delete` whose value every one of those copies shares: a
|
|
3598
|
+
value set before a mount is read in the child, and one the child sets is read through the
|
|
3599
|
+
parent's request. Where your own code rebuilds a request - a wrapper in front of the app,
|
|
3600
|
+
an `onRequest` hook returning a new one - call
|
|
3601
|
+
`carryRequestLocals(from, to)` right after `new Request(url, req)`; a
|
|
3602
|
+
copy made without it starts empty. Values are held weakly and never cross requests. Make
|
|
3603
|
+
slots at startup, as below: copies are linked only once a first slot exists, so a request
|
|
3604
|
+
copied before then starts empty.
|
|
3605
|
+
|
|
3606
|
+
```ts
|
|
3607
|
+
import { carryRequestLocals, requestLocal, server } from "@nifrajs/core/server"
|
|
3608
|
+
|
|
3609
|
+
// One slot per value. A WeakMap<Request, T> would lose it at the first copy of the request.
|
|
3610
|
+
const requestId = requestLocal<string>()
|
|
3611
|
+
|
|
3612
|
+
const billing = server().get("/invoices", (c) => ({ requestId: requestId.get(c.req) }))
|
|
3613
|
+
|
|
3614
|
+
export const app = server()
|
|
3615
|
+
.onRequest((req) => {
|
|
3616
|
+
requestId.set(req, req.headers.get("x-request-id") ?? crypto.randomUUID())
|
|
3617
|
+
})
|
|
3618
|
+
// The child sees a copy of the request with /billing stripped, and reads the same value.
|
|
3619
|
+
.mount({ path: "/billing", app: billing, stripPrefix: true })
|
|
3620
|
+
|
|
3621
|
+
// A wrapper that rebuilds the request carries the values itself. It keeps the host, which the
|
|
3622
|
+
// same-origin check on a form POST compares with the browser's Origin.
|
|
3623
|
+
export const fetch = (req: Request): Response | Promise<Response> => {
|
|
3624
|
+
const url = new URL(req.url)
|
|
3625
|
+
if (!url.pathname.startsWith("/v1/")) return app.fetch(req)
|
|
3626
|
+
url.pathname = url.pathname.slice("/v1".length)
|
|
3627
|
+
const rebuilt = new Request(url.href, req)
|
|
3628
|
+
carryRequestLocals(req, rebuilt)
|
|
3629
|
+
return app.fetch(rebuilt)
|
|
3630
|
+
}
|
|
3631
|
+
```
|
|
3632
|
+
|
|
3574
3633
|
#### Which hooks run where
|
|
3575
3634
|
|
|
3576
3635
|
Where a hook is registered decides which requests it sees. `nifra routes --hooks`
|
|
@@ -4002,6 +4061,44 @@ const app = server().use(
|
|
|
4002
4061
|
)
|
|
4003
4062
|
```
|
|
4004
4063
|
|
|
4064
|
+
A tier's `prefix` can be a list: every prefix in it charges the tier's one bucket,
|
|
4065
|
+
so traffic of one kind spread over several paths shares one allowance. Selection is still the
|
|
4066
|
+
longest prefix across every tier, so a longer prefix that belongs to another tier charges only
|
|
4067
|
+
that tier. A prefix listed in two tiers is refused when the limiter is built. A tier counts
|
|
4068
|
+
under `tier:<name>:`, and `name` defaults to the first prefix; name
|
|
4069
|
+
a tier whose list may change, so editing the list neither resets nor splits its counters. Two
|
|
4070
|
+
tiers with one name are refused too. Both limiters have `keyOf(request, platform?)`,
|
|
4071
|
+
which resolves to the exact store key a request would be charged to, running an async key and
|
|
4072
|
+
its client-IP fallback as a request would, or `undefined` when the request would not
|
|
4073
|
+
be charged. It counts nothing, so a test can pre-spend or reset a bucket without copying the key
|
|
4074
|
+
format.
|
|
4075
|
+
|
|
4076
|
+
```ts
|
|
4077
|
+
import { server } from "@nifrajs/core/server"
|
|
4078
|
+
import { MemoryStore, rateLimitTiers } from "@nifrajs/middleware"
|
|
4079
|
+
|
|
4080
|
+
const store = new MemoryStore()
|
|
4081
|
+
const limiter = rateLimitTiers({
|
|
4082
|
+
store,
|
|
4083
|
+
floor: { max: 120, windowMs: 60_000 },
|
|
4084
|
+
tiers: [
|
|
4085
|
+
// One 30/min allowance across all three, not 30 each. The name is the bucket's
|
|
4086
|
+
// store scope, so adding or removing a prefix later keeps the live counters.
|
|
4087
|
+
{
|
|
4088
|
+
name: "exports",
|
|
4089
|
+
prefix: ["/api/exports", "/api/reports/download", "/api/invoices/pdf"],
|
|
4090
|
+
max: 30,
|
|
4091
|
+
windowMs: 60_000,
|
|
4092
|
+
},
|
|
4093
|
+
],
|
|
4094
|
+
})
|
|
4095
|
+
const app = server().use(limiter)
|
|
4096
|
+
|
|
4097
|
+
// The store key a request is charged to, for a test or an ops tool: "tier:exports:<ip>".
|
|
4098
|
+
const key = await limiter.keyOf(new Request("http://x/api/exports/csv"), { clientIp: "203.0.113.9" })
|
|
4099
|
+
if (key !== undefined) await store.hit(key, 60_000) // pre-spend one hit
|
|
4100
|
+
```
|
|
4101
|
+
|
|
4005
4102
|
### A shared store in production
|
|
4006
4103
|
|
|
4007
4104
|
`MemoryStore` counts per instance, so it refuses to start under
|
|
@@ -5375,9 +5472,10 @@ rewritten onto, or set `trustHost` when a proxy you control fixes the host. Give
|
|
|
5375
5472
|
### Set up a session manager
|
|
5376
5473
|
|
|
5377
5474
|
`createSessions` signs the cookie (HMAC, verified constant-time) and always marks it
|
|
5378
|
-
`HttpOnly`. In **store mode** the cookie is
|
|
5379
|
-
|
|
5380
|
-
`
|
|
5475
|
+
`HttpOnly`. In **store mode** the cookie is an opaque id, with a tag that changes
|
|
5476
|
+
whenever the data that says who the visitor is does, and the data lives in a
|
|
5477
|
+
`SessionStore`; in **cookie mode** (no store) the data is signed into the
|
|
5478
|
+
cookie. `MemorySessionStore` is prod-guarded. Production store mode needs a strongly
|
|
5381
5479
|
consistent shared `SessionStore`, such as a transactional adapter or Durable Object.
|
|
5382
5480
|
Every instance must observe completed writes and deletes, including revocation markers.
|
|
5383
5481
|
|
|
@@ -5397,6 +5495,13 @@ session lives at most `maxAge`, whatever expiry its payload names. Upgrading fro
|
|
|
5397
5495
|
session-shaped value the app signs with the same secret through `signValue` reads
|
|
5398
5496
|
as a session.
|
|
5399
5497
|
|
|
5498
|
+
`identity` names the data keys that say who the visitor is: the user id, and any
|
|
5499
|
+
key that changes what a page may show, such as an organization or a role. The cookie's tag,
|
|
5500
|
+
in either mode, then changes only when one of them does, so
|
|
5501
|
+
[keep-alive](/docs/keep-alive#sign-in) keeps the pages it holds across a commit
|
|
5502
|
+
that writes a cart or a preference. Unset, every key counts. A key left out that decides what
|
|
5503
|
+
a page shows lets the next visitor of a browser see the pages kept for the previous one.
|
|
5504
|
+
|
|
5400
5505
|
```ts
|
|
5401
5506
|
// backend/auth.ts - one session manager, created on first use so the secret is read at request time.
|
|
5402
5507
|
// Store mode keeps data server-side; cookie mode (no store) is stateless.
|
|
@@ -5406,6 +5511,7 @@ let manager: ReturnType<typeof createSessions> | undefined
|
|
|
5406
5511
|
export const getSessions = () => (manager ??= createSessions({
|
|
5407
5512
|
secret: process.env.SESSION_SECRET!, // at least 32 bytes; never reuse another signing secret
|
|
5408
5513
|
store: new MemorySessionStore(), // production: a strongly consistent shared SessionStore
|
|
5514
|
+
// identity: ["userId", "orgId", "role"], // the keys that say who the visitor is; unset, all of them
|
|
5409
5515
|
// cookie: { secure: false }, // local http dev only
|
|
5410
5516
|
}))
|
|
5411
5517
|
```
|
|
@@ -7000,6 +7106,20 @@ The scaffold declares it. The trust holds only while that edge is the one way in
|
|
|
7000
7106
|
bundle served by `wrangler pages dev` or a self-hosted workerd takes the header from
|
|
7001
7107
|
the client, so drop the line before serving it publicly any other way.
|
|
7002
7108
|
|
|
7109
|
+
A SIGTERM or SIGINT kills the Bun, Node and Deno servers at once unless
|
|
7110
|
+
`nifra.config.ts` exports a `selfHost` that sets
|
|
7111
|
+
`gracefulSignals`, such as
|
|
7112
|
+
`export const selfHost = { gracefulSignals: { drainMs: 8_000 }, idleTimeoutSec: 60 }`.
|
|
7113
|
+
With `gracefulSignals` the server drains instead (`docker stop`,
|
|
7114
|
+
Ctrl-C): in-flight requests get `drainMs` to finish, and `delayMs` keeps
|
|
7115
|
+
it serving first while a load balancer sees it go. `idleTimeoutSec` is how long Bun
|
|
7116
|
+
keeps a connection that moves no bytes, a request whose handler is still working included:
|
|
7117
|
+
a whole number from `0` (never) to `255`, 10 by default. Node and Deno
|
|
7118
|
+
do not close a connection while its request is being handled, so they ignore it, and an edge
|
|
7119
|
+
build ignores
|
|
7120
|
+
`selfHost`. `nifra start` runs the built server, so it applies there
|
|
7121
|
+
too.
|
|
7122
|
+
|
|
7003
7123
|
Nifra never runs the deploy or enters your cloud credentials - it scaffolds the config + a
|
|
7004
7124
|
`deploy` script that shells out to the vendor CLI you've already authed.
|
|
7005
7125
|
|
|
@@ -7095,10 +7215,21 @@ store (signed with one `storeSecret` in every process - see
|
|
|
7095
7215
|
-
|
|
7096
7216
|
`@nifrajs/deno` - serves `app.fetch` on `Deno.serve`.
|
|
7097
7217
|
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7218
|
+
The servers that `nifra build --target node` and `--target deno` emit
|
|
7219
|
+
run on these adapters, so the app installs the one for its target, from the same release as
|
|
7220
|
+
`@nifrajs/web`. Each server's `static` sees every request first: it
|
|
7221
|
+
answers with a file's response, or `undefined` to let the app route it. The
|
|
7222
|
+
generated servers serve their client bundle and `public/` files that way.
|
|
7223
|
+
|
|
7224
|
+
Self-hosting (no CDN in front)? Hand `serve` a `serveStatic` mount, from
|
|
7225
|
+
`@nifrajs/node` or `@nifrajs/deno` (on Bun,
|
|
7226
|
+
`@nifrajs/core/serve-static` for `listen()`), and it serves the client
|
|
7227
|
+
bundle from disk - traversal-guarded, content-typed, with an immutable cache - before the app
|
|
7228
|
+
runs, leaving the SSR fast path untouched:
|
|
7229
|
+
`
|
|
7230
|
+
serve(app, { port, static: serveStatic({ dir: new URL("./assets/", import.meta.url) }) })
|
|
7231
|
+
`
|
|
7232
|
+
.
|
|
7102
7233
|
On Cloudflare/Vercel the platform serves assets, so you don't need it there.
|
|
7103
7234
|
|
|
7104
7235
|
Every file under the mount is cached as immutable by default. If the directory also holds
|
|
@@ -7601,7 +7732,11 @@ pins are installed it would judge the release you are leaving, and the command p
|
|
|
7601
7732
|
install to run first instead. With `--write` it also saves the hook report from
|
|
7602
7733
|
before the edits and, once the target is installed, prints how hook scope changed across the
|
|
7603
7734
|
upgrade (`--no-hooks` skips that); before then,
|
|
7604
|
-
`nifra routes --hooks --since` compares after the
|
|
7735
|
+
`nifra routes --hooks --since .nifra/hooks-before-upgrade.json` compares after the
|
|
7736
|
+
install. Run from a CLI whose
|
|
7737
|
+
`@nifrajs/core` is not the project's - `bunx @nifrajs/cli@<new>
|
|
7738
|
+
upgrade` before the new release is installed - it takes no hook report, since that
|
|
7739
|
+
copy cannot reflect the project's app, and says so in one line.
|
|
7605
7740
|
`nifra doctor` and
|
|
7606
7741
|
`nifra check` (NF-D002) point here when a workspace carries more than one version;
|
|
7607
7742
|
see [mixed nifra versions](/docs/troubleshooting#mixed-versions). A
|
|
@@ -7914,9 +8049,9 @@ URL
|
|
|
7914
8049
|
none
|
|
7915
8050
|
|
|
7916
8051
|
tables a query may not read (`name`, or `schema.name` on Postgres),
|
|
7917
|
-
also through views, CTEs, partitions and child tables. On Postgres the
|
|
7918
|
-
|
|
7919
|
-
`REVOKE` that `nifra db role` prints
|
|
8052
|
+
also through views, CTEs, partitions and child tables. On Postgres the role itself must be
|
|
8053
|
+
unable to read it, or any view over it, so a function body or a materialized view cannot
|
|
8054
|
+
reach it either; the `REVOKE` that `nifra db role` prints does that
|
|
7920
8055
|
|
|
7921
8056
|
`query`
|
|
7922
8057
|
|
|
@@ -7944,10 +8079,13 @@ columns a query may not read on top of the credential-name rule, and columns it
|
|
|
7944
8079
|
none
|
|
7945
8080
|
SQLite: paths outside the project the file may resolve to
|
|
7946
8081
|
|
|
7947
|
-
`allowHosts`, `allowExtensions`, `
|
|
8082
|
+
`allowHosts`, `allowExtensions`, `allowFunctions`,
|
|
8083
|
+
`schemas`
|
|
8084
|
+
|
|
8085
|
+
none, none, none, public
|
|
7948
8086
|
|
|
7949
|
-
|
|
7950
|
-
|
|
8087
|
+
Postgres: remote hosts, extensions to accept, functions to trust past the allowlist
|
|
8088
|
+
(`name` or `schema.name`), schemas a query may read
|
|
7951
8089
|
|
|
7952
8090
|
Each call runs in a fresh process that loads the declaration, answers and exits:
|
|
7953
8091
|
|
|
@@ -7963,11 +8101,14 @@ statement, lock and idle timeouts, always rolled back, inside a session that sta
|
|
|
7963
8101
|
|
|
7964
8102
|
-
|
|
7965
8103
|
**Layers that each refuse on their own.** One statement, read-only, checked by a
|
|
7966
|
-
tokenizer
|
|
7967
|
-
`
|
|
7968
|
-
|
|
7969
|
-
`
|
|
7970
|
-
|
|
8104
|
+
tokenizer. On Postgres every function the statement or its plan calls is looked up in
|
|
8105
|
+
`pg_proc` and must be immutable or stable, parallel safe when it ships with
|
|
8106
|
+
Postgres or an extension, and not SECURITY DEFINER, so `pg_sleep`,
|
|
8107
|
+
`set_config`, advisory locks, `dblink` and functions that run SQL from
|
|
8108
|
+
a string are refused unless `allowFunctions` names them. The statement runs as one
|
|
8109
|
+
extended-protocol `DECLARE CURSOR`, which the server accepts only for SELECT and
|
|
8110
|
+
VALUES. Every table the plan reads (SQLite: every table its compiled statement opens) must be
|
|
8111
|
+
exposed.
|
|
7971
8112
|
|
|
7972
8113
|
-
|
|
7973
8114
|
**No superuser.** A Postgres superuser, a member of
|
|
@@ -7982,9 +8123,11 @@ untrusted language is refused too, unless `allowExtensions` names it.
|
|
|
7982
8123
|
credential (`password`, `token`, `secret`,
|
|
7983
8124
|
`api_key`, ...) or one in `redactColumns` is refused wherever the
|
|
7984
8125
|
query plan uses it: selected under another name, inside an expression, in a filter, through
|
|
7985
|
-
a view, or renamed by a table's column alias list.
|
|
7986
|
-
|
|
7987
|
-
|
|
8126
|
+
a view, or renamed by a table's column alias list. On Postgres the role must also be unable
|
|
8127
|
+
to read the column at all, so the database refuses it where no plan shows it: run
|
|
8128
|
+
`nifra db role`, which grants a table's other columns only. Every other value
|
|
8129
|
+
goes through the same redactor as the dev feed: keys, tokens, JWTs and the project's
|
|
8130
|
+
environment values.
|
|
7988
8131
|
|
|
7989
8132
|
-
|
|
7990
8133
|
**Data, not instructions.** Rows, and names from the schema, are marked
|
|
@@ -8045,6 +8188,23 @@ that role. The schema tool keeps working meanwhile.
|
|
|
8045
8188
|
The role can use dblink, postgres_fdw, file_fdw or an untrusted language, any of which reaches
|
|
8046
8189
|
outside this database. Use a role without it, or accept it in `allowExtensions`.
|
|
8047
8190
|
|
|
8191
|
+
#### NIFRA_DB_ROLE_GRANTS
|
|
8192
|
+
|
|
8193
|
+
The Postgres role may itself read what the declaration hides: a masked column, an excluded
|
|
8194
|
+
table or one inheriting from it, or a view or materialized view over any of them (or reaching
|
|
8195
|
+
outside `schemas`). A materialized view stores its rows and a function reads with
|
|
8196
|
+
no plan to check, so only the role's privileges can refuse those. Run `nifra db role`,
|
|
8197
|
+
apply its SQL, and connect as that role; run it again after adding a table or view, since
|
|
8198
|
+
default privileges grant every column of a new one. The role may not execute a SECURITY
|
|
8199
|
+
DEFINER function either (or an aggregate over one): it reads with its owner's rights through
|
|
8200
|
+
an operator, a cast, a view or another function, where no allowlist sees its name. Name it in
|
|
8201
|
+
`devDatabase.allowFunctions` to trust it. Otherwise the refusal names each grantee
|
|
8202
|
+
the role holds the privilege through, and every one must be revoked: PUBLIC, the role itself,
|
|
8203
|
+
and any role whose privileges it has, since a REVOKE from PUBLIC leaves a direct or inherited
|
|
8204
|
+
grant in place. `nifra db role` writes the REVOKE from the role itself as a statement
|
|
8205
|
+
and the others as comments, since they reach other roles; it lists the same for a table or
|
|
8206
|
+
column grant that would still expose hidden data.
|
|
8207
|
+
|
|
8048
8208
|
#### NIFRA_DB_QUERY_OFF
|
|
8049
8209
|
|
|
8050
8210
|
`devDatabase.query` is `false`. Only the schema tool answers.
|
|
@@ -8056,8 +8216,11 @@ tokenizer, the cursor, or the read-only transaction. Send one SELECT.
|
|
|
8056
8216
|
|
|
8057
8217
|
#### NIFRA_DB_FUNCTION_REFUSED
|
|
8058
8218
|
|
|
8059
|
-
The statement
|
|
8060
|
-
|
|
8219
|
+
The statement, or a view it reads, calls a function the allowlist refuses: one that is volatile
|
|
8220
|
+
(it can act outside the query: locks, settings, sequences, files, other sessions, another
|
|
8221
|
+
database), not parallel safe (it can run SQL of its own), or SECURITY DEFINER (it reads with
|
|
8222
|
+
its owner's privileges). Every function a name can resolve to is checked. Remove it, or name
|
|
8223
|
+
it in `allowFunctions` if you trust what it reads.
|
|
8061
8224
|
|
|
8062
8225
|
#### NIFRA_DB_TABLE_EXCLUDED
|
|
8063
8226
|
|
|
@@ -8252,7 +8415,10 @@ timeout, and closed sessions all fail closed, and `approvalTimeoutMs` bounds how
|
|
|
8252
8415
|
a pending decision can remain open: 5 minutes by default, at most 24 hours, or
|
|
8253
8416
|
`"never"` to wait until it is answered, cancelled, its turn ends, or the session
|
|
8254
8417
|
closes. The host's broker takes the same values as `approvals.timeoutMs` on
|
|
8255
|
-
`CodingAgentHost` and `CodingAgentRpcServer`.
|
|
8418
|
+
`CodingAgentHost` and `CodingAgentRpcServer`. An approval port's
|
|
8419
|
+
optional `review` may allow or deny a call before anyone is asked, with no approval
|
|
8420
|
+
events; any other answer, or a review still unsettled after `reviewTimeoutMs`,
|
|
8421
|
+
raises the approval as usual.
|
|
8256
8422
|
|
|
8257
8423
|
### Expose the same agent to other clients
|
|
8258
8424
|
|
|
@@ -10453,6 +10619,33 @@ export const handler = withISR(app, {
|
|
|
10453
10619
|
})
|
|
10454
10620
|
```
|
|
10455
10621
|
|
|
10622
|
+
An app that wants a nonce on every document still gets its header from nifra: pass
|
|
10623
|
+
`cspHeader` beside `nonce`, and each document nifra renders - a page, a
|
|
10624
|
+
status page, `_error`, a streamed or deferred one - carries the policy built from
|
|
10625
|
+
the nonce on its own scripts. A wrapper that rebuilds the request with
|
|
10626
|
+
`new Request(url, req)` (a mount that strips a prefix, a request id, an origin
|
|
10627
|
+
rewrite) no longer has to find which nonce a document used. `cspHeader` needs
|
|
10628
|
+
`nonce`, and is refused beside `csp` or a resolver made with its own
|
|
10629
|
+
`header`. The documents stay `private, no-store`.
|
|
10630
|
+
|
|
10631
|
+
```ts
|
|
10632
|
+
import { createNonceResolver, createWebApp } from "@nifrajs/web"
|
|
10633
|
+
|
|
10634
|
+
declare const adapter: import("@nifrajs/web").RenderAdapter
|
|
10635
|
+
declare const manifest: import("@nifrajs/web").Manifest
|
|
10636
|
+
|
|
10637
|
+
// A fresh nonce on every document, and nifra writes the header from that same value - on pages,
|
|
10638
|
+
// status pages, _error, and streamed or deferred documents - whatever rebuilds the Request in front.
|
|
10639
|
+
export const app = createWebApp({
|
|
10640
|
+
adapter,
|
|
10641
|
+
manifest,
|
|
10642
|
+
clientEntry: "/assets/client.js",
|
|
10643
|
+
nonce: createNonceResolver(),
|
|
10644
|
+
// `sources`: 'nonce-…' plus a sha256 hash per constant inline script nifra writes.
|
|
10645
|
+
cspHeader: ({ sources }) => `default-src 'self'; script-src 'self' ${sources}; object-src 'none'`,
|
|
10646
|
+
})
|
|
10647
|
+
```
|
|
10648
|
+
|
|
10456
10649
|
### The client ↔ server boundary
|
|
10457
10650
|
|
|
10458
10651
|
Loaders, actions, and head resolution run on the server. The client receives the loader's
|
|
@@ -10826,8 +11019,8 @@ Everything on this page in one file. The sections below explain each part. This
|
|
|
10826
11019
|
typechecks against the current packages.
|
|
10827
11020
|
|
|
10828
11021
|
```ts
|
|
10829
|
-
import {
|
|
10830
|
-
import { createCspPolicy, createWebApp
|
|
11022
|
+
import { ONE_DAY, serveStatic } from "@nifrajs/core/serve-static"
|
|
11023
|
+
import { createCspPolicy, createWebApp } from "@nifrajs/web"
|
|
10831
11024
|
import type { Manifest, RenderAdapter } from "@nifrajs/web"
|
|
10832
11025
|
|
|
10833
11026
|
// From your build: the framework adapter, the route manifest, and what buildClient() returned.
|
|
@@ -10842,11 +11035,16 @@ declare const build: {
|
|
|
10842
11035
|
declare const errors: { capture(error: unknown, tags: Record<string, string>): void }
|
|
10843
11036
|
|
|
10844
11037
|
// buildClient({ outDir: "dist/assets" }) writes the chunks where their /assets/ URLs point.
|
|
10845
|
-
const
|
|
10846
|
-
dir:
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
11038
|
+
const files = serveStatic([
|
|
11039
|
+
{ dir: new URL("./dist/assets/", import.meta.url), hashedFiles: build.assets, cacheControl: ONE_DAY },
|
|
11040
|
+
{
|
|
11041
|
+
dir: new URL("./public/", import.meta.url),
|
|
11042
|
+
prefix: "/",
|
|
11043
|
+
immutable: false,
|
|
11044
|
+
cacheControl: ONE_DAY,
|
|
11045
|
+
fallthrough: true,
|
|
11046
|
+
},
|
|
11047
|
+
])
|
|
10850
11048
|
|
|
10851
11049
|
const csp = createCspPolicy({
|
|
10852
11050
|
header: ({ sources }) => `default-src 'self'; script-src 'self' ${sources}; object-src 'none'`,
|
|
@@ -10860,48 +11058,71 @@ export const app = createWebApp({
|
|
|
10860
11058
|
styles: build.css ?? [],
|
|
10861
11059
|
csp,
|
|
10862
11060
|
server: { requestTimeoutMs: 15_000, gracefulSignals: { drainMs: 8_000 } },
|
|
10863
|
-
use: (app) => {
|
|
10864
|
-
app.onRequest(async (request) => (await bundle(request)) ?? (await publicFiles(request)))
|
|
10865
|
-
},
|
|
10866
11061
|
onLoaderError: (error, { route }) => errors.capture(error, { route }),
|
|
10867
11062
|
})
|
|
10868
11063
|
|
|
10869
|
-
app.listen(3000)
|
|
11064
|
+
app.listen(3000, { static: files })
|
|
10870
11065
|
```
|
|
10871
11066
|
|
|
10872
11067
|
### Static and hashed files
|
|
10873
11068
|
|
|
10874
|
-
`
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
11069
|
+
`serveStatic` serves directories under URL prefixes, with the same options on every
|
|
11070
|
+
runtime: import it from `@nifrajs/core/serve-static` on Bun, and from
|
|
11071
|
+
`@nifrajs/node` or `@nifrajs/deno` there. Pass it as
|
|
11072
|
+
`static`, which runs before every route. It answers `GET` and
|
|
11073
|
+
`HEAD` only, refuses paths that leave the directory or name a hidden file, sets the
|
|
11074
|
+
content type and `nosniff`, and handles range requests. A path no mount's prefix
|
|
11075
|
+
covers reaches your routes.
|
|
10879
11076
|
|
|
10880
11077
|
-
|
|
10881
|
-
**Hashed build output.**
|
|
10882
|
-
`
|
|
10883
|
-
|
|
10884
|
-
|
|
11078
|
+
**Hashed build output.** A mount's `prefix` defaults to `/assets`.
|
|
11079
|
+
Pass `buildClient()`'s `assets` as `hashedFiles`: those
|
|
11080
|
+
files get `immutable` for a year, and any other file gets
|
|
11081
|
+
`cacheControl`. A missing file under the prefix is a `404`, never a
|
|
11082
|
+
rendered page.
|
|
10885
11083
|
|
|
10886
11084
|
-
|
|
10887
|
-
**Your own files.** A second
|
|
10888
|
-
with
|
|
11085
|
+
**Your own files.** A second mount on `public/` serves them at
|
|
11086
|
+
`/`, with `fallthrough: true` so a path it has no file for reaches
|
|
11087
|
+
your routes.
|
|
10889
11088
|
|
|
10890
11089
|
-
|
|
10891
|
-
**
|
|
10892
|
-
`
|
|
11090
|
+
**Files hashed before the build.** The fonts `loadGoogleFont` writes into
|
|
11091
|
+
`public/fonts/` are in no manifest, so the `public/` mount names them
|
|
11092
|
+
with an array of patterns, matched on the encoded URL path, as below. A mount that serves
|
|
11093
|
+
both the build and such files takes a `(path) => boolean` predicate instead,
|
|
11094
|
+
with `assets` as `new Set(build.assets)`:
|
|
11095
|
+
`(path) => assets.has(path) || HASHED_FONT.test(path)`. A global or sticky
|
|
11096
|
+
pattern in the array is used without that flag, so `lastIndex` never skips a
|
|
11097
|
+
match; a predicate runs as written, so keep the patterns it tests free of `g`
|
|
11098
|
+
and `y`.
|
|
10893
11099
|
|
|
10894
|
-
|
|
10895
|
-
|
|
11100
|
+
```ts
|
|
11101
|
+
import { ONE_DAY, serveStatic } from "@nifrajs/core/serve-static"
|
|
11102
|
+
|
|
11103
|
+
// The fonts loadGoogleFont wrote into public/fonts/ are content-hashed; the rest of public/ is not.
|
|
11104
|
+
const HASHED_FONT = /^\/fonts\/[\w-]+-[0-9a-f]{16}\.woff2$/
|
|
11105
|
+
|
|
11106
|
+
export const publicFiles = serveStatic({
|
|
11107
|
+
dir: new URL("./public/", import.meta.url),
|
|
11108
|
+
prefix: "/",
|
|
11109
|
+
hashedFiles: [HASHED_FONT],
|
|
11110
|
+
cacheControl: ONE_DAY,
|
|
11111
|
+
fallthrough: true,
|
|
11112
|
+
})
|
|
11113
|
+
```
|
|
11114
|
+
|
|
11115
|
+
On Node and Deno, `serve()` takes the same mounts. On Node they run before the app
|
|
11116
|
+
builds a Web request, which keeps the direct request path for everything else:
|
|
10896
11117
|
|
|
10897
11118
|
```ts
|
|
10898
11119
|
// doc-check: skip - fragment: app and build are the createWebApp app and buildClient() output above.
|
|
10899
|
-
import { serve } from "@nifrajs/node"
|
|
11120
|
+
import { serve, serveStatic } from "@nifrajs/node" // or "@nifrajs/deno"
|
|
10900
11121
|
|
|
10901
11122
|
await serve(app, {
|
|
10902
11123
|
port: 3000,
|
|
10903
|
-
static: { dir: new URL("./dist/assets/", import.meta.url), hashedFiles: build.assets },
|
|
10904
|
-
|
|
11124
|
+
static: serveStatic({ dir: new URL("./dist/assets/", import.meta.url), hashedFiles: build.assets }),
|
|
11125
|
+
gracefulSignals: { drainMs: 8_000 },
|
|
10905
11126
|
})
|
|
10906
11127
|
```
|
|
10907
11128
|
|
|
@@ -10972,6 +11193,14 @@ before its own static files on Bun, Node and Deno, and before the Cloudflare wor
|
|
|
10972
11193
|
through the worker). Vercel serves files from its CDN before the function runs, so there the policy
|
|
10973
11194
|
governs pages and the API only.
|
|
10974
11195
|
|
|
11196
|
+
-
|
|
11197
|
+
**In your own server.** `static` runs before the app, so a file would skip
|
|
11198
|
+
the policy. Give each mount the check the generated entries use:
|
|
11199
|
+
`
|
|
11200
|
+
allow: (host, pathname) => hostPolicy.allows(host, pathname, buildAssets)
|
|
11201
|
+
`
|
|
11202
|
+
. A path it refuses reaches the app, which applies the policy and answers 404.
|
|
11203
|
+
|
|
10975
11204
|
-
|
|
10976
11205
|
**In development.** `nifra dev` serves the bundle and `public/`
|
|
10977
11206
|
ahead of the app, so only pages and the API are checked there.
|
|
@@ -11062,8 +11291,8 @@ running. On Bun, new connections can still arrive during that window, so the loa
|
|
|
11062
11291
|
should stop routing to the instance first, as most platforms do before they send
|
|
11063
11292
|
`SIGTERM`. Keep `drainMs` under your platform's kill grace period:
|
|
11064
11293
|
`docker stop` waits 10 seconds. `true` uses the default. On Node and
|
|
11065
|
-
Deno, pass
|
|
11066
|
-
`
|
|
11294
|
+
Deno, pass the same
|
|
11295
|
+
`gracefulSignals: { drainMs }` to `serve()` instead, as above.
|
|
11067
11296
|
|
|
11068
11297
|
When the platform sends `SIGTERM` without taking the instance out of rotation first,
|
|
11069
11298
|
add `delayMs`. The stop then runs the app's `onStopping` hooks, keeps
|
|
@@ -11838,6 +12067,77 @@ stylesheet can't redirect the download elsewhere - an SSRF gate), and caps each
|
|
|
11838
12067
|
Filenames are derived only from validated tokens plus a content hash, so there's no path
|
|
11839
12068
|
traversal.
|
|
11840
12069
|
|
|
12070
|
+
## Nifra - Frontend gotchas
|
|
12071
|
+
|
|
12072
|
+
> Version-scoped React, Preact, Solid, Vue, Svelte, and Nifra frontend gotchas exposed through the CLI and MCP.
|
|
12073
|
+
|
|
12074
|
+
Nifra owns the server/client seam, while each frontend framework owns its own reactivity and
|
|
12075
|
+
lifecycle rules. The frontend catalog connects those two layers without pretending Nifra can
|
|
12076
|
+
replace the framework's compiler or linter.
|
|
12077
|
+
|
|
12078
|
+
### Use the same catalog from every surface
|
|
12079
|
+
|
|
12080
|
+
`nifra frontend` is the human CLI and `nifra_frontend` is the MCP tool. Both
|
|
12081
|
+
select the same entries. Pass `--json` to the CLI, or read the MCP result's `structuredContent`,
|
|
12082
|
+
to receive a stable result with `schemaVersion`, an optional top-level `adapter`, match status,
|
|
12083
|
+
and `entries`. Entries include their `adapters` and may omit framework
|
|
12084
|
+
version ranges, categories, or source URLs.
|
|
12085
|
+
|
|
12086
|
+
```sh
|
|
12087
|
+
# Browse all entries
|
|
12088
|
+
nifra frontend
|
|
12089
|
+
|
|
12090
|
+
# Search a framework and symptom
|
|
12091
|
+
nifra frontend solid "list reorder state"
|
|
12092
|
+
|
|
12093
|
+
# Give an agent stable JSON with versions and source links
|
|
12094
|
+
nifra frontend vue "watcher never runs" --json
|
|
12095
|
+
|
|
12096
|
+
# The same catalog is available over MCP, as text plus structuredContent
|
|
12097
|
+
nifra_frontend({ adapter: "react", symptom: "hydration mismatch" })
|
|
12098
|
+
```
|
|
12099
|
+
|
|
12100
|
+
### What Nifra reports
|
|
12101
|
+
|
|
12102
|
+
-
|
|
12103
|
+
**Shared seam cases:** server-only imports, hydration determinism, typed loader
|
|
12104
|
+
data, duplicate runtimes, and stable list identity.
|
|
12105
|
+
|
|
12106
|
+
-
|
|
12107
|
+
**React and Preact:** effect dependencies and cleanup, hydration browser reads,
|
|
12108
|
+
state identity, compat boundaries, and runtime duplication.
|
|
12109
|
+
|
|
12110
|
+
-
|
|
12111
|
+
**Solid:** tracked reads, props and stores, `For` versus
|
|
12112
|
+
`Index`, and owner cleanup.
|
|
12113
|
+
|
|
12114
|
+
-
|
|
12115
|
+
**Vue:** refs in script, watch sources and traversal, reactive props, and SSR
|
|
12116
|
+
hydration.
|
|
12117
|
+
|
|
12118
|
+
-
|
|
12119
|
+
**Svelte:** runes, keyed each blocks, effect teardown, and browser-only SSR
|
|
12120
|
+
reads.
|
|
12121
|
+
|
|
12122
|
+
-
|
|
12123
|
+
**CSP and browser:** React `Activity` hydration, inline styles under a
|
|
12124
|
+
strict Content-Security-Policy, and WebKit's handling of streamed module scripts. Server-runtime differences are in
|
|
12125
|
+
[runtime differences](/docs/runtime-differences).
|
|
12126
|
+
|
|
12127
|
+
### Version-sensitive advice
|
|
12128
|
+
|
|
12129
|
+
Ecosystem entries may include the framework versions covered by the advice and link to the
|
|
12130
|
+
framework's documentation. When a major version changes the rule, add a new entry or update
|
|
12131
|
+
the version range with a fixture. Keep high-confidence, statically provable rules in
|
|
12132
|
+
`nifra check`; use this catalog for symptoms that need context or an ecosystem linter.
|
|
12133
|
+
|
|
12134
|
+
### Contributing a gotcha
|
|
12135
|
+
|
|
12136
|
+
Add a broken and fixed fixture, a symptom users actually report, the exact cause, a safe fix,
|
|
12137
|
+
and an authoritative source. If the issue is Nifra's own boundary, add a check code and a
|
|
12138
|
+
regression test. If it belongs to React, Preact, Solid, Vue, or Svelte, link the ecosystem
|
|
12139
|
+
linter or compiler instead of duplicating its entire rule set.
|
|
12140
|
+
|
|
11841
12141
|
## Nifra - Integrations (Stripe, and any npm library)
|
|
11842
12142
|
|
|
11843
12143
|
> Third-party libraries work in Nifra as-is - handlers are plain TypeScript. The Stripe recipe end-to-end: SDK calls in a route, constant-time webhook verification, and idempotent processing.
|
|
@@ -12190,7 +12490,25 @@ visitor in or out, the server also rotates a readable epoch cookie (
|
|
|
12190
12490
|
with the session cookie's lifetime. A tab that reads a new epoch drops every page it kept and
|
|
12191
12491
|
tells the other tabs of the origin to do the same. A sign-out by a native form post, or a
|
|
12192
12492
|
session that expires while the visitor is away, is covered the same way: back compares the
|
|
12193
|
-
epoch before it shows a kept page.
|
|
12493
|
+
epoch before it shows a kept page. The page on screen reloads in place at the next render or
|
|
12494
|
+
navigation that reads the new epoch, and shows as it was, pending, until the reload lands. If
|
|
12495
|
+
that reload fails, or a navigation or submit away from the page does, the browser loads the
|
|
12496
|
+
URL as a document in its place, replacing the history entry. Without
|
|
12497
|
+
`installHistory`, the router names that URL in `documentLoad` and
|
|
12498
|
+
keeps what it shows.
|
|
12499
|
+
|
|
12500
|
+
A response that renews the same visitor's session keeps the epoch: a session cookie re-sent
|
|
12501
|
+
with a new lifetime, or an `@nifrajs/auth` session committed again with the same
|
|
12502
|
+
data. Any change to an `@nifrajs/auth` session's data rotates it, in either mode,
|
|
12503
|
+
so a sign-in or sign-out shows even when the session id stays the same. With
|
|
12504
|
+
[
|
|
12505
|
+
`identity`
|
|
12506
|
+
](/docs/auth)
|
|
12507
|
+
set on `createSessions`, only a change to the keys it names rotates it, and a write
|
|
12508
|
+
to a cart or a preference keeps it. An Auth.js session
|
|
12509
|
+
read writes a new token every time; mounted through `@nifrajs/authjs`, it keeps
|
|
12510
|
+
the epoch when both tokens decrypt and every claim but the times Auth.js renews matches.
|
|
12511
|
+
Auth.js mounted any other way rotates it on each read.
|
|
12194
12512
|
|
|
12195
12513
|
The session cookies of `@nifrajs/auth` and Auth.js count under their default
|
|
12196
12514
|
names, and Better Auth's under any `cookiePrefix`. Name any other, such as one
|
|
@@ -12224,7 +12542,10 @@ export const api = server().post("/switch-account", (c) => {
|
|
|
12224
12542
|
```
|
|
12225
12543
|
|
|
12226
12544
|
When identity lives in client storage, as a bearer token, call `identityChanged()`
|
|
12227
|
-
at sign-in and sign-out
|
|
12545
|
+
at sign-in and sign-out. It also clears every query client, returns every fetcher to idle,
|
|
12546
|
+
and reloads the page on screen in place. A navigation, fetcher load or query fetch still
|
|
12547
|
+
loading loads once more for the new visitor before it settles, and a submit still posting
|
|
12548
|
+
finishes first:
|
|
12228
12549
|
|
|
12229
12550
|
```ts
|
|
12230
12551
|
import { identityChanged } from "@nifrajs/web/client"
|
|
@@ -12239,6 +12560,14 @@ export function signOut(): void {
|
|
|
12239
12560
|
A document the browser puts in its back/forward cache drops its kept pages first, so a
|
|
12240
12561
|
cached document never carries them.
|
|
12241
12562
|
|
|
12563
|
+
`nifra doctor` warns about `keepAlive` routes in an app where nothing
|
|
12564
|
+
names the sign-in cookie: no `identityCookies`, no `identityChanged()`,
|
|
12565
|
+
and no `@nifrajs/auth`, Better Auth or Auth.js reachable. It follows the app's
|
|
12566
|
+
installed and linked dependencies, so an app that reaches Better Auth through a workspace
|
|
12567
|
+
package of its own gets a note naming the chain instead: the default names and Better
|
|
12568
|
+
Auth's `<prefix>.session_token` suffix still cover it, unless that
|
|
12569
|
+
package renames the cookie outright.
|
|
12570
|
+
|
|
12242
12571
|
### Limits
|
|
12243
12572
|
|
|
12244
12573
|
-
|
|
@@ -14134,6 +14463,157 @@ await invalidate({ tags: ["catalog"] }) // shells listing "catalog" are rebuilt
|
|
|
14134
14463
|
console.log(shells.stats()) // admitted, denied and shed holes, aborted slow readers, unsent bytes
|
|
14135
14464
|
```
|
|
14136
14465
|
|
|
14466
|
+
## Nifra - Runtime differences
|
|
14467
|
+
|
|
14468
|
+
> Where Bun, Node, Deno and Cloudflare Workers behave differently under the same Nifra app, with the fix and the Nifra option that decides it, exposed through the CLI and MCP.
|
|
14469
|
+
|
|
14470
|
+
Nifra runs the same `app.fetch(Request): Response` on Bun, Node, Deno and Cloudflare
|
|
14471
|
+
Workers. The runtimes underneath do not behave identically, and none of the differences below
|
|
14472
|
+
is Nifra's doing: they come from the runtimes and their engines. Where Nifra has a switch
|
|
14473
|
+
that decides which behavior an app gets, the entry names it.
|
|
14474
|
+
|
|
14475
|
+
### Use the same catalog from every surface
|
|
14476
|
+
|
|
14477
|
+
`nifra runtime` is the human CLI and `nifra_runtime` is the MCP tool. Both
|
|
14478
|
+
read one catalog. Each entry records what you observe, what each runtime does, the fix, how to
|
|
14479
|
+
verify it on your own runtime, and the versions it was measured on (Bun 1.4.4, Node 26.12 and
|
|
14480
|
+
Deno 2.9.8 unless it says otherwise).
|
|
14481
|
+
|
|
14482
|
+
```sh
|
|
14483
|
+
# Browse every difference
|
|
14484
|
+
nifra runtime
|
|
14485
|
+
|
|
14486
|
+
# Filter by runtime, and search by what you observe
|
|
14487
|
+
nifra runtime deno "path guard skipped"
|
|
14488
|
+
|
|
14489
|
+
# Stable JSON for an agent, with versions and categories
|
|
14490
|
+
nifra runtime node "pipelined requests" --json
|
|
14491
|
+
|
|
14492
|
+
# The same catalog over MCP, as text plus structuredContent
|
|
14493
|
+
nifra_runtime({ runtime: "bun", symptom: "env var undefined" })
|
|
14494
|
+
```
|
|
14495
|
+
|
|
14496
|
+
### Requests
|
|
14497
|
+
|
|
14498
|
+
entry
|
|
14499
|
+
what differs
|
|
14500
|
+
Nifra switch
|
|
14501
|
+
|
|
14502
|
+
`dot-segment-targets`
|
|
14503
|
+
|
|
14504
|
+
Bun and Workers hand over a resolved URL, so `/public/../admin` arrives as
|
|
14505
|
+
`/admin`; Deno and Node hand over the target as sent.
|
|
14506
|
+
|
|
14507
|
+
`normalizeTarget`
|
|
14508
|
+
|
|
14509
|
+
`host-builds-url`
|
|
14510
|
+
|
|
14511
|
+
Deno builds `Request.url` from the Host it received, so a Host holding
|
|
14512
|
+
`/` or `#` changes the routed path; Bun leaves the URL relative;
|
|
14513
|
+
`@nifrajs/node` answers 400.
|
|
14514
|
+
|
|
14515
|
+
`validateHost`
|
|
14516
|
+
|
|
14517
|
+
`missing-or-repeated-host`
|
|
14518
|
+
|
|
14519
|
+
No Host: a relative URL on Bun, `http://localhost/…` through
|
|
14520
|
+
`@nifrajs/node`, `http://localhost:port/…` on Deno. Two Host lines:
|
|
14521
|
+
Bun uses the first, `@nifrajs/node` and Deno answer 400.
|
|
14522
|
+
|
|
14523
|
+
`validateHost`
|
|
14524
|
+
|
|
14525
|
+
`pipelined-requests`
|
|
14526
|
+
|
|
14527
|
+
Node runs every pipelined request's handler at once (30 of 30 in the probe); Bun and
|
|
14528
|
+
Deno run one per connection.
|
|
14529
|
+
|
|
14530
|
+
`requestTimeoutMs`, proxy limits
|
|
14531
|
+
|
|
14532
|
+
```ts
|
|
14533
|
+
import { server } from "@nifrajs/core"
|
|
14534
|
+
import { serve } from "@nifrajs/node"
|
|
14535
|
+
|
|
14536
|
+
// Deno (and Bun's Host handling): the Host header and the request target are checked and resolved.
|
|
14537
|
+
const app = server({ validateHost: true, normalizeTarget: true })
|
|
14538
|
+
|
|
14539
|
+
// Node: the adapter has the same normalizeTarget switch.
|
|
14540
|
+
await serve(app, { port: 3000, normalizeTarget: true })
|
|
14541
|
+
```
|
|
14542
|
+
|
|
14543
|
+
Both switches are off by default because checking costs throughput: about 6% of a bare route
|
|
14544
|
+
for Host validation on Bun, and about 3% for target normalization on Deno. Turn on target
|
|
14545
|
+
normalization when upstream guards and proxies apply a different path policy, or when your path
|
|
14546
|
+
guards run after Nifra normalizes the target. Turn on Host validation when the app builds URLs
|
|
14547
|
+
from the Host header.
|
|
14548
|
+
|
|
14549
|
+
### Responses and the language
|
|
14550
|
+
|
|
14551
|
+
entry
|
|
14552
|
+
what differs
|
|
14553
|
+
|
|
14554
|
+
`json-content-type`
|
|
14555
|
+
|
|
14556
|
+
`Response.json` sends `application/json;charset=utf-8` on Bun and
|
|
14557
|
+
`application/json` on Node and Deno, and Nifra keeps each runtime's value.
|
|
14558
|
+
|
|
14559
|
+
`engine-error-messages`
|
|
14560
|
+
|
|
14561
|
+
Bun is JavaScriptCore; Node and Deno are V8. `JSON.parse`, `new URL`
|
|
14562
|
+
and null reads word their errors differently, so match on the class or a code.
|
|
14563
|
+
|
|
14564
|
+
`deep-recursion`
|
|
14565
|
+
|
|
14566
|
+
Bun runs `return f()` as a tail call (200,000 deep returned); Node and Deno
|
|
14567
|
+
overflow between 9,000 and 20,000 frames.
|
|
14568
|
+
|
|
14569
|
+
### Process, files and the edge
|
|
14570
|
+
|
|
14571
|
+
entry
|
|
14572
|
+
what differs
|
|
14573
|
+
|
|
14574
|
+
`dotenv-autoload`
|
|
14575
|
+
|
|
14576
|
+
Bun loads `.env` at startup; Node and Deno need `--env-file`.
|
|
14577
|
+
|
|
14578
|
+
`spawn-env`
|
|
14579
|
+
|
|
14580
|
+
`Bun.spawn` without `env` ignores `process.env` changes made
|
|
14581
|
+
after startup.
|
|
14582
|
+
|
|
14583
|
+
`glob-symlinks`
|
|
14584
|
+
|
|
14585
|
+
`Bun.Glob` skips symlinks unless `followSymlinks: true`.
|
|
14586
|
+
|
|
14587
|
+
`workerd-node-builtins`
|
|
14588
|
+
|
|
14589
|
+
Which `node:` builtins a Worker gets without `nodejs_compat` depends on
|
|
14590
|
+
its `compatibility_date`.
|
|
14591
|
+
|
|
14592
|
+
### Frontend frameworks and browsers
|
|
14593
|
+
|
|
14594
|
+
The browser side has the same property: the behavior belongs to React or the
|
|
14595
|
+
browser, and Nifra only sits on top of it. Those entries live in the
|
|
14596
|
+
[frontend gotchas](/docs/frontend-guidance) catalog (`nifra frontend`),
|
|
14597
|
+
next to the per-framework reactivity cases:
|
|
14598
|
+
|
|
14599
|
+
-
|
|
14600
|
+
`react-activity-markers`: React 19.3.1 hangs hydrating an `<Activity>`
|
|
14601
|
+
whose boundary comments are missing from the server HTML.
|
|
14602
|
+
|
|
14603
|
+
-
|
|
14604
|
+
`csp-inline-style-attribute`: what a strict Content-Security-Policy does to inline
|
|
14605
|
+
`style` attributes, and the `<slot>` wrapper that avoids it.
|
|
14606
|
+
|
|
14607
|
+
-
|
|
14608
|
+
`webkit-streamed-modules`: WebKit runs module scripts of a streamed document only
|
|
14609
|
+
after the parser ends.
|
|
14610
|
+
|
|
14611
|
+
### Keeping it true
|
|
14612
|
+
|
|
14613
|
+
A runtime release can change any entry. The catalog test checks the Bun claims for JSON parsing, JSON content type, recursion depth and
|
|
14614
|
+
URL errors against the Bun it runs on; the other entries are recorded observations. To add or fix an entry, reproduce it on
|
|
14615
|
+
each runtime, record the versions, and keep the cause to what the runtime does.
|
|
14616
|
+
|
|
14137
14617
|
## Nifra security posture vs Hono, Fastify, Express, Elysia
|
|
14138
14618
|
|
|
14139
14619
|
> A dimension-by-dimension security comparison of Nifra against the current releases of Hono, Fastify, Express, and Elysia - which hardening each framework ships by default, which is opt-in, and which is left to third-party packages.
|
|
@@ -14551,6 +15031,79 @@ route is guarded. For the full capability and throughput comparison, see
|
|
|
14551
15031
|
[vs other frameworks](/docs/comparison) and the
|
|
14552
15032
|
[per-framework pages](/compare).
|
|
14553
15033
|
|
|
15034
|
+
## Nifra - Security testing
|
|
15035
|
+
|
|
15036
|
+
> Security invariants, mutation testing, adversarial inputs, and runtime differential checks in Nifra.
|
|
15037
|
+
|
|
15038
|
+
Nifra treats security claims as executable invariants. A rule is useful only when a hostile
|
|
15039
|
+
input, a deliberate mutation, or a recovery fault would make a test fail if the protection
|
|
15040
|
+
disappeared.
|
|
15041
|
+
|
|
15042
|
+
### One invariant, several kinds of evidence
|
|
15043
|
+
|
|
15044
|
+
`security-invariants.json` is the index for the repository's security claims. Each
|
|
15045
|
+
entry names the behavior, regression tests, mutation targets, and documentation that explain
|
|
15046
|
+
it. `bun run check:security-invariants` fails when a referenced test or target is
|
|
15047
|
+
removed, so the index cannot silently become a list of aspirations.
|
|
15048
|
+
|
|
15049
|
+
The ledger is intentionally separate from an application's secrets and tenant data. Add a
|
|
15050
|
+
reduced public regression fixture for a real finding; keep private application details in the
|
|
15051
|
+
private test suite.
|
|
15052
|
+
|
|
15053
|
+
### Mutation testing
|
|
15054
|
+
|
|
15055
|
+
Mutation testing changes one condition, operator, return value, or statement at a time. A
|
|
15056
|
+
security target passes only when its tests kill every meaningful mutant. A surviving mutant
|
|
15057
|
+
needs a regression test or an explicit equivalence explanation in
|
|
15058
|
+
`mutation-equivalents.json`; adding a survivor to a baseline is a temporary record,
|
|
15059
|
+
not proof of safety.
|
|
15060
|
+
|
|
15061
|
+
```sh
|
|
15062
|
+
# Validate every invariant has executable evidence
|
|
15063
|
+
bun run check:security-invariants
|
|
15064
|
+
|
|
15065
|
+
# Run the fast changed-line mutation report
|
|
15066
|
+
bun scripts/mutate.ts --changed
|
|
15067
|
+
|
|
15068
|
+
# Run a selected security target locally
|
|
15069
|
+
bun scripts/mutate.ts --target core-capabilities --gate
|
|
15070
|
+
|
|
15071
|
+
# Build artifacts required by the Node, Deno, and workerd lanes
|
|
15072
|
+
bun run build
|
|
15073
|
+
|
|
15074
|
+
# Exercise hostile requests across supported runtimes
|
|
15075
|
+
bun run check:runtime-differential
|
|
15076
|
+
```
|
|
15077
|
+
|
|
15078
|
+
### What to test at a security boundary
|
|
15079
|
+
|
|
15080
|
+
-
|
|
15081
|
+
**Authorization:** denial happens before the handler, database write, or side
|
|
15082
|
+
effect; ownership is checked for the requested resource.
|
|
15083
|
+
|
|
15084
|
+
-
|
|
15085
|
+
**Replay and recovery:** repeated idempotency keys do not repeat effects, and an
|
|
15086
|
+
uncertain commit becomes an explicit reconciliation state.
|
|
15087
|
+
|
|
15088
|
+
-
|
|
15089
|
+
**Input limits:** raw and multipart bodies stop at their read budget, malformed
|
|
15090
|
+
encodings are rejected, and prototype-pollution keys cannot alter output objects.
|
|
15091
|
+
|
|
15092
|
+
-
|
|
15093
|
+
**Data boundaries:** response projection strips fields, errors redact provider
|
|
15094
|
+
details, and server-only imports cannot reach browser chunks.
|
|
15095
|
+
|
|
15096
|
+
-
|
|
15097
|
+
**Runtime parity:** Bun, Node, Deno, and Workers agree on rejection status,
|
|
15098
|
+
headers, redaction, and side-effect behavior for the same hostile request.
|
|
15099
|
+
|
|
15100
|
+
### Adding a new edge case
|
|
15101
|
+
|
|
15102
|
+
Start with the smallest reproduction that proves the failure. Give it a stable diagnostic or
|
|
15103
|
+
test name, add the fixed behavior to the relevant invariant, add a mutation that would remove
|
|
15104
|
+
the guard when practical, and document the trigger, consequence, fix, and verification
|
|
15105
|
+
command. This keeps the docs, CLI, MCP, and test suite growing from evidence.
|
|
15106
|
+
|
|
14554
15107
|
## Nifra - Project structure
|
|
14555
15108
|
|
|
14556
15109
|
> Where code lives in a Nifra app: routes/, frontend/, backend/, shared/ and public/, the route pair, and the import rules the build enforces so server code never reaches the browser.
|
|
@@ -15353,9 +15906,18 @@ rewriting requests inside the executor: `witnesses`, `prepareRequest`,
|
|
|
15353
15906
|
`isRejected`, `include` and `maxMutationsPerInput` on
|
|
15354
15907
|
`invariants` reach every L4 run, from `nifra levels` and the
|
|
15355
15908
|
`nifra_levels` MCP tool alike. `setup` provisions a throwaway target only
|
|
15356
|
-
when L4 runs: it is called once, before the first
|
|
15357
|
-
always runs after the run, a failing one included.
|
|
15358
|
-
|
|
15909
|
+
when L4 runs: it is called once, before the run generates its first case, and its
|
|
15910
|
+
`teardown` always runs after the run, a failing one included. What a success
|
|
15911
|
+
witness must name often exists only once the target is up - a real slug, a row id, a
|
|
15912
|
+
signed-in session - so `setup` may return `witnesses` and
|
|
15913
|
+
`prepareRequest` too. Its witnesses are merged over the static ones, a
|
|
15914
|
+
`"METHOD /path"` in both taking the setup's, and validated the same way; its
|
|
15915
|
+
`prepareRequest` replaces the static one. `nifra levels` lists the
|
|
15916
|
+
witnesses that came from `setup` under L4, and the `nifra_levels` result
|
|
15917
|
+
carries them as `setupWitnesses`. A harness that runs L4 itself merges a setup
|
|
15918
|
+
result with `applyInvariantSetup` from `@nifrajs/core/assurance`. The
|
|
15919
|
+
example keeps its target in memory; a database or container belongs in your own
|
|
15920
|
+
`setup`.
|
|
15359
15921
|
|
|
15360
15922
|
```ts
|
|
15361
15923
|
// nifra.assurance.ts
|
|
@@ -15367,18 +15929,21 @@ export default defineAssuranceConfig({
|
|
|
15367
15929
|
source: createBackend({ rows: new Map() }),
|
|
15368
15930
|
policy: { rules: [/* ... */] },
|
|
15369
15931
|
invariants: {
|
|
15370
|
-
// Called once, before
|
|
15932
|
+
// Called once per L4 run, before its first case - never when this file is imported, so
|
|
15371
15933
|
// `nifra check` and `nifra assure` provision nothing.
|
|
15372
15934
|
setup: async () => {
|
|
15373
|
-
const
|
|
15935
|
+
const id = crypto.randomUUID()
|
|
15936
|
+
const rows = new Map([[id, { id, owner: "fixture" }]])
|
|
15374
15937
|
const target = createBackend({ rows })
|
|
15375
15938
|
return {
|
|
15376
15939
|
executor: (request) => target.fetch(request),
|
|
15940
|
+
// Names the row this run created, so no executor rewrites a placeholder id.
|
|
15941
|
+
witnesses: { "PATCH /rows/:id": { params: { id }, body: { title: "ok" } } },
|
|
15377
15942
|
teardown: () => rows.clear(), // runs after a failing run too
|
|
15378
15943
|
}
|
|
15379
15944
|
},
|
|
15380
|
-
// Known-good inputs for schemas L4 cannot synthesize
|
|
15381
|
-
witnesses: { "
|
|
15945
|
+
// Known-good inputs for schemas L4 cannot synthesize, when they are known up front.
|
|
15946
|
+
witnesses: { "POST /rows": { body: { title: "ok" } } },
|
|
15382
15947
|
// Attach what the app needs on every case: a session, a signed token.
|
|
15383
15948
|
prepareRequest: (request) => {
|
|
15384
15949
|
const headers = new Headers(request.headers)
|
|
@@ -16864,6 +17429,13 @@ closes; `maxPending` (default 32) still bounds how many can wait. `NifraBackend`
|
|
|
16864
17429
|
denies, so the shorter of the two applies. A never-expiring approval reports `expiresAt` as
|
|
16865
17430
|
`APPROVAL_NEVER_EXPIRES_AT`, which survives JSON and stays later than any `Date.now()`.
|
|
16866
17431
|
|
|
17432
|
+
A `NativeApprovalPort` may also `review` a call before anyone is asked: `{ decision: "allow" }`
|
|
17433
|
+
runs it, `{ decision: "deny", reason }` refuses it with `REVIEW_DENIED` and a reason the model
|
|
17434
|
+
reads, and `{ decision: "ask" }` raises the approval as usual. Any other answer, a throw, or a
|
|
17435
|
+
review still unsettled after `reviewTimeoutMs` (default 30 s, at most 10 minutes) asks; an abort
|
|
17436
|
+
during a review stops the turn. Review answers are host-owned like approvals, but an allow or a
|
|
17437
|
+
deny emits no approval events, so a host that needs an audit trail records its own reviews.
|
|
17438
|
+
|
|
16867
17439
|
`nifra-agent` loads `.nifra/extensions/**` from `--cwd` only when started with
|
|
16868
17440
|
`--extensions`. An extension module's top-level code runs as soon as it is
|
|
16869
17441
|
imported, before its declared `capabilities` are checked, so pass the flag only
|
|
@@ -17093,9 +17665,13 @@ route. Split groups before the compiler reports `TS2589`, rather than weakening
|
|
|
17093
17665
|
concurrency, filters, cancellation, and token-only metrics. A worker invocation always terminates.
|
|
17094
17666
|
- **`bigint` in plain JSON.** A JSON answer writes a `bigint` as its decimal string
|
|
17095
17667
|
(`{ "id": "9007199254740993" }`) instead of failing with a 500, and the typed client reads a
|
|
17096
|
-
`string`. A `
|
|
17097
|
-
|
|
17098
|
-
|
|
17668
|
+
`string`. A `BigInt` wrapper object (`Object(1n)`) is not a `bigint`: its answer fails with a 500.
|
|
17669
|
+
One moved onto `Object.prototype` is written as `{}` instead by Bun in an answer that holds no
|
|
17670
|
+
`Date`, and one moved onto any plain or `null` prototype is written as `{}` on every runtime when a
|
|
17671
|
+
plain `Date` sits on the answer's first row. A `Uint8Array` is base64 only where the response
|
|
17672
|
+
schema declares `t.bytes()` from `@nifrajs/schema`; elsewhere it is the `{ "0": 1, ... }` object
|
|
17673
|
+
`JSON.stringify` writes, and a Node `Buffer` is the `{ "type": "Buffer", "data": [...] }` its
|
|
17674
|
+
`toJSON` writes.
|
|
17099
17675
|
- **Rich wire values (opt in).** `@nifrajs/core/wire` round-trips dates, bigints, maps, sets, binary,
|
|
17100
17676
|
shared references, and cycles through JSON transports. Decoding validates every reachable shape,
|
|
17101
17677
|
preserves owned `__proto__` keys without prototype mutation, and enforces configurable node, depth,
|
|
@@ -17147,7 +17723,8 @@ contract-first registry.
|
|
|
17147
17723
|
`responseContract("enforce")` before the routes it should cover to validate JSON/status payloads and
|
|
17148
17724
|
prevent extra fields from reaching the wire. That covers a `status(...)` or `c.json(...)` reply a
|
|
17149
17725
|
handler returns or throws, a hook returns, or `onError` answers with. `warn` preserves the original
|
|
17150
|
-
payload during migration.
|
|
17726
|
+
payload during migration. The contract judges what JSON writes: a `toJSON` hook's output, and a
|
|
17727
|
+
`Date` as its ISO string, so a timestamp column declares `t.date()` and may hold the `Date`.
|
|
17151
17728
|
Raw `Response`, streams, redirects, and `mountFetch` remain explicit transport escape hatches and
|
|
17152
17729
|
must be governed by assurance/static review.
|
|
17153
17730
|
|
|
@@ -17257,10 +17834,40 @@ a Bun-`listen()`-style graceful `stop()` and opt-in signals.
|
|
|
17257
17834
|
## Graceful shutdown on signals
|
|
17258
17835
|
|
|
17259
17836
|
```ts
|
|
17260
|
-
await serve(app, { port: 3000,
|
|
17261
|
-
await serve(app, { port: 3000,
|
|
17837
|
+
await serve(app, { port: 3000, gracefulSignals: true }) // SIGTERM/SIGINT → graceful stop()
|
|
17838
|
+
await serve(app, { port: 3000, gracefulSignals: { drainMs: 8_000 } }) // the same, with an 8 s drain window
|
|
17839
|
+
```
|
|
17840
|
+
|
|
17841
|
+
## Files ahead of the app
|
|
17842
|
+
|
|
17843
|
+
```ts
|
|
17844
|
+
await serve(app, {
|
|
17845
|
+
port: 3000,
|
|
17846
|
+
static: (req) =>
|
|
17847
|
+
new URL(req.url).pathname === "/robots.txt" ? new Response("User-agent: *\n") : undefined,
|
|
17848
|
+
})
|
|
17849
|
+
```
|
|
17850
|
+
|
|
17851
|
+
`static` sees every request before the app does, so a file it answers wins over any route at the
|
|
17852
|
+
same path. It returns a response, or `undefined` (or a promise of one) to let the app route the
|
|
17853
|
+
request. No hook of the app runs for a request it answers, and a throw answers a plain `500`.
|
|
17854
|
+
|
|
17855
|
+
`serveStatic` builds one for files on disk, read with Deno's own file API:
|
|
17856
|
+
|
|
17857
|
+
```ts
|
|
17858
|
+
import { serve, serveStatic } from "@nifrajs/deno"
|
|
17859
|
+
|
|
17860
|
+
await serve(app, { port: 3000, static: serveStatic({ dir: new URL("./assets/", import.meta.url) }) })
|
|
17262
17861
|
```
|
|
17263
17862
|
|
|
17863
|
+
It takes one mount or a list, with the same options as Bun's `@nifrajs/core/serve-static` and
|
|
17864
|
+
`@nifrajs/node`'s: `dir`, `prefix` (default `/assets`), `immutable`, `hashedFiles` (paths, RegExps or
|
|
17865
|
+
a predicate), `cacheControl`, `files`, `allow`, `headers`, `dotfiles` and `fallthrough`. A path
|
|
17866
|
+
under a mount's prefix that it cannot serve answers 404 (400 malformed, 403 traversing) unless the
|
|
17867
|
+
mount sets `fallthrough: true`, which hands it to the next mount and then the app. Run Deno with
|
|
17868
|
+
`--allow-read` for the served directories. The server that `nifra build --target deno` emits serves
|
|
17869
|
+
its client bundle and public files this way.
|
|
17870
|
+
|
|
17264
17871
|
## Client disconnect and `c.req.signal`
|
|
17265
17872
|
|
|
17266
17873
|
`Deno.serve` aborts a request's `signal` when the client goes away and, by default, also once a
|
|
@@ -18214,10 +18821,8 @@ Each layer refuses on its own, in this order:
|
|
|
18214
18821
|
|
|
18215
18822
|
1. **Host.** Only loopback, `*.localhost` and unix sockets connect unless `allowHosts` names the host.
|
|
18216
18823
|
URL parameters other than host, port, user, password, database and `sslmode` are ignored.
|
|
18217
|
-
2. **Tokenizer.** One SELECT, WITH, VALUES or TABLE statement; row-locking clauses
|
|
18218
|
-
identifiers
|
|
18219
|
-
locks, `pg_notify`, `nextval`, backend signals) and functions that run SQL from a string the plan
|
|
18220
|
-
check cannot see (`query_to_xml`, `ts_stat`, `ts_rewrite`, `crosstab`, `connectby`) are refused.
|
|
18824
|
+
2. **Tokenizer.** One SELECT, WITH, VALUES or TABLE statement; row-locking clauses and
|
|
18825
|
+
unicode-escaped identifiers are refused.
|
|
18221
18826
|
3. **Read-only transaction.** `BEGIN READ ONLY` with `statement_timeout`, `lock_timeout` and
|
|
18222
18827
|
`idle_in_transaction_session_timeout` set to `timeoutMs`, always rolled back. Sessions also start
|
|
18223
18828
|
with `default_transaction_read_only = on`.
|
|
@@ -18225,21 +18830,50 @@ Each layer refuses on its own, in this order:
|
|
|
18225
18830
|
role that may execute server-file functions is refused (`NIFRA_DB_SUPERUSER`). A role that can use
|
|
18226
18831
|
dblink, postgres_fdw, file_fdw or an untrusted language is refused (`NIFRA_DB_EXTENSION`) unless
|
|
18227
18832
|
`allowExtensions` names it.
|
|
18228
|
-
5. **
|
|
18833
|
+
5. **Grant gate.** The role itself must be unable to read what the declaration hides: a column
|
|
18834
|
+
`redaction.column` matches, an `exclude`d table or one inheriting from it, and a view or
|
|
18835
|
+
materialized view that reads any of those or reaches outside `schemas`. A role that can is refused
|
|
18836
|
+
(`NIFRA_DB_ROLE_GRANTS`), so the database's privileges refuse such a read even where no plan shows
|
|
18837
|
+
it: inside a function's body, or from the rows a materialized view stores. Nor may the role execute
|
|
18838
|
+
a SECURITY DEFINER function, or an aggregate over one, unless `allowFunctions` names it: such a
|
|
18839
|
+
function reads with its owner's rights wherever a query reaches it, through an operator, a cast, a
|
|
18840
|
+
view folded at plan time or another function's body, and only
|
|
18841
|
+
the EXECUTE privilege is checked on every one of those paths. Either refusal names each grantee the
|
|
18842
|
+
role holds the privilege through.
|
|
18843
|
+
6. **Function allowlist.** Every function the statement names, and every one its plan calls (inside
|
|
18844
|
+
views too), is looked up in `pg_proc`, each overload the name can resolve to. A built-in or
|
|
18845
|
+
extension function must be immutable or stable and parallel safe (a few value-only ones such as
|
|
18846
|
+
`random()`, `clock_timestamp()` and `pg_total_relation_size()` pass as well); one the database
|
|
18847
|
+
defines must be immutable or stable; none may be SECURITY DEFINER. Anything else is refused
|
|
18848
|
+
(`NIFRA_DB_FUNCTION_REFUSED`) unless `allowFunctions` names it, so a function added in a later
|
|
18849
|
+
Postgres release is refused until it is known to be safe. The names are checked before the server
|
|
18850
|
+
plans the statement, since planning already runs immutable functions on constants.
|
|
18851
|
+
7. **Cursor.** The statement runs as one extended-protocol `DECLARE ... NO SCROLL CURSOR`, which the
|
|
18229
18852
|
server accepts only for SELECT and VALUES and refuses for a data-modifying WITH, then one `FETCH`
|
|
18230
18853
|
of `maxRows + 1` rows.
|
|
18231
|
-
|
|
18854
|
+
8. **Plan scope.** Every relation in the `EXPLAIN (VERBOSE)` plan, every table it inherits from, and
|
|
18232
18855
|
every `pg_catalog` function scanned in FROM must sit in `schemas` (default `public`) and outside
|
|
18233
18856
|
`exclude`. With `redaction`, a column `redaction.column` matches that any plan expression uses
|
|
18234
18857
|
(output, filter, join, sort or index condition), or a whole row holding one, is refused
|
|
18235
18858
|
(`NIFRA_DB_COLUMN_REFUSED`). A plan names a scan's columns by the table's column alias list
|
|
18236
18859
|
(`FROM users AS t(a, b)`), so while any relation the query reads holds a matching column, a query
|
|
18237
|
-
that gives a table one is refused as well.
|
|
18860
|
+
that gives a table one is refused as well. This is the second line behind the grant gate.
|
|
18238
18861
|
|
|
18239
18862
|
`explainPostgres` returns the plan (with `analyze`, executed inside the same transaction),
|
|
18240
18863
|
`readPostgresSchema` reads tables, columns, keys and indexes from `pg_catalog`, and `postgresRoleSql`
|
|
18241
|
-
writes the SQL for
|
|
18242
|
-
|
|
18864
|
+
writes the SQL for the role the grant gate accepts, without running it: `GRANT USAGE` on each allowed
|
|
18865
|
+
schema and `GRANT SELECT` on all tables in each allowed schema; a `REVOKE` for each excluded table,
|
|
18866
|
+
its partitions and children, and each view or materialized view that reads hidden data; and, for a
|
|
18867
|
+
table with a masked column (pass the same `redaction`), a `REVOKE` followed by a column-level `GRANT`
|
|
18868
|
+
of its other columns. Run it again after adding a table or view: default privileges grant every
|
|
18869
|
+
column of a new one. A privilege reaches a role through PUBLIC, a grant to the role itself, or a role
|
|
18870
|
+
whose privileges it has, and a `REVOKE` from one leaves the others. So a grant that would still
|
|
18871
|
+
expose hidden data, to PUBLIC or (for a role that exists) to a role it inherits from, is listed in
|
|
18872
|
+
comments with its `REVOKE`, and so is each SECURITY DEFINER function the role may execute, grantee by
|
|
18873
|
+
grantee (pass the same `allowFunctions` to skip the ones you trust). Only a grant to the role itself
|
|
18874
|
+
is revoked by a statement; the rest are comments because they reach other roles. The grant gate's
|
|
18875
|
+
refusal names the same grantees. A query that names a column the role may not read is
|
|
18876
|
+
refused with `NIFRA_DB_COLUMN_REFUSED`, naming the columns it may.
|
|
18243
18877
|
|
|
18244
18878
|
The live tests run against a throwaway server: set `NIFRA_TEST_POSTGRES_URL` to its superuser URL.
|
|
18245
18879
|
|
|
@@ -18467,7 +19101,21 @@ authority. If neither option is set, treat the host in `request.url` as client-c
|
|
|
18467
19101
|
|
|
18468
19102
|
## Static files
|
|
18469
19103
|
|
|
18470
|
-
|
|
19104
|
+
`static` sees every request before `app.fetch`, as it does on Bun's `app.listen()` and
|
|
19105
|
+
`@nifrajs/deno`'s `serve()`: a function from the Web `Request` to the file's `Response`, or
|
|
19106
|
+
`undefined` to let the app route it. `static: serveStatic({ dir })` serves a directory for GET and
|
|
19107
|
+
HEAD requests, and this adapter runs it on Node's own request, so every other request keeps the
|
|
19108
|
+
app's direct lane. Any other function needs a Web `Request` for every request, which roughly
|
|
19109
|
+
doubles the cost of a small route.
|
|
19110
|
+
|
|
19111
|
+
`serveStatic` takes one mount or a list, with the same options as Bun's
|
|
19112
|
+
`@nifrajs/core/serve-static` and `@nifrajs/deno`'s: `dir`, `prefix` (default `/assets`),
|
|
19113
|
+
`immutable`, `hashedFiles` (paths, RegExps or a predicate), `cacheControl`, `files`, `allow`,
|
|
19114
|
+
`headers`, `dotfiles` and `fallthrough`. A path under a mount's prefix that it cannot serve answers
|
|
19115
|
+
404 (400 malformed, 403 traversing) unless the mount sets `fallthrough: true`, which hands it to the
|
|
19116
|
+
next mount and then the app.
|
|
19117
|
+
|
|
19118
|
+
A served directory is a
|
|
18471
19119
|
public asset directory and must contain nothing private: no secrets, source maps, build
|
|
18472
19120
|
metadata, or user uploads. The directory and its ancestor path must be read-only and owned by
|
|
18473
19121
|
the service (or otherwise protected from untrusted local writers). Nifra resolves and confines
|
|
@@ -18481,7 +19129,7 @@ an application or object-storage path with its own validation policy.
|
|
|
18481
19129
|
|
|
18482
19130
|
Every file carries `Accept-Ranges: bytes`. A file up to 256 KiB is read whole and carries a strong
|
|
18483
19131
|
`ETag` from exactly the bytes served: 128 bits of their SHA-256, the same for the same bytes on every
|
|
18484
|
-
instance and on `
|
|
19132
|
+
instance and on every runtime's `serveStatic`. A replacement that keeps a file's size and timestamps still changes
|
|
18485
19133
|
its tag. The tag is remembered per file version (device, inode, size, mtime and ctime): a file over
|
|
18486
19134
|
4 KiB reuses it without hashing when a second stat after the read shows the same version, and a
|
|
18487
19135
|
`HEAD` or a `304` for that tag is answered from the stat without reading the file at all. A
|
|
@@ -18496,25 +19144,25 @@ file is dated only once that change is more than 2 s old, so a write during the
|
|
|
18496
19144
|
later second than the date it was sent with. Explicit
|
|
18497
19145
|
validator headers still apply. `If-None-Match` takes precedence over `If-Modified-Since`; a matching
|
|
18498
19146
|
condition gets a bodyless 304. `Range` on GET is parsed by a copy of `@nifrajs/core/range`, the parser
|
|
18499
|
-
`
|
|
19147
|
+
every runtime's `serveStatic` uses, and gated by `If-Range`: it must name the file's strong tag, or its exact date
|
|
18500
19148
|
when the file has no strong tag. One range (overlapping or adjacent ones merge into one) gets 206, a
|
|
18501
19149
|
range-set that selects nothing gets 416, and several disjoint ranges get the whole file.
|
|
18502
19150
|
|
|
18503
19151
|
## Graceful shutdown on signals
|
|
18504
19152
|
|
|
18505
19153
|
Opt in to SIGTERM/SIGINT handling so a `docker stop` / Ctrl-C drains in-flight requests
|
|
18506
|
-
before exit (
|
|
18507
|
-
process signals should be a deliberate choice):
|
|
19154
|
+
before exit (the same `gracefulSignals` as Bun's `server({ gracefulSignals })` - off by default,
|
|
19155
|
+
since owning process signals should be a deliberate choice):
|
|
18508
19156
|
|
|
18509
19157
|
```ts
|
|
18510
|
-
await serve(app, { port: 3000,
|
|
19158
|
+
await serve(app, { port: 3000, gracefulSignals: true })
|
|
18511
19159
|
```
|
|
18512
19160
|
|
|
18513
19161
|
In-flight requests get 10 s to finish before the stop forces them closed. Set the window to fit
|
|
18514
19162
|
the platform's kill grace period:
|
|
18515
19163
|
|
|
18516
19164
|
```ts
|
|
18517
|
-
await serve(app, { port: 3000,
|
|
19165
|
+
await serve(app, { port: 3000, gracefulSignals: { drainMs: 8_000 } })
|
|
18518
19166
|
```
|
|
18519
19167
|
|
|
18520
19168
|
## What you get for free
|
|
@@ -18900,7 +19548,11 @@ const openapi = toOpenAPI(app) // OpenAPI 3.1
|
|
|
18900
19548
|
`array`/`optional`/`union`/`record`, with options (`min`/`max`, `pattern`, `format`,
|
|
18901
19549
|
…) that become JSON Schema constraints. Validators are compiled (fast).
|
|
18902
19550
|
- **Validating string formats** - `email`/`uuid`/`date-time`/`date`/`time`/`uri`/`ipv4`
|
|
18903
|
-
validate *and* annotate; register more with `registerFormat`.
|
|
19551
|
+
validate *and* annotate; register more with `registerFormat`. `date-time`, `date` and `time`
|
|
19552
|
+
follow RFC 3339, calendar included, so `2026-02-30` fails.
|
|
19553
|
+
- **Dates** - `t.date()` is a `Date` in your code and an RFC 3339 `date-time` string on the wire. A
|
|
19554
|
+
request `body`, `query` or `params` carries the string and the handler receives a `Date`; a
|
|
19555
|
+
response may hold the `Date` (a timestamp column), and the typed client reads a `string`.
|
|
18904
19556
|
- **Bytes in a response** - `t.bytes()` declares a field the handler fills with a `Uint8Array` (or a
|
|
18905
19557
|
`Buffer`). The route writes it as a base64 string, the typed client reads a `string`, and the
|
|
18906
19558
|
document says `{ type: "string", contentEncoding: "base64" }`. Response-only for now: a request or
|
|
@@ -18939,6 +19591,8 @@ await Bun.write(
|
|
|
18939
19591
|
The server imports `body` from `./generated/users.ts` and uses it as its route schema. The generated
|
|
18940
19592
|
source-schema import is type-only and disappears from the deployed bundle. Regenerate when the source
|
|
18941
19593
|
schema changes. Custom string formats must be registered in the serving process, as with ordinary schemas.
|
|
19594
|
+
The generated module typechecks under `strict`, `noUnusedLocals` and `noUnusedParameters`, and Node runs
|
|
19595
|
+
it with its built-in type stripping.
|
|
18942
19596
|
|
|
18943
19597
|
Compilation refuses coercing schemas (`t.query`, `t.form` and the other request-slot schemas), a
|
|
18944
19598
|
schema whose `validate` does more than check its `jsonSchema`, custom registry kinds such as dates/deferred values,
|
|
@@ -20032,7 +20686,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20032
20686
|
|
|
20033
20687
|
## @nifrajs/agent
|
|
20034
20688
|
|
|
20035
|
-
`AgentApprovalPort`, `AgentApprovalResult`, `AgentDefinition`, `AgentDeltaSink`, `AgentDeployment`, `AgentDeploymentAdapter`, `AgentDeploymentPlan`, `AgentModelDelta`, `AgentModelPort`, `AgentModelRequest`, `AgentModelResponse`, `AgentPendingContinuation`, `AgentPendingKind`, `AgentPorts`, `AgentResumeMismatchError`, `AgentRunResult`, `AgentSharedState`, `AgentStatePatchOp`, `AgentStateStore`, `AgentStatus`, `AgentStepEvidence`, `AgentTelemetryPort`, `AgentToolContract`, `AgentToolDescriptor`, `AgentToolResult`, `AgentTranscript`, `AgentTurnBaseResult`, `AgentTurnError`, `AgentTurnInput`, `AgentTurnResult`, `AgentTurnState`, `ApprovalClass`, `CAPABILITY_DESCRIPTOR_VERSION`, `CapabilityDescriptor`, `CapabilityKind`, `ContextAssembly`, `ContextAssemblyOptions`, `ContextBudget`, `ContextBudgetError`, `ContextItem`, `ContextSource`, `ContextTokenCounter`, `DeploymentActivationOptions`, `DeploymentAuthority`, `DeploymentCancelRequest`, `DeploymentCancelResult`, `DeploymentCancellation`, `DeploymentCapabilities`, `DeploymentCapabilityReport`, `DeploymentDisposeRequest`, `DeploymentDisposeResult`, `DeploymentError`, `DeploymentErrorCode`, `DeploymentEvidence`, `DeploymentFilesystem`, `DeploymentInspectRequest`, `DeploymentInspection`, `DeploymentNetwork`, `DeploymentPrepareRequest`, `DeploymentPrepareResult`, `DeploymentProcess`, `DeploymentRuntime`, `DeploymentSecrets`, `DeploymentStartRequest`, `DeploymentStartResult`, `DeploymentState`, `DescriptorInput`, `ExecutionPolicy`, `ExecutionPolicyAdapter`, `FakeModelGateway`, `FakeModelGatewayOptions`, `HostileCodeIsolation`, `IdempotencyClass`, `IsolationClass`, `LOCAL_PROCESS_LIMITATION`, `LocalProcessAdapter`, `LocalProcessAdapterOptions`, `LocalProcessPolicyError`, `LocalProcessRequest`, `LocalProcessResult`, `MODEL_GATEWAY_ERROR_CODES`, `MemoryAgentStateStore`, `ModelGateway`, `ModelGatewayAttemptRequest`, `ModelGatewayBudget`, `ModelGatewayEnvelope`, `ModelGatewayError`, `ModelGatewayErrorCode`, `ModelGatewayEvidence`, `ModelGatewayExecutionResult`, `ModelGatewayFailure`, `ModelGatewayFailureError`, `ModelGatewayRawResult`, `ModelGatewayRequest`, `ModelGatewayResult`, `ModelGatewaySuccess`, `ModelGatewayTerminalFailure`, `ModelGatewayUsage`, `ModelRoute`, `ModelRoutePolicy`, `ModelRouteRef`, `REGISTRY_SNAPSHOT_VERSION`, `RegistryError`, `RegistryErrorCode`, `RegistrySnapshot`, `ReplayModelGateway`, `ReplayModelGatewayOptions`, `RetryClass`, `RunAgentOptions`, `StructuredOutputParser`, `ToolDescriptorOptions`, `approximateContextTokens`, `assembleContext`, `assertDeploymentAuthorityMonotonic`, `collectContext`, `combineAgentDeltaSinks`, `combineAgentTelemetry`, `composeDescriptor`, `composeRegistrySnapshot`, `createAgentSharedState`, `createAgentState`, `createDeploymentAuthority`, `createLocalProcessAdapter`, `createStructuredOutputParser`, `descriptorFromTool`, `isModelGatewayErrorCode`, `parseCapabilityDescriptor`, `parseDeploymentCapabilityReport`, `parseDeploymentPlan`, `parseModelGatewayError`, `parseModelGatewayResult`, `replayAgent`, `resumeAgent`, `runAgent`, `runModelGateway`, `structuredOutputParser`, `turn`
|
|
20689
|
+
`AgentApprovalPort`, `AgentApprovalResult`, `AgentDefinition`, `AgentDeltaSink`, `AgentDeployment`, `AgentDeploymentAdapter`, `AgentDeploymentPlan`, `AgentModelDelta`, `AgentModelPort`, `AgentModelRequest`, `AgentModelResponse`, `AgentPendingContinuation`, `AgentPendingKind`, `AgentPorts`, `AgentResumeMismatchError`, `AgentRunResult`, `AgentSharedState`, `AgentStatePatchOp`, `AgentStateStore`, `AgentStatus`, `AgentStepEvidence`, `AgentTelemetryPort`, `AgentToolContract`, `AgentToolDescriptor`, `AgentToolResult`, `AgentTranscript`, `AgentTurnBaseResult`, `AgentTurnError`, `AgentTurnInput`, `AgentTurnResult`, `AgentTurnState`, `ApprovalClass`, `CAPABILITY_DESCRIPTOR_VERSION`, `CapabilityDescriptor`, `CapabilityKind`, `ContextAssembly`, `ContextAssemblyOptions`, `ContextBudget`, `ContextBudgetError`, `ContextItem`, `ContextSource`, `ContextTokenCounter`, `DeploymentActivationOptions`, `DeploymentAuthority`, `DeploymentCancelRequest`, `DeploymentCancelResult`, `DeploymentCancellation`, `DeploymentCapabilities`, `DeploymentCapabilityReport`, `DeploymentDisposeRequest`, `DeploymentDisposeResult`, `DeploymentError`, `DeploymentErrorCode`, `DeploymentEvidence`, `DeploymentFilesystem`, `DeploymentInspectRequest`, `DeploymentInspection`, `DeploymentNetwork`, `DeploymentPrepareRequest`, `DeploymentPrepareResult`, `DeploymentProcess`, `DeploymentRuntime`, `DeploymentSecrets`, `DeploymentStartRequest`, `DeploymentStartResult`, `DeploymentState`, `DescriptorInput`, `ExecutionPolicy`, `ExecutionPolicyAdapter`, `FakeModelGateway`, `FakeModelGatewayOptions`, `HostileCodeIsolation`, `IdempotencyClass`, `IsolationClass`, `LOCAL_PROCESS_LIMITATION`, `LocalProcessAdapter`, `LocalProcessAdapterOptions`, `LocalProcessPolicyError`, `LocalProcessRequest`, `LocalProcessResult`, `MODEL_GATEWAY_ERROR_CODES`, `MemoryAgentStateStore`, `ModelGateway`, `ModelGatewayAttemptRequest`, `ModelGatewayBudget`, `ModelGatewayEnvelope`, `ModelGatewayError`, `ModelGatewayErrorCode`, `ModelGatewayEvidence`, `ModelGatewayExecutionResult`, `ModelGatewayFailure`, `ModelGatewayFailureError`, `ModelGatewayRawResult`, `ModelGatewayRequest`, `ModelGatewayResult`, `ModelGatewaySuccess`, `ModelGatewayTerminalFailure`, `ModelGatewayUsage`, `ModelRoute`, `ModelRoutePolicy`, `ModelRouteRef`, `REGISTRY_SNAPSHOT_VERSION`, `RegistryError`, `RegistryErrorCode`, `RegistrySnapshot`, `ReplayModelGateway`, `ReplayModelGatewayOptions`, `RetryClass`, `RunAgentOptions`, `StructuredOutputParser`, `ToolDescriptorOptions`, `approximateContextTokens`, `assembleContext`, `assertDeploymentAuthorityMonotonic`, `collectContext`, `combineAgentDeltaSinks`, `combineAgentTelemetry`, `composeDescriptor`, `composeRegistrySnapshot`, `createAgentSharedState`, `createAgentState`, `createDeploymentAuthority`, `createLocalProcessAdapter`, `createStructuredOutputParser`, `descriptorFromTool`, `isModelGatewayErrorCode`, `parseAgentResume`, `parseCapabilityDescriptor`, `parseDeploymentCapabilityReport`, `parseDeploymentPlan`, `parseModelGatewayError`, `parseModelGatewayResult`, `replayAgent`, `resumeAgent`, `runAgent`, `runModelGateway`, `structuredOutputParser`, `turn`
|
|
20036
20690
|
|
|
20037
20691
|
## @nifrajs/agent-app
|
|
20038
20692
|
|
|
@@ -20076,7 +20730,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20076
20730
|
|
|
20077
20731
|
## @nifrajs/coding-agent
|
|
20078
20732
|
|
|
20079
|
-
`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`, `NativeGatewayModelPortOptions`, `NativeMessage`, `NativeModelChunk`, `NativeModelPort`, `NativeModelRequest`, `NativeModelResponse`, `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`
|
|
20733
|
+
`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`
|
|
20080
20734
|
|
|
20081
20735
|
## @nifrajs/content
|
|
20082
20736
|
|
|
@@ -20084,7 +20738,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20084
20738
|
|
|
20085
20739
|
## @nifrajs/core
|
|
20086
20740
|
|
|
20087
|
-
`AdmissionController`, `AdmissionDecision`, `AnyServer`, `AuthHeaders`, `AuthMaybePromise`, `AuthenticationFailure`, `AuthenticationFailureReason`, `AuthenticationInput`, `AuthenticationResult`, `AuthenticationStage`, `AuthenticationSuccess`, `Context`, `ContextPlugin`, `CookieOptions`, `CookieSecret`, `DeclaredMountRoute`, `DefinePluginResult`, `DurableObjectNamespaceLike`, `ExecutionContext`, `FRAMEWORK_NAME`, `FetchApp`, `FrameworkError`, `FrameworkName`, `Handler`, `IdentityPlugin`, `InferInput`, `InferOutput`, `JoinRoutePath`, `LambdaEvent`, `LambdaHandler`, `LambdaResponse`, `LambdaV1Event`, `LambdaV2Event`, `ListenTlsOptions`, `LogFields`, `Logger`, `METHODS`, `McpPromptDescriptor`, `McpResourceDescriptor`, `Method`, `Middleware`, `MountFetchOptions`, `MountOptions`, `MountableApp`, `NetlifyEvent`, `NetlifyHandler`, `NifraFeatureVersion`, `NifraPlugin`, `NifraWebSocket`, `NodeRequestContext`, `NodeRequestHook`, `NodeResponseBodyHook`, `NodeResponseContext`, `NodeResponseHook`, `NodeServeOutcome`, `OnRequestResult`, `OpaqueMountDeclaration`, `Params`, `PlainRender`, `Platform`, `PlatformResponse`, `PluginTypeCollapsed`, `PrefixRegistry`, `Prettify`, `PromptArgument`, `PromptMessage`, `ROUTE_PATTERN_OVERLAP_MAX_STATES`, `RedactOptions`, `Registry`, `RequestPath`, `ResponseBodyHook`, `ResponseBodyReplacement`, `ResponseControls`, `ResponseFinalization`, `ResponseHeadersHook`, `ResponseHeadersView`, `ResponseMapFor`, `ResponseResult`, `RouteConfigError`, `RouteConfigErrorCode`, `RouteDescriptor`, `RouteInfo`, `RouteInfoFor`, `RouteMethod`, `RoutePatternOverlapLimitError`, `RouteSchema`, `Router`, `RouterMatch`, `RunningServer`, `SSEContext`, `SSEInit`, `SSEMessage`, `SSEStream`, `ScheduledController`, `ScheduledHandler`, `Server`, `ServerOptions`, `StandardIssue`, `StandardResult`, `StandardSchemaV1`, `StandardTypes`, `StandardWebSocket`, `StatusResponse`, `ToolAnnotations`, `TypedSSEStream`, `UrlParts`, `VERSION`, `ValidationOutcome`, `VercelHandler`, `Version`, `WebSocketContext`, `WebSocketData`, `WebSocketHandler`, `WebSocketUpgradeOutcome`, `authenticated`, `beforeHandler`, `commonSecretPatterns`, `cookieNamePrefix`, `defineContextPlugin`, `defineIdentityPlugin`, `definePlugin`, `defineRouterPlugin`, `hasDuplicateCookie`, `isAuthenticatedRequest`, `isSameOriginForm`, `isSameOriginPath`, `isSameOriginRequest`, `jsonLogger`, `markAuthenticatedRequest`, `parseCookies`, `pathnameOf`, `redactLogFields`, `rejected`, `replacedRequestOf`, `routePatternOverlap`, `routeTemplateOf`, `serializeCookie`, `server`, `signValue`, `silentLogger`, `status`, `toFetchHandler`, `toLambdaHandler`, `toNetlifyHandler`, `toVercelHandler`, `unsignValue`, `urlPartsOf`, `writableResponse`
|
|
20741
|
+
`AdmissionController`, `AdmissionDecision`, `AnyServer`, `AuthHeaders`, `AuthMaybePromise`, `AuthenticationFailure`, `AuthenticationFailureReason`, `AuthenticationInput`, `AuthenticationResult`, `AuthenticationStage`, `AuthenticationSuccess`, `Context`, `ContextPlugin`, `CookieOptions`, `CookieSecret`, `DeclaredMountRoute`, `DefinePluginResult`, `DurableObjectNamespaceLike`, `ExecutionContext`, `FRAMEWORK_NAME`, `FetchApp`, `FrameworkError`, `FrameworkName`, `Handler`, `IdentityPlugin`, `InferInput`, `InferOutput`, `JoinRoutePath`, `LambdaEvent`, `LambdaHandler`, `LambdaResponse`, `LambdaV1Event`, `LambdaV2Event`, `ListenTlsOptions`, `LogFields`, `Logger`, `METHODS`, `McpPromptDescriptor`, `McpResourceDescriptor`, `Method`, `Middleware`, `MountFetchOptions`, `MountOptions`, `MountableApp`, `NetlifyEvent`, `NetlifyHandler`, `NifraFeatureVersion`, `NifraPlugin`, `NifraWebSocket`, `NodeRequestContext`, `NodeRequestHook`, `NodeResponseBodyHook`, `NodeResponseContext`, `NodeResponseHook`, `NodeServeOutcome`, `OnRequestResult`, `OpaqueMountDeclaration`, `Params`, `PlainRender`, `Platform`, `PlatformResponse`, `PluginTypeCollapsed`, `PrefixRegistry`, `Prettify`, `PromptArgument`, `PromptMessage`, `ROUTE_PATTERN_OVERLAP_MAX_STATES`, `RedactOptions`, `Registry`, `RequestLocal`, `RequestPath`, `ResponseBodyHook`, `ResponseBodyReplacement`, `ResponseControls`, `ResponseFinalization`, `ResponseHeadersHook`, `ResponseHeadersView`, `ResponseMapFor`, `ResponseResult`, `RouteConfigError`, `RouteConfigErrorCode`, `RouteDescriptor`, `RouteInfo`, `RouteInfoFor`, `RouteMethod`, `RoutePatternOverlapLimitError`, `RouteSchema`, `Router`, `RouterMatch`, `RunningServer`, `SSEContext`, `SSEInit`, `SSEMessage`, `SSEStream`, `ScheduledController`, `ScheduledHandler`, `Server`, `ServerOptions`, `StandardIssue`, `StandardResult`, `StandardSchemaV1`, `StandardTypes`, `StandardWebSocket`, `StatusResponse`, `ToolAnnotations`, `TypedSSEStream`, `UrlParts`, `VERSION`, `ValidationOutcome`, `VercelHandler`, `Version`, `WebSocketContext`, `WebSocketData`, `WebSocketHandler`, `WebSocketUpgradeOutcome`, `authenticated`, `beforeHandler`, `carryRequestLocals`, `commonSecretPatterns`, `cookieNamePrefix`, `defineContextPlugin`, `defineIdentityPlugin`, `definePlugin`, `defineRouterPlugin`, `hasDuplicateCookie`, `isAuthenticatedRequest`, `isSameOriginForm`, `isSameOriginPath`, `isSameOriginRequest`, `jsonLogger`, `markAuthenticatedRequest`, `parseCookies`, `pathnameOf`, `redactLogFields`, `rejected`, `replacedRequestOf`, `requestLocal`, `routePatternOverlap`, `routeTemplateOf`, `serializeCookie`, `server`, `signValue`, `silentLogger`, `status`, `toFetchHandler`, `toLambdaHandler`, `toNetlifyHandler`, `toVercelHandler`, `unsignValue`, `urlPartsOf`, `varyOn`, `writableResponse`
|
|
20088
20742
|
|
|
20089
20743
|
## @nifrajs/cron
|
|
20090
20744
|
|
|
@@ -20092,7 +20746,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20092
20746
|
|
|
20093
20747
|
## @nifrajs/deno
|
|
20094
20748
|
|
|
20095
|
-
`DenoServer`, `DenoStopOptions`, `FetchHandler`, `ServeOptions`, `serve`
|
|
20749
|
+
`DenoServer`, `DenoStopOptions`, `FetchHandler`, `HashedFiles`, `ServeOptions`, `ServeStaticOptions`, `serve`, `serveStatic`
|
|
20096
20750
|
|
|
20097
20751
|
## @nifrajs/devtools
|
|
20098
20752
|
|
|
@@ -20140,7 +20794,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20140
20794
|
|
|
20141
20795
|
## @nifrajs/middleware
|
|
20142
20796
|
|
|
20143
|
-
`AdmissionControllerHandle`, `AdmissionEvidence`, `AdmissionOptions`, `AdmissionPolicy`, `AdmissionSnapshot`, `ApiKeyStaticOptions`, `ApiKeyVerifyOptions`, `AuthPlugin`, `BasicAuthPlugin`, `BasicAuthStaticOptions`, `BasicAuthVerifyOptions`, `BearerOptions`, `BodyLimitOptions`, `ByteRange`, `ByteRangeResult`, `CacheControlOptions`, `CacheOptions`, `CachedResponse`, `Composable`, `CompressionOptions`, `ConditionalResponseOptions`, `ContentPreference`, `CorsOptions`, `CsrfOptions`, `DurableCommandOptions`, `ETagOptions`, `HealthcheckOptions`, `IdempotencyClaim`, `IdempotencyOptions`, `IdempotencyRecord`, `IdempotencyStore`, `IpMatcher`, `IpRestrictionOptions`, `JwkKey`, `JwksOptions`, `JwtAlgorithm`, `JwtClaims`, `JwtHeader`, `JwtKeyResolver`, `JwtOptions`, `JwtPlugin`, `JwtVerificationKey`, `LanguageMatch`, `LanguageOptions`, `LoggerOptions`, `LoopDelayHistogram`, `LoopDelayMonitor`, `MemoryIdempotencyStore`, `MemoryIdempotencyStoreOptions`, `MemoryResponseCache`, `MemoryResponseCacheOptions`, `MemoryStore`, `MemoryStoreOptions`, `MethodOverrideOptions`, `MultipartBody`, `MultipartHeadersInit`, `MultipartPart`, `MultipartResponseOptions`, `OpenApiInfo`, `OpenApiOptions`, `OpenApiServer`, `OpenApiTag`, `OpenApiUiOptions`, `PoweredByOptions`, `PrettyJsonOptions`, `ProblemDetailsOptions`, `RangeResponseOptions`, `RateLimitOptions`, `RateLimitResult`, `RateLimitStore`, `RateLimitTier`, `RateLimitTiersOptions`, `ReadinessCheck`, `ReadinessCheckOptions`, `ReadinessCheckResult`, `ReadinessCheckStatus`, `ReadinessReport`, `RequestIdOptions`, `RequestLogFields`, `ResponseCacheStore`, `RouteLike`, `SecurityHeadersOptions`, `SecurityRequirement`, `ShedReason`, `TimingControls`, `TimingMetric`, `TimingOptions`, `TrailingSlashOptions`, `VerifiedJwt`, `VerifyJwtOptions`, `VerifyJwtResult`, `apiKey`, `appendTrailingSlash`, `basicAuth`, `bearer`, `bodyLimit`, `buildOpenApiDocument`, `cache`, `cacheControl`, `combine`, `compression`, `conditionalResponse`, `cors`, `createAdmissionController`, `createCsrfToken`, `createEventLoopLagSampler`, `csrf`, `durableCommand`, `etag`, `healthcheck`, `idempotency`, `ipRestriction`, `jwk`, `jwks`, `jwt`, `language`, `logger`, `methodOverride`, `multipartResponse`, `namedCombine`, `negotiateContentType`, `openapi`, `parseAcceptHeader`, `parseByteRange`, `pickLanguage`, `poweredBy`, `prettyJson`, `problemDetails`, `rangeResponse`, `rateLimit`, `rateLimitTiers`, `requestId`, `responseCache`, `securityHeaders`, `timing`, `trimTrailingSlash`, `tryVerifyJwt`, `verifyCsrfToken`, `verifyJwt`
|
|
20797
|
+
`AdmissionControllerHandle`, `AdmissionEvidence`, `AdmissionOptions`, `AdmissionPolicy`, `AdmissionSnapshot`, `ApiKeyStaticOptions`, `ApiKeyVerifyOptions`, `AuthPlugin`, `BasicAuthPlugin`, `BasicAuthStaticOptions`, `BasicAuthVerifyOptions`, `BearerOptions`, `BodyLimitOptions`, `ByteRange`, `ByteRangeResult`, `CacheControlOptions`, `CacheOptions`, `CachedResponse`, `Composable`, `CompressionOptions`, `ConditionalResponseOptions`, `ContentPreference`, `CorsOptions`, `CsrfOptions`, `DurableCommandOptions`, `ETagOptions`, `HealthcheckOptions`, `IdempotencyClaim`, `IdempotencyOptions`, `IdempotencyRecord`, `IdempotencyStore`, `IpMatcher`, `IpRestrictionOptions`, `JwkKey`, `JwksOptions`, `JwtAlgorithm`, `JwtClaims`, `JwtHeader`, `JwtKeyResolver`, `JwtOptions`, `JwtPlugin`, `JwtVerificationKey`, `LanguageMatch`, `LanguageOptions`, `LoggerOptions`, `LoopDelayHistogram`, `LoopDelayMonitor`, `MemoryIdempotencyStore`, `MemoryIdempotencyStoreOptions`, `MemoryResponseCache`, `MemoryResponseCacheOptions`, `MemoryStore`, `MemoryStoreOptions`, `MethodOverrideOptions`, `MultipartBody`, `MultipartHeadersInit`, `MultipartPart`, `MultipartResponseOptions`, `OpenApiInfo`, `OpenApiOptions`, `OpenApiServer`, `OpenApiTag`, `OpenApiUiOptions`, `PoweredByOptions`, `PrettyJsonOptions`, `ProblemDetailsOptions`, `RangeResponseOptions`, `RateLimitOptions`, `RateLimitResult`, `RateLimitStore`, `RateLimitTier`, `RateLimitTiersOptions`, `RateLimiter`, `ReadinessCheck`, `ReadinessCheckOptions`, `ReadinessCheckResult`, `ReadinessCheckStatus`, `ReadinessReport`, `RequestIdOptions`, `RequestLogFields`, `ResponseCacheStore`, `RouteLike`, `SecurityHeadersOptions`, `SecurityRequirement`, `ShedReason`, `TimingControls`, `TimingMetric`, `TimingOptions`, `TrailingSlashOptions`, `VerifiedJwt`, `VerifyJwtOptions`, `VerifyJwtResult`, `apiKey`, `appendTrailingSlash`, `basicAuth`, `bearer`, `bodyLimit`, `buildOpenApiDocument`, `cache`, `cacheControl`, `combine`, `compression`, `conditionalResponse`, `cors`, `createAdmissionController`, `createCsrfToken`, `createEventLoopLagSampler`, `csrf`, `durableCommand`, `etag`, `healthcheck`, `idempotency`, `ipRestriction`, `jwk`, `jwks`, `jwt`, `language`, `logger`, `methodOverride`, `multipartResponse`, `namedCombine`, `negotiateContentType`, `openapi`, `parseAcceptHeader`, `parseByteRange`, `pickLanguage`, `poweredBy`, `prettyJson`, `problemDetails`, `rangeResponse`, `rateLimit`, `rateLimitTiers`, `requestId`, `responseCache`, `securityHeaders`, `timing`, `trimTrailingSlash`, `tryVerifyJwt`, `verifyCsrfToken`, `verifyJwt`
|
|
20144
20798
|
|
|
20145
20799
|
## @nifrajs/mock
|
|
20146
20800
|
|
|
@@ -20148,7 +20802,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20148
20802
|
|
|
20149
20803
|
## @nifrajs/node
|
|
20150
20804
|
|
|
20151
|
-
`FetchHandler`, `NodeServer`, `NodeStopOptions`, `RequestProtocol`, `RequestProtocolOption`, `ServeOptions`, `ServeStaticOptions`, `serve`
|
|
20805
|
+
`FetchHandler`, `HashedFiles`, `NodeServer`, `NodeStopOptions`, `RequestProtocol`, `RequestProtocolOption`, `ServeOptions`, `ServeStaticOptions`, `serve`, `serveStatic`
|
|
20152
20806
|
|
|
20153
20807
|
## @nifrajs/otel
|
|
20154
20808
|
|
|
@@ -20192,7 +20846,7 @@ done-gate, or `nifra mcp` to give the agent live project tools.
|
|
|
20192
20846
|
|
|
20193
20847
|
## @nifrajs/web
|
|
20194
20848
|
|
|
20195
|
-
`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`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateRouteSearchTypesOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `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`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NavigateSearchOf`, `NavigateTargetInput`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `PendingBoundary`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `
|
|
20849
|
+
`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`, `DehydratedState`, `DocumentParts`, `DraftCookieControls`, `DynamicBoundary`, `DynamicBoundaryBatch`, `EnableDraftOptions`, `FetchRouteData`, `Fetcher`, `FetcherState`, `FontDisplay`, `FontFace`, `FontPreloadInput`, `FontSource`, `GenerateClientEntryOptions`, `GenerateRouteSearchTypesOptions`, `GenerateServerManifestOptions`, `GetStaticPaths`, `HANDOVER_ID`, `HostPolicy`, `HostPolicyOptions`, `HostPolicyRule`, `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`, `MutationHandle`, `MutationState`, `MutationStatus`, `NAV_FROM_HEADER`, `NavigateFunction`, `NavigateOptions`, `NavigateSearchOf`, `NavigateTargetInput`, `NonceContext`, `NonceGenerator`, `NonceHeader`, `NonceHeaderContext`, `NonceResolver`, `NotFoundEntry`, `NotFoundScope`, `OpenGraphInput`, `PREFETCH_HEADER`, `PRE_HYDRATION_GUARD`, `PageLocale`, `PageLocales`, `PendingBoundary`, `PrefetchMode`, `PrerenderedPageReaderOptions`, `PrerenderedPages`, `PreviewEndpointOptions`, `QueryClient`, `QueryClientOptions`, `QueryHandle`, `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`, `RouteMatch`, `RouteMiddleware`, `RouteModule`, `RoutePattern`, `RouteSearch`, `RouterState`, `SERVER_FN_MODULE`, `STATUS_HEADER`, `SanitizedHtml`, `ScriptDescriptor`, `SearchOf`, `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`, `generateRouteSearchTypes`, `generateServerManifest`, `getBrowserNavigate`, `gone`, `hashQueryKey`, `isCacheablePage`, `isDraftEnabled`, `isHostPolicy`, `jsonLd`, `localeOfProps`, `mergeHeads`, `nifraScriptHashes`, `normalizeCssLoading`, `notFound`, `openGraph`, `pageLocaleIn`, `prerenderedPageReader`, `previewEndpoint`, `redirect`, `registerBlocker`, `renderPage`, `renderPageResult`, `resolveChainMeta`, `resolveDynamicBoundaries`, `resolveMeta`, `resolveNavigate`, `resolvePublicPath`, `resolveStaticBoundaries`, `revalidate`, `revalidateEndpoint`, `rotateIdentityEpoch`, `sanitizeHtml`, `sanitizedHtml`, `searchOf`, `searchOfChain`, `serializeData`, `serializeSearch`, `setBlockerController`, `setBrowserNavigate`, `setSsrModuleLoader`, `ssrModuleLoader`, `startDynamicBoundaries`, `statusPage`, `trustHtml`, `unsafeInlineScript`, `webProjectEvidence`, `withISR`
|
|
20196
20850
|
|
|
20197
20851
|
## @nifrajs/web-preact
|
|
20198
20852
|
|