@nifrajs/cli 1.6.0 → 1.11.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/README.md +25 -0
- package/dist/assure.d.ts +11 -0
- package/dist/assure.d.ts.map +1 -0
- package/dist/assure.js +67 -0
- package/dist/assure.js.map +1 -0
- package/dist/capabilities-tool.d.ts +33 -0
- package/dist/capabilities-tool.d.ts.map +1 -0
- package/dist/capabilities-tool.js +320 -0
- package/dist/capabilities-tool.js.map +1 -0
- package/dist/check.d.ts +1 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +117 -11
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +196 -9
- package/dist/cli.js.map +1 -1
- package/dist/levels-tool.d.ts +37 -0
- package/dist/levels-tool.d.ts.map +1 -0
- package/dist/levels-tool.js +180 -0
- package/dist/levels-tool.js.map +1 -0
- package/dist/manifest-tool.d.ts +15 -0
- package/dist/manifest-tool.d.ts.map +1 -0
- package/dist/manifest-tool.js +67 -0
- package/dist/manifest-tool.js.map +1 -0
- package/dist/mcp-http.js +1 -1
- package/dist/mcp-http.js.map +1 -1
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +31 -0
- package/dist/mcp.js.map +1 -1
- package/dist/recipes/1.8.0.d.ts +12 -0
- package/dist/recipes/1.8.0.d.ts.map +1 -0
- package/dist/recipes/1.8.0.js +20 -0
- package/dist/recipes/1.8.0.js.map +1 -0
- package/dist/recipes/index.d.ts +28 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +27 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/upgrade.d.ts +82 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +220 -0
- package/dist/upgrade.js.map +1 -0
- package/docs/examples.json +12 -0
- package/docs/llms-full.txt +419 -13
- package/docs/types.json +1923 -32
- package/package.json +8 -8
- package/src/assure.ts +88 -0
- package/src/capabilities-tool.ts +406 -0
- package/src/check.ts +135 -12
- package/src/cli.ts +203 -14
- package/src/levels-tool.ts +222 -0
- package/src/manifest-tool.ts +103 -0
- package/src/mcp-http.ts +1 -1
- package/src/mcp.ts +37 -0
- package/src/recipes/1.8.0.ts +21 -0
- package/src/recipes/index.ts +52 -0
- package/src/upgrade.ts +269 -0
package/docs/types.json
CHANGED
|
@@ -38,7 +38,84 @@
|
|
|
38
38
|
"kind": "type",
|
|
39
39
|
"package": "@nifrajs/core",
|
|
40
40
|
"signature": "export type AddRoute<R extends Registry, Method extends string, Path extends string, Info extends RouteInfo> = R & {\n [P in Path]: {\n [M in Method]: Info;\n };\n};",
|
|
41
|
-
"doc": "
|
|
41
|
+
"doc": "/**\n * Merge a new route into the registry, combining methods that share a path.\n *\n * SCALING CEILING (measured — see many-routes.test-d.ts and the isolation study below): a single\n * fluent chain hits TS2589 at ~95-100 routes. This intersection is NOT the cause — in isolation it\n * accumulates 1000+ routes cleanly, and heavy per-route `Params<Path>`/schema inference alone\n * reaches 600+. The wall is an INTERACTION unique to the fluent builder: each `.get(path, handler)`\n * both (a) computes the handler's context type from the path (`c.params.id` inferred from `:id`)\n * AND (b) returns `Server<AddRoute<growing-R, …>, Ctx>`. Neither alone strains the compiler; the\n * PRODUCT — recomputing the handler context while re-threading the ever-larger registry at each of\n * N steps — exhausts TypeScript's per-expression instantiation budget around N≈95. It is therefore\n * O(N) and inherent to any builder that infers handler context AND accumulates a typed route\n * registry (Elysia/tRPC/hono's typed clients cap the same way); it is not fixable by reshaping\n * AddRoute. Past ~90 routes, use a path that DOESN'T form the product: split into domain groups and\n * `.merge()` them (each group is a short chain; a merge is one `R & R2` intersection with no\n * per-call context work), or contract-first `implement()` (the registry is one object type declared\n * upfront — no grow-R-per-call, so no ceiling at all).\n */"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "AdmissionController",
|
|
45
|
+
"kind": "interface",
|
|
46
|
+
"package": "@nifrajs/core",
|
|
47
|
+
"signature": "export interface AdmissionController {\n admit(req: Request): AdmissionDecision | Promise<AdmissionDecision>;\n}",
|
|
48
|
+
"doc": "/**\n * A capacity-admission gate. Decides, per request, whether the instance has capacity to run it now —\n * bounding *concurrency*, which rate limits (frequency) and deadlines (duration) do not. Provide an\n * implementation (see `@nifrajs/middleware`'s `createAdmissionController`) as {@link ServerOptions.admission}.\n *\n * Enabling it trades the fused native-route lane for native matching + this gate (the gate cannot be a\n * per-request `onRequest` hook without disabling native routes entirely); when unset, the request path\n * is untouched.\n */"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "AdmissionControllerHandle",
|
|
52
|
+
"kind": "interface",
|
|
53
|
+
"package": "@nifrajs/middleware",
|
|
54
|
+
"signature": "export interface AdmissionControllerHandle extends AdmissionController {\n /** Point-in-time counters for observability (otel gauges/counters). */\n snapshot(): AdmissionSnapshot;\n}"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "AdmissionDecision",
|
|
58
|
+
"kind": "type",
|
|
59
|
+
"package": "@nifrajs/core",
|
|
60
|
+
"signature": "export type AdmissionDecision = {\n readonly admitted: true;\n release(): void;\n} | {\n readonly admitted: false;\n readonly response: Response;\n};",
|
|
61
|
+
"doc": "/**\n * The outcome of a capacity-admission decision. `admitted` requests carry a `release` the server calls\n * exactly once when the response is finalized; a shed request carries a ready `429` Response.\n */"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "AdmissionEvidence",
|
|
65
|
+
"kind": "interface",
|
|
66
|
+
"package": "@nifrajs/middleware",
|
|
67
|
+
"signature": "export interface AdmissionEvidence {\n readonly inFlight: number;\n readonly maxInFlight: number;\n readonly lagMs: number;\n readonly maxLagMs: number;\n readonly queued: number;\n}",
|
|
68
|
+
"doc": "/** Pure capacity evidence handed to the policy hook. The mechanics never invent tenant concepts. */"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "AdmissionOptions",
|
|
72
|
+
"kind": "interface",
|
|
73
|
+
"package": "@nifrajs/middleware",
|
|
74
|
+
"signature": "export interface AdmissionOptions {\n /** Max requests running concurrently before the gate queues or sheds. */\n readonly maxInFlight: number;\n /** Event-loop lag ceiling (ms); above it, shed even when slots are free (protects p99). Default ∞. */\n readonly maxLagMs?: number;\n /** How many requests may briefly wait for a slot before shedding. `0` (default) never queues. */\n readonly maxQueue?: number;\n /** How long a queued request waits for a slot before shedding. Default 50ms. */\n readonly queueTimeoutMs?: number;\n /** Reserved slots ABOVE `maxInFlight` that only a policy `admit` may draw from. Default 0. */\n readonly reservedForPolicy?: number;\n /** Base `Retry-After`, in seconds, for shed responses. Default 1. */\n readonly baseRetryAfterSec?: number;\n /**\n * Live event-loop lag source, in ms. Pass {@link createEventLoopLagSampler} to sample the real loop;\n * default `() => 0` disables lag-based shedding (in-flight only).\n */\n readonly lagMs?: () => number;\n readonly policy?: AdmissionPolicy;\n /** Test seam for deterministic queue timeouts; defaults to real timers. */\n readonly setTimer?: (fn: () => void, ms: number) => {\n cancel(): void;\n };\n}"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "AdmissionPolicy",
|
|
78
|
+
"kind": "type",
|
|
79
|
+
"package": "@nifrajs/middleware",
|
|
80
|
+
"signature": "export type AdmissionPolicy = (req: Request, evidence: AdmissionEvidence) => {\n decision: \"admit\" | \"shed\";\n retryAfterSec?: number;\n} | undefined;",
|
|
81
|
+
"doc": "/**\n * Application-supplied admission policy. Return a decision to override the default mechanics\n * for this request, or `undefined` to defer to them. `admit` may draw from reserved headroom above\n * `maxInFlight`; `shed` forces rejection.\n */"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "AdmissionSnapshot",
|
|
85
|
+
"kind": "interface",
|
|
86
|
+
"package": "@nifrajs/middleware",
|
|
87
|
+
"signature": "export interface AdmissionSnapshot {\n readonly inFlight: number;\n readonly queued: number;\n readonly fastPathAdmits: number;\n readonly slowPathEntries: number;\n readonly everQueued: number;\n readonly shed: number;\n}"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "admitDeadline",
|
|
91
|
+
"kind": "function",
|
|
92
|
+
"package": "@nifrajs/core",
|
|
93
|
+
"signature": "export declare function admitDeadline(headers: Headers, options?: DeadlineAdmissionOptions): DeadlineAdmission;",
|
|
94
|
+
"doc": "/**\n * Validate and clamp an inbound absolute deadline. This is pure admission mechanics: callers supply\n * local policy, then own the timer that drives their existing cancellation signal.\n */"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "AdversarialContractError",
|
|
98
|
+
"kind": "class",
|
|
99
|
+
"package": "@nifrajs/testing",
|
|
100
|
+
"signature": "export declare class AdversarialContractError extends Error {\n readonly report: AdversarialContractReport;\n constructor(report: AdversarialContractReport);\n}"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "AdversarialContractOptions",
|
|
104
|
+
"kind": "interface",
|
|
105
|
+
"package": "@nifrajs/testing",
|
|
106
|
+
"signature": "export interface AdversarialContractOptions {\n /** Base origin for generated requests. Default `http://nifra.contract`. */\n readonly origin?: string;\n /** Replayable seed used for deterministic witness generation. */\n readonly seed?: number;\n /** Known-good request values keyed by `\"METHOD /path\"`. Required for opaque Standard Schemas. */\n readonly witnesses?: Readonly<Record<string, ContractWitness>>;\n /** Select a subset of reflected routes. */\n readonly include?: (route: ReflectedRoute) => boolean;\n /** Execute every case against these targets. Default: the supplied app, named `in-process`. */\n readonly runtimes?: readonly ContractRuntime[];\n /** Maximum validator-proven mutations per body/query schema. Default 32. */\n readonly maxMutationsPerInput?: number;\n /** Maximum serialized witness size. Default 256 KiB. */\n readonly maxWitnessBytes?: number;\n /** Statuses that prove an invalid input was rejected. Default `[422]`. */\n readonly expectedValidationStatuses?: readonly number[];\n /**\n * Attach auth, tenant, or runtime-specific state. Return a new Request; the input Request is already\n * fresh for this case and runtime.\n */\n readonly prepareRequest?: (request: Request, context: ContractCaseContext) => Request | Promise<Request>;\n /** Override rejection semantics (for apps with a custom validation response). */\n readonly isRejected?: (response: Response, context: ContractCaseContext) => boolean | Promise<boolean>;\n /** Validate a real successful response for every declared response schema. Default true. */\n readonly validateResponses?: boolean;\n /** Fail the report when a contracted target cannot be exercised. Default true. */\n readonly requireCoverage?: boolean;\n /** Greedily minimize an invalid input that unexpectedly reaches the app. Default true. */\n readonly shrinkFailures?: boolean;\n /** Cap shrink probes for one failure. Default 12. */\n readonly maxShrinkAttempts?: number;\n /** Replay only these stable case IDs. Coverage gaps are advisory when this is set. */\n readonly only?: string | readonly string[];\n}"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "AdversarialContractReport",
|
|
110
|
+
"kind": "interface",
|
|
111
|
+
"package": "@nifrajs/testing",
|
|
112
|
+
"signature": "export interface AdversarialContractReport {\n readonly ok: boolean;\n readonly seed: number;\n readonly routeCount: number;\n readonly targetCount: number;\n readonly runtimeCount: number;\n readonly results: readonly AdversarialContractResult[];\n readonly failures: readonly AdversarialContractResult[];\n readonly gaps: readonly ContractCoverageGap[];\n readonly counts: {\n readonly passed: number;\n readonly failed: number;\n readonly gaps: number;\n };\n}"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "AdversarialContractResult",
|
|
116
|
+
"kind": "interface",
|
|
117
|
+
"package": "@nifrajs/testing",
|
|
118
|
+
"signature": "export interface AdversarialContractResult {\n readonly id: string;\n readonly route: string;\n readonly runtime: string;\n readonly kind: ContractCaseKind;\n readonly target: ContractTarget;\n readonly mutation?: string;\n readonly ok: boolean;\n readonly status?: number;\n readonly message: string;\n /** Number of successful greedy reductions applied to a failing hostile input. */\n readonly shrinkSteps?: number;\n readonly replay: ContractReplay;\n}"
|
|
42
119
|
},
|
|
43
120
|
{
|
|
44
121
|
"name": "AgentFileSpec",
|
|
@@ -202,6 +279,13 @@
|
|
|
202
279
|
"signature": "export declare function applyHead(head: Meta): void;",
|
|
203
280
|
"doc": "/**\n * Sync the document head to a route's resolved {@link Meta} on client navigation. Sets the title\n * (when provided) and replaces the **managed** (`data-nifra`) `<meta>`/`<link>` tags — static head\n * content (charset, hand-written tags) is never touched. SSR injects the same `data-nifra` tags, so\n * the first navigation cleanly takes over from the server-rendered head.\n */"
|
|
204
281
|
},
|
|
282
|
+
{
|
|
283
|
+
"name": "applyImportMoves",
|
|
284
|
+
"kind": "function",
|
|
285
|
+
"package": "@nifrajs/cli",
|
|
286
|
+
"signature": "export declare function applyImportMoves(text: string, moves: readonly {\n from: string;\n to: string;\n}[]): {\n text: string;\n changes: Array<{\n from: string;\n to: string;\n count: number;\n }>;\n};",
|
|
287
|
+
"doc": "/** Rewrite exact import/export/require/dynamic-import specifiers in one source file's text. */"
|
|
288
|
+
},
|
|
205
289
|
{
|
|
206
290
|
"name": "applyResponseHeaders",
|
|
207
291
|
"kind": "function",
|
|
@@ -209,6 +293,13 @@
|
|
|
209
293
|
"signature": "export declare function applyResponseHeaders(headers: Headers, res: NodeHeaderSink): void;",
|
|
210
294
|
"doc": "/**\n * Copy a Web `Response`'s headers onto a Node response, emitting EACH `Set-Cookie` as its own header. The\n * `Headers` iterator (and `.get`) join multiple set-cookie values with \", \", which corrupts cookies — e.g.\n * better-auth's `session_token` + `session_data` collapse into one unparseable cookie and the session is\n * silently lost. `getSetCookie()` returns them split; Node's `setHeader` emits one header per array element.\n */"
|
|
211
295
|
},
|
|
296
|
+
{
|
|
297
|
+
"name": "assertAdversarialContract",
|
|
298
|
+
"kind": "function",
|
|
299
|
+
"package": "@nifrajs/testing",
|
|
300
|
+
"signature": "export declare function assertAdversarialContract(app: ContractTestApp, options?: AdversarialContractOptions): Promise<AdversarialContractReport>;",
|
|
301
|
+
"doc": "/** Run the contract laboratory and throw an {@link AdversarialContractError} unless it is fully green. */"
|
|
302
|
+
},
|
|
212
303
|
{
|
|
213
304
|
"name": "assertAuthableDb",
|
|
214
305
|
"kind": "function",
|
|
@@ -216,6 +307,20 @@
|
|
|
216
307
|
"signature": "export declare function assertAuthableDb(db: DbChoice): void;",
|
|
217
308
|
"doc": "/**\n * Guard `--auth` against a DB whose ORM has no clean better-auth adapter. Throws an actionable error\n * for Kysely (passing a raw dialect to better-auth is manual wiring we won't fake-scaffold). Called by\n * the CLI before scaffolding so the failure is early and explains the fix.\n */"
|
|
218
309
|
},
|
|
310
|
+
{
|
|
311
|
+
"name": "assertBudgetRemaining",
|
|
312
|
+
"kind": "function",
|
|
313
|
+
"package": "@nifrajs/core",
|
|
314
|
+
"signature": "export declare function assertBudgetRemaining(budget: RequestBudget, requiredMs?: number): void;",
|
|
315
|
+
"doc": "/** Fail before starting work that cannot fit inside the remaining time. */"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "assertIncidentReplays",
|
|
319
|
+
"kind": "function",
|
|
320
|
+
"package": "@nifrajs/testing",
|
|
321
|
+
"signature": "export declare function assertIncidentReplays(app: AppLike, capsule: IncidentCapsule, options?: ReplayIncidentOptions): Promise<void>;",
|
|
322
|
+
"doc": "/** Assert a captured incident still reproduces against the current app. Throws {@link IncidentReplayError}. */"
|
|
323
|
+
},
|
|
219
324
|
{
|
|
220
325
|
"name": "assertRenderAdapterConformance",
|
|
221
326
|
"kind": "function",
|
|
@@ -237,6 +342,100 @@
|
|
|
237
342
|
"signature": "export declare function assertStorageAdapterConformance(options: StorageAdapterConformanceOptions): Promise<void>;",
|
|
238
343
|
"doc": "/**\n * Execute the observable {@link StorageAdapter} contract without depending on a test runner.\n *\n * The adapter must be isolated because this writes deterministic conformance keys. The promise resolves\n * only after proving byte + metadata round-trips, overwrite, missing/delete semantics, prefix/limit listing,\n * and uniform unsafe-key rejection across every key-taking method. When the adapter also implements an\n * optional capability ({@link PagedStorageAdapter}, {@link PresignableStorageAdapter},\n * {@link MovableStorageAdapter}), that capability's contract is proven too — implementing a capability\n * partially or unsafely fails conformance rather than silently escaping it.\n */"
|
|
239
344
|
},
|
|
345
|
+
{
|
|
346
|
+
"name": "AssuranceConfig",
|
|
347
|
+
"kind": "interface",
|
|
348
|
+
"package": "@nifrajs/core",
|
|
349
|
+
"signature": "export interface AssuranceConfig {\n readonly source: unknown;\n readonly policy: AssurancePolicy;\n readonly capabilities?: CapabilityPolicy;\n /** Off-request-path manifest artifact/signing integration. Private keys remain behind `signer`. */\n readonly manifest?: {\n /** Default `nifra.manifest.json`. */\n readonly path?: string;\n /** Resolve an operator key reference to a signer (KMS/HSM/local WebCrypto). */\n readonly signer?: (keyRef: string) => NifraManifestSigner | Promise<NifraManifestSigner>;\n };\n /** Dynamic invariant execution is opt-in and must use a disposable/sandboxed target. */\n readonly invariants?: {\n readonly executor: InvariantExecutor;\n };\n}"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "AssuranceDeclaration",
|
|
353
|
+
"kind": "interface",
|
|
354
|
+
"package": "@nifrajs/core",
|
|
355
|
+
"signature": "export interface AssuranceDeclaration extends AssuranceEvidence {\n readonly scope: AssuranceScope;\n /** Restrict evidence to these HTTP methods. Omit for every method. */\n readonly methods?: readonly Method[];\n /** Restrict evidence to these absolute route globs. Omit for every path. */\n readonly paths?: readonly string[];\n}",
|
|
356
|
+
"doc": "/** Metadata installed on a middleware/plugin by {@link withRouteAssurance}. */"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "assuranceDeclarationsOf",
|
|
360
|
+
"kind": "function",
|
|
361
|
+
"package": "@nifrajs/core",
|
|
362
|
+
"signature": "export declare function assuranceDeclarationsOf(value: object): readonly AssuranceDeclaration[];"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "AssuranceEvidence",
|
|
366
|
+
"kind": "interface",
|
|
367
|
+
"package": "@nifrajs/core",
|
|
368
|
+
"signature": "export interface AssuranceEvidence {\n readonly id: string;\n readonly source: string;\n}",
|
|
369
|
+
"doc": "/** Reflection-safe proof that a named enforcement module covered a route. */"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "assuranceEvidenceFor",
|
|
373
|
+
"kind": "function",
|
|
374
|
+
"package": "@nifrajs/core",
|
|
375
|
+
"signature": "export declare function assuranceEvidenceFor(declarationsToApply: readonly AssuranceDeclaration[], method: string, path: string): readonly AssuranceEvidence[];"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "AssuranceFinding",
|
|
379
|
+
"kind": "interface",
|
|
380
|
+
"package": "@nifrajs/core",
|
|
381
|
+
"signature": "export interface AssuranceFinding {\n readonly code: AssuranceFindingCode;\n readonly method: string;\n readonly path: string;\n readonly rule?: string;\n readonly evidence?: string;\n readonly message: string;\n}"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "AssuranceFindingCode",
|
|
385
|
+
"kind": "type",
|
|
386
|
+
"package": "@nifrajs/core",
|
|
387
|
+
"signature": "export type AssuranceFindingCode = \"no-routes\" | \"unclassified-route\" | \"missing-evidence\" | \"forbidden-evidence\";"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "AssurancePolicy",
|
|
391
|
+
"kind": "interface",
|
|
392
|
+
"package": "@nifrajs/core",
|
|
393
|
+
"signature": "export interface AssurancePolicy {\n /** First matching rule owns a route. Put exceptions before broad defaults. */\n readonly rules: readonly AssuranceRule[];\n /** Default `error`: an unclassified route fails closed. */\n readonly unmatched?: \"error\" | \"ignore\";\n /** Default false: reject an empty reflected source so a wrong import cannot pass CI silently. */\n readonly allowEmpty?: boolean;\n}"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "AssuranceReport",
|
|
397
|
+
"kind": "interface",
|
|
398
|
+
"package": "@nifrajs/core",
|
|
399
|
+
"signature": "export interface AssuranceReport {\n readonly ok: boolean;\n readonly routes: readonly AssuredRoute[];\n readonly findings: readonly AssuranceFinding[];\n /** Present when the config enables capability/effect assurance. */\n readonly capabilities?: CapabilityAssuranceReport;\n}"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "AssuranceRouteSelector",
|
|
403
|
+
"kind": "interface",
|
|
404
|
+
"package": "@nifrajs/core",
|
|
405
|
+
"signature": "export interface AssuranceRouteSelector {\n /** Omit for every method. */\n readonly methods?: readonly Method[];\n /** Absolute route globs. `*` matches one segment; final `**` matches zero or more. */\n readonly paths?: readonly string[];\n /** Restrict the rule to MCP tool routes (`true`) or non-tool routes (`false`). */\n readonly tools?: boolean;\n}"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "AssuranceRule",
|
|
409
|
+
"kind": "interface",
|
|
410
|
+
"package": "@nifrajs/core",
|
|
411
|
+
"signature": "export interface AssuranceRule {\n /** Stable human-readable classification included in diagnostics. */\n readonly name: string;\n readonly match: AssuranceRouteSelector;\n /** Evidence ids the route must carry. */\n readonly require?: readonly string[];\n /** Evidence ids the route must not carry (useful for public webhooks and health routes). */\n readonly forbid?: readonly string[];\n}"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "AssuranceScope",
|
|
415
|
+
"kind": "type",
|
|
416
|
+
"package": "@nifrajs/core",
|
|
417
|
+
"signature": "export type AssuranceScope = \"global\" | \"subsequent\" | \"plugin\";",
|
|
418
|
+
"doc": "/** Where enforcement evidence follows Nifra's route-registration semantics. */"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "AssuredCapabilityRoute",
|
|
422
|
+
"kind": "interface",
|
|
423
|
+
"package": "@nifrajs/core",
|
|
424
|
+
"signature": "export interface AssuredCapabilityRoute {\n readonly method: string;\n readonly path: string;\n readonly declared: readonly string[];\n readonly evidence: readonly CapabilityEvidence[];\n /** Declared capabilities without static/runtime evidence. Informational, never treated as proof. */\n readonly unproven: readonly string[];\n readonly covered: boolean;\n /** Highest data-sensitivity the response carries, when the route declares it. */\n readonly classification?: DataClassification;\n}"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"name": "AssuredRoute",
|
|
428
|
+
"kind": "interface",
|
|
429
|
+
"package": "@nifrajs/core",
|
|
430
|
+
"signature": "export interface AssuredRoute {\n readonly method: string;\n readonly path: string;\n readonly rule?: string;\n readonly evidence: readonly AssuranceEvidence[];\n readonly missing: readonly string[];\n readonly forbidden: readonly string[];\n}"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "attachEffectLedger",
|
|
434
|
+
"kind": "function",
|
|
435
|
+
"package": "@nifrajs/core",
|
|
436
|
+
"signature": "export declare function attachEffectLedger(context: object, ledger: RequestLedger): void;",
|
|
437
|
+
"doc": "/** Framework wiring: attach a per-request ledger to a handler context. Not for application code. */"
|
|
438
|
+
},
|
|
240
439
|
{
|
|
241
440
|
"name": "attachWebSocket",
|
|
242
441
|
"kind": "function",
|
|
@@ -334,6 +533,20 @@
|
|
|
334
533
|
"signature": "export interface AwaitProps {\n /** A `Deferred<T>` from a loader/action's `defer(...)`, or an already-resolved value. */\n resolve: Deferred<unknown> | unknown\n /** Rendered with the resolved value (the default snippet). */\n children?: Snippet<[unknown]>\n /** Rendered while the deferred is pending (the SSR + pre-resolve state). */\n pending?: Snippet\n /** Rendered if the deferred rejects. */\n error?: Snippet<[unknown]>\n}",
|
|
335
534
|
"doc": "/**\n * Hand-written types for `Await.svelte` (svelte-package would generate this from the component). The\n * internal build resolves `*.svelte` via the ambient `svelte-shim.d.ts`; this file is what *consumers*\n * resolve through the `./await` export's `types` condition.\n */"
|
|
336
535
|
},
|
|
536
|
+
{
|
|
537
|
+
"name": "BackendMount",
|
|
538
|
+
"kind": "interface",
|
|
539
|
+
"package": "@nifrajs/core",
|
|
540
|
+
"signature": "export interface BackendMount<Env = unknown> {\n readonly [NIFRA_BACKEND_MOUNT]: BackendMountHandler<Env>;\n}",
|
|
541
|
+
"doc": "/** Structural mount capability exposed by an in-process typed client. */"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"name": "BackendMountHandler",
|
|
545
|
+
"kind": "type",
|
|
546
|
+
"package": "@nifrajs/core",
|
|
547
|
+
"signature": "export type BackendMountHandler<Env = unknown> = (request: Request, platform?: Platform<Env>) => Response | Promise<Response>;",
|
|
548
|
+
"doc": "/** Dispatch one already-materialized request into a backend with its outer runtime platform context. */"
|
|
549
|
+
},
|
|
337
550
|
{
|
|
338
551
|
"name": "backendRoutes",
|
|
339
552
|
"kind": "function",
|
|
@@ -472,6 +685,20 @@
|
|
|
472
685
|
"signature": "export declare function bridgeScript(): string;",
|
|
473
686
|
"doc": "/** The bridge source, as a string for inlining in a `<script>`. Self-contained, no imports. */"
|
|
474
687
|
},
|
|
688
|
+
{
|
|
689
|
+
"name": "BrowserNavigate",
|
|
690
|
+
"kind": "type",
|
|
691
|
+
"package": "@nifrajs/web",
|
|
692
|
+
"signature": "export type BrowserNavigate = (to: string | number, options?: NavigateOptions) => void;",
|
|
693
|
+
"doc": "/**\n * A history-aware navigate. A **string** `to` is a same-origin path (`/users/7?tab=a`) navigated to\n * (push, or replace with `{ replace: true }`); a **number** is a history delta (`-1` back, `1`\n * forward), matching the browser's `history.go`. Registered by `installHistory`.\n */"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "BudgetClock",
|
|
697
|
+
"kind": "interface",
|
|
698
|
+
"package": "@nifrajs/core",
|
|
699
|
+
"signature": "export interface BudgetClock {\n /** Monotonic milliseconds; must never move backwards during the process lifetime. */\n monotonic(): number;\n /** Unix epoch milliseconds; used only to translate an absolute wire deadline on admission. */\n wall(): number;\n}",
|
|
700
|
+
"doc": "/** The only clocks deadline mechanics need. Inject both for deterministic tests. */"
|
|
701
|
+
},
|
|
475
702
|
{
|
|
476
703
|
"name": "BUILD_TARGETS",
|
|
477
704
|
"kind": "const",
|
|
@@ -506,6 +733,19 @@
|
|
|
506
733
|
"signature": "export interface BuildManifest {\n /** URL of the client entry module (content-hashed). */\n readonly entry: string;\n /** URLs of every emitted asset (entry + chunks) — for serving + preloading. */\n readonly assets: readonly string[];\n /** `routeId → [layout chunk URLs…, own chunk URL]` — the chunks a route needs, for `createWebApp`'s\n * `routePreload` (`<link rel=\"modulepreload\">` the matched route alongside the entry). Each route +\n * layout is also a build entrypoint, so it gets a named chunk the bootstrap's lazy import dedupes to. */\n readonly routes: Readonly<Record<string, readonly string[]>>;\n /** The app's bundled, content-hashed stylesheet(s) — the bootstrap's **aggregate** CSS (every\n * `import './x.css'` reachable from the app). The complete stylesheet regardless of which file\n * imported the CSS; the always-safe fallback `createWebApp` links when a route has no per-route entry\n * in {@link routeStyles}. Omitted when the app imports no CSS. */\n readonly css?: readonly string[];\n /** `routeId → [chain CSS URLs]` — only the stylesheets the matched route's layout chain + own file\n * actually use (Bun emits a per-entrypoint CSS bundle per route/layout, with shared-component CSS\n * inlined into each consumer). `createWebApp` links these instead of the aggregate, so a page ships\n * only its own CSS. A route is omitted (→ aggregate fallback) when its `[name]` collides with another\n * route's basename (ambiguous CSS↔route) or the build emitted orphan shared-chunk CSS — correctness\n * over minimality. Absent entirely when the app imports no CSS. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n}",
|
|
507
734
|
"doc": "/** The built asset map — the server reads `entry` for the client script + serves `assets`. */"
|
|
508
735
|
},
|
|
736
|
+
{
|
|
737
|
+
"name": "buildNifraManifest",
|
|
738
|
+
"kind": "function",
|
|
739
|
+
"package": "@nifrajs/core",
|
|
740
|
+
"signature": "export declare function buildNifraManifest(input: BuildNifraManifestInput): Promise<NifraManifest>;",
|
|
741
|
+
"doc": "/** Build one fail-closed, deterministic manifest from already-evaluated assurance reports. */"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "BuildNifraManifestInput",
|
|
745
|
+
"kind": "interface",
|
|
746
|
+
"package": "@nifrajs/core",
|
|
747
|
+
"signature": "export interface BuildNifraManifestInput {\n readonly source: unknown;\n readonly assurance?: AssuranceReport;\n readonly capabilities?: CapabilityAssuranceReport;\n}"
|
|
748
|
+
},
|
|
509
749
|
{
|
|
510
750
|
"name": "buildOpenApiDocument",
|
|
511
751
|
"kind": "function",
|
|
@@ -550,7 +790,7 @@
|
|
|
550
790
|
"name": "BuildTargetOptions",
|
|
551
791
|
"kind": "interface",
|
|
552
792
|
"package": "@nifrajs/web",
|
|
553
|
-
"signature": "export interface BuildTargetOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the assembled deploy dir (absolute path). Cleared and recreated. */\n readonly outDir: string;\n /** A scratch directory for intermediate codegen (the generated server entry + manifest) and the\n * server bundle, cleaned up after. Absolute path. */\n readonly workDir: string;\n /** The adapter's client runtime module (exports `mountRouter`), e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `adapter`. */\n readonly adapterImport: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `backend`, or `undefined`. */\n readonly backendImport?: string;\n /**
|
|
793
|
+
"signature": "export interface BuildTargetOptions {\n /** The `routes/` directory to discover (absolute path). */\n readonly routesDir: string;\n /** Output directory for the assembled deploy dir (absolute path). Cleared and recreated. */\n readonly outDir: string;\n /** A scratch directory for intermediate codegen (the generated server entry + manifest) and the\n * server bundle, cleaned up after. Absolute path. */\n readonly workDir: string;\n /** The adapter's client runtime module (exports `mountRouter`), e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `adapter`. */\n readonly adapterImport: string;\n /** Import specifier (resolvable from `workDir`) of the module exporting `backend`, or `undefined`. */\n readonly backendImport?: string;\n /** Factory that builds the app for `static` prerendering, GIVEN the client build's manifest — so the\n * emitted hydration `<script src>` uses the REAL content-hashed entry (`client.entry`) plus the same\n * styles/route-preload the server targets use. A pre-built instance can't work here: the hash isn't known\n * until `buildClient` runs inside `buildTarget`, so a hardcoded entry 404s → pages render but never\n * hydrate. Required for `target: \"static\"` (SSG drives `app.fetch`); ignored otherwise. */\n readonly prerenderApp?: (client: BuildManifest) => PrerenderAppLike | Promise<PrerenderAppLike>;\n /** Client-build plugins (e.g. the MDX/Vue/Solid Bun plugins). */\n readonly clientPlugins?: readonly BunPlugin[];\n /** Server-build plugins (e.g. the SSR variants). */\n readonly serverPlugins?: readonly BunPlugin[];\n /** Extra Bun.build resolve conditions for the CLIENT build. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements layered onto both builds. */\n readonly define?: Readonly<Record<string, string>>;\n /** Document `<title>` for the generated server entry. */\n readonly title?: string;\n}"
|
|
554
794
|
},
|
|
555
795
|
{
|
|
556
796
|
"name": "BuildTargetResult",
|
|
@@ -665,6 +905,13 @@
|
|
|
665
905
|
"signature": "export interface CacheStore {\n /** The cached entry for `key`, or `undefined` on a miss. */\n get(key: string): Promise<CachedResponse | undefined>;\n /** Store (or overwrite) the entry for `key`. */\n set(key: string, value: CachedResponse): Promise<void>;\n /** Drop `key` (on-demand revalidation / purge). A no-op if absent. */\n delete(key: string): Promise<void>;\n}",
|
|
666
906
|
"doc": "/**\n * Pluggable ISR cache backend. **Production deploys MUST use a shared/durable store** (Workers KV,\n * Redis, the platform Cache API) so cached pages *and* revalidation hold across instances;\n * {@link MemoryCacheStore} is dev / single-instance only. Implementations are async so a network store\n * (KV/Redis) fits the same interface.\n */"
|
|
667
907
|
},
|
|
908
|
+
{
|
|
909
|
+
"name": "canAttempt",
|
|
910
|
+
"kind": "function",
|
|
911
|
+
"package": "@nifrajs/core",
|
|
912
|
+
"signature": "export declare function canAttempt(budget: RequestBudget, estimatedAttemptMs: number, reserveMs?: number): boolean;",
|
|
913
|
+
"doc": "/** True only when a new attempt plus a caller-owned reserve can still fit. */"
|
|
914
|
+
},
|
|
668
915
|
{
|
|
669
916
|
"name": "canonical",
|
|
670
917
|
"kind": "function",
|
|
@@ -672,11 +919,189 @@
|
|
|
672
919
|
"signature": "export declare function canonical(href: string): LinkDescriptor;",
|
|
673
920
|
"doc": "/**\n * A `<link rel=\"canonical\">` descriptor for a route's `meta.link`. The canonical URL tells search\n * engines which URL is authoritative for a page (deduping query-string / tracking variants).\n *\n * ```ts\n * export const meta = (a) => ({ link: [canonical(`https://site.com/posts/${a.params.slug}`)] })\n * ```\n */"
|
|
674
921
|
},
|
|
922
|
+
{
|
|
923
|
+
"name": "canonicalizeIdempotencyBody",
|
|
924
|
+
"kind": "function",
|
|
925
|
+
"package": "@nifrajs/core",
|
|
926
|
+
"signature": "export declare function canonicalizeIdempotencyBody(body: Uint8Array, contentType: string | null): Uint8Array;",
|
|
927
|
+
"doc": "/** Canonicalize JSON bodies so whitespace/property-order retries bind to the same semantic request. */"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"name": "canonicalManifest",
|
|
931
|
+
"kind": "function",
|
|
932
|
+
"package": "@nifrajs/core",
|
|
933
|
+
"signature": "export declare function canonicalManifest(manifest: Pick<NifraManifest, \"manifestVersion\" | \"routes\">): string;",
|
|
934
|
+
"doc": "/** Canonical bytes are stable across runtime, object-key order, and route registration order. */"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"name": "CAPABILITY_GUARD",
|
|
938
|
+
"kind": "const",
|
|
939
|
+
"package": "@nifrajs/core",
|
|
940
|
+
"signature": "export declare const CAPABILITY_GUARD: unique symbol;"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "CapabilityAccess",
|
|
944
|
+
"kind": "type",
|
|
945
|
+
"package": "@nifrajs/core",
|
|
946
|
+
"signature": "export type CapabilityAccess = \"read\" | \"write\";"
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"name": "CapabilityAssuranceReport",
|
|
950
|
+
"kind": "interface",
|
|
951
|
+
"package": "@nifrajs/core",
|
|
952
|
+
"signature": "export interface CapabilityAssuranceReport {\n readonly ok: boolean;\n readonly routes: readonly AssuredCapabilityRoute[];\n readonly findings: readonly CapabilityFinding[];\n}"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "CapabilityDefinition",
|
|
956
|
+
"kind": "interface",
|
|
957
|
+
"package": "@nifrajs/core",
|
|
958
|
+
"signature": "export interface CapabilityDefinition {\n readonly id: string;\n /** Domain state is subject to HTTP method semantics; operational writes (logs/metrics) are not. */\n readonly zone: CapabilityZone;\n readonly access: CapabilityAccess;\n /** Evidence required when this capability may execute. Default `none`. */\n readonly idempotency?: CapabilityIdempotency;\n}"
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"name": "CapabilityEvidence",
|
|
962
|
+
"kind": "interface",
|
|
963
|
+
"package": "@nifrajs/core",
|
|
964
|
+
"signature": "export interface CapabilityEvidence {\n readonly id: string;\n readonly kind: CapabilityEvidenceKind;\n readonly source: string;\n}",
|
|
965
|
+
"doc": "/** Token-only effect evidence. `source` is an adapter/module id, never request or business data. */"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"name": "CapabilityEvidenceKind",
|
|
969
|
+
"kind": "type",
|
|
970
|
+
"package": "@nifrajs/core",
|
|
971
|
+
"signature": "export type CapabilityEvidenceKind = \"static\" | \"runtime\";"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
"name": "CapabilityEvidenceSet",
|
|
975
|
+
"kind": "interface",
|
|
976
|
+
"package": "@nifrajs/core",
|
|
977
|
+
"signature": "export interface CapabilityEvidenceSet {\n readonly routes: readonly RouteCapabilityEvidence[];\n}"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"name": "CapabilityFinding",
|
|
981
|
+
"kind": "interface",
|
|
982
|
+
"package": "@nifrajs/core",
|
|
983
|
+
"signature": "export interface CapabilityFinding {\n readonly code: CapabilityFindingCode;\n readonly method: string;\n readonly path: string;\n readonly capability?: string;\n readonly message: string;\n}"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"name": "CapabilityFindingCode",
|
|
987
|
+
"kind": "type",
|
|
988
|
+
"package": "@nifrajs/core",
|
|
989
|
+
"signature": "export type CapabilityFindingCode = \"unknown-capability\" | \"provenance-uncovered\" | \"undeclared-capability-evidence\" | \"safe-method-domain-write\" | \"missing-request-idempotency\" | \"missing-durable-idempotency\" | \"forbidden-effect-import\";"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"name": "CapabilityGuard",
|
|
993
|
+
"kind": "interface",
|
|
994
|
+
"package": "@nifrajs/core",
|
|
995
|
+
"signature": "export interface CapabilityGuard {\n readonly allowed: readonly string[];\n readonly method: string;\n readonly path: string;\n readonly onUse?: (event: CapabilityUseEvent) => void;\n}"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"name": "CapabilityIdempotency",
|
|
999
|
+
"kind": "type",
|
|
1000
|
+
"package": "@nifrajs/core",
|
|
1001
|
+
"signature": "export type CapabilityIdempotency = \"none\" | \"request\" | \"durable\";"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"name": "CapabilityImportRule",
|
|
1005
|
+
"kind": "interface",
|
|
1006
|
+
"package": "@nifrajs/core",
|
|
1007
|
+
"signature": "export interface CapabilityImportRule {\n /** Exact module specifier, or a trailing `/*` prefix rule. */\n readonly specifier: string;\n readonly capabilities: readonly string[];\n}"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"name": "CapabilityImportViolation",
|
|
1011
|
+
"kind": "interface",
|
|
1012
|
+
"package": "@nifrajs/cli",
|
|
1013
|
+
"signature": "export interface CapabilityImportViolation {\n readonly method: string;\n readonly path: string;\n readonly module: string;\n readonly specifier: string;\n readonly reason: string;\n readonly chain: readonly string[];\n}"
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
"name": "CapabilityOutcomeOptions",
|
|
1017
|
+
"kind": "interface",
|
|
1018
|
+
"package": "@nifrajs/core",
|
|
1019
|
+
"signature": "export interface CapabilityOutcomeOptions extends UseCapabilityOptions {\n /** An outcome can only be recorded after the intent beacon succeeded. */\n readonly phase: Exclude<EffectPhase, \"intent\">;\n /** Outcome error as a bounded token code. */\n readonly error?: {\n readonly code: string;\n };\n}"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"name": "CapabilityPolicy",
|
|
1023
|
+
"kind": "interface",
|
|
1024
|
+
"package": "@nifrajs/core",
|
|
1025
|
+
"signature": "export interface CapabilityPolicy {\n readonly definitions: readonly CapabilityDefinition[];\n /** Required: capability assurance without a static provenance firewall is incomplete. */\n readonly provenance: CapabilityProvenancePolicy;\n /** Default `capabilities.lock.json`. */\n readonly lockfile?: string;\n}"
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
"name": "CapabilityProjectReport",
|
|
1029
|
+
"kind": "interface",
|
|
1030
|
+
"package": "@nifrajs/cli",
|
|
1031
|
+
"signature": "export interface CapabilityProjectReport {\n readonly report: CapabilityAssuranceReport;\n readonly violations: readonly CapabilityImportViolation[];\n}"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"name": "CapabilityProvenancePolicy",
|
|
1035
|
+
"kind": "interface",
|
|
1036
|
+
"package": "@nifrajs/core",
|
|
1037
|
+
"signature": "export interface CapabilityProvenancePolicy {\n readonly imports: readonly CapabilityImportRule[];\n readonly forbiddenImports: readonly ForbiddenCapabilityImport[];\n /** Explicit associations for contract/generated routes that source scanning cannot locate. */\n readonly routeModules?: readonly CapabilityRouteModule[];\n}"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"name": "CapabilityRouteModule",
|
|
1041
|
+
"kind": "interface",
|
|
1042
|
+
"package": "@nifrajs/core",
|
|
1043
|
+
"signature": "export interface CapabilityRouteModule {\n readonly match: CapabilityRouteSelector;\n /** Project-relative modules that implement the selected routes. */\n readonly modules: readonly string[];\n}"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"name": "CapabilityRouteSelector",
|
|
1047
|
+
"kind": "interface",
|
|
1048
|
+
"package": "@nifrajs/core",
|
|
1049
|
+
"signature": "export interface CapabilityRouteSelector {\n readonly methods?: readonly string[];\n readonly paths?: readonly string[];\n}"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"name": "CapabilitySnapshot",
|
|
1053
|
+
"kind": "interface",
|
|
1054
|
+
"package": "@nifrajs/core",
|
|
1055
|
+
"signature": "export interface CapabilitySnapshot {\n readonly nifraCapabilities: 1;\n readonly routes: readonly CapabilitySnapshotRoute[];\n}"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"name": "CapabilitySnapshotRoute",
|
|
1059
|
+
"kind": "interface",
|
|
1060
|
+
"package": "@nifrajs/core",
|
|
1061
|
+
"signature": "export interface CapabilitySnapshotRoute {\n readonly method: string;\n readonly path: string;\n readonly declared: readonly string[];\n readonly evidenced: readonly string[];\n readonly unproven: readonly string[];\n /** Recorded so a route that starts returning `pii`/`secret` flips the lockfile and forces a review. */\n readonly classification?: DataClassification;\n}"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"name": "CapabilityUseEvent",
|
|
1065
|
+
"kind": "interface",
|
|
1066
|
+
"package": "@nifrajs/core",
|
|
1067
|
+
"signature": "export interface CapabilityUseEvent {\n readonly capability: string;\n readonly method: string;\n readonly path: string;\n}"
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
"name": "CapabilityZone",
|
|
1071
|
+
"kind": "type",
|
|
1072
|
+
"package": "@nifrajs/core",
|
|
1073
|
+
"signature": "export type CapabilityZone = \"domain\" | \"operational\";"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"name": "CapturedRequest",
|
|
1077
|
+
"kind": "interface",
|
|
1078
|
+
"package": "@nifrajs/testing",
|
|
1079
|
+
"signature": "export interface CapturedRequest {\n readonly method: string;\n readonly path: string;\n readonly query?: Record<string, string>;\n readonly headers?: Record<string, string>;\n readonly body?: unknown;\n}"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"name": "CapturedRequestInput",
|
|
1083
|
+
"kind": "interface",
|
|
1084
|
+
"package": "@nifrajs/testing",
|
|
1085
|
+
"signature": "export interface CapturedRequestInput {\n readonly method?: string;\n readonly path: string;\n readonly query?: Record<string, string>;\n readonly headers?: Record<string, string>;\n readonly body?: unknown;\n}"
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"name": "captureIncident",
|
|
1089
|
+
"kind": "function",
|
|
1090
|
+
"package": "@nifrajs/testing",
|
|
1091
|
+
"signature": "export declare function captureIncident(request: Request | CapturedRequestInput, response: Response | {\n status: number;\n body?: unknown;\n}, options?: CaptureIncidentOptions): Promise<IncidentCapsule>;",
|
|
1092
|
+
"doc": "/** Build a capsule from a real `Request`+`Response`, or from plain captured fields. */"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"name": "CaptureIncidentOptions",
|
|
1096
|
+
"kind": "interface",
|
|
1097
|
+
"package": "@nifrajs/testing",
|
|
1098
|
+
"signature": "export interface CaptureIncidentOptions {\n readonly id?: string;\n readonly capturedAt?: string;\n /** Header names to keep on the capsule (lowercased match). Default: only `content-type`. */\n readonly headerAllowList?: readonly string[];\n readonly note?: string;\n}"
|
|
1099
|
+
},
|
|
675
1100
|
{
|
|
676
1101
|
"name": "CheckDiagnostic",
|
|
677
1102
|
"kind": "interface",
|
|
678
1103
|
"package": "@nifrajs/cli",
|
|
679
|
-
"signature": "export interface CheckDiagnostic {\n readonly rule: \"typecheck\" | \"typed-client\" | \"untyped-client\" | \"server-only-import\" | \"response-route\" | \"undeclared-dependency\" | \"server-manifest-drift\";\n /** `error` fails the gate (a real contract break); `warning` is advisory — surfaced to the agent but\n * does NOT fail `nifra check`, for patterns that are sometimes intentional (a route returning a raw\n * `Response`, which silently drops the typed client to `data: never` but is valid for files/redirects). */\n readonly severity: \"error\" | \"warning\";\n readonly file?: string;\n readonly line?: number;\n readonly message: string;\n /** The canonical, rule-level fix — clean of the per-occurrence snippet, so an agent can apply it\n * directly. Set for the lint rules (they have one correct fix); omitted for `typecheck` (the fix is\n * specific to each type error). */\n readonly fix?: string;\n /** A richer, agent-oriented fix hint. Diffs are only emitted when the edit is mechanical and local;\n * ambiguous cases give concrete steps instead of pretending the checker can safely rewrite code. */\n readonly suggestion?: CheckSuggestion;\n /**\n * The import chain that pulls server-only code into the browser bundle, as display labels\n * `[routeFile, …as-written specifiers…, sink]`. Set only on `server-only-import`.\n *\n * #4.4: this is now the FULL **transitive** chain — a bounded import-resolution walk (`Bun.resolveSync`\n * from each file's dir, BFS the local module graph) follows `route → ../data → ../db → node:crypto`,\n * matching the build leak-guard's depth (`detectNodeBuiltinsInClient` in `@nifrajs/web/build`). A\n * length-2 chain (`[routeFile, specifier]`) means the route imports the sink directly. When a hop can't\n * be resolved precisely (a bare pkg, a tsconfig path alias), the walk degrades to the honest direct\n * edge rather than fabricating a deeper path — never a lie.\n */\n readonly chain?: readonly string[];\n}",
|
|
1104
|
+
"signature": "export interface CheckDiagnostic {\n readonly rule: \"typecheck\" | \"typed-client\" | \"untyped-client\" | \"server-only-import\" | \"response-route\" | \"undeclared-dependency\" | \"server-manifest-drift\" | \"manifest-drift\" | \"capability-assurance\" | \"capability-config\";\n /** `error` fails the gate (a real contract break); `warning` is advisory — surfaced to the agent but\n * does NOT fail `nifra check`, for patterns that are sometimes intentional (a route returning a raw\n * `Response`, which silently drops the typed client to `data: never` but is valid for files/redirects). */\n readonly severity: \"error\" | \"warning\";\n readonly file?: string;\n readonly line?: number;\n readonly message: string;\n /** The canonical, rule-level fix — clean of the per-occurrence snippet, so an agent can apply it\n * directly. Set for the lint rules (they have one correct fix); omitted for `typecheck` (the fix is\n * specific to each type error). */\n readonly fix?: string;\n /** A richer, agent-oriented fix hint. Diffs are only emitted when the edit is mechanical and local;\n * ambiguous cases give concrete steps instead of pretending the checker can safely rewrite code. */\n readonly suggestion?: CheckSuggestion;\n /**\n * The import chain that pulls server-only code into the browser bundle, as display labels\n * `[routeFile, …as-written specifiers…, sink]`. Set only on `server-only-import`.\n *\n * #4.4: this is now the FULL **transitive** chain — a bounded import-resolution walk (`Bun.resolveSync`\n * from each file's dir, BFS the local module graph) follows `route → ../data → ../db → node:crypto`,\n * matching the build leak-guard's depth (`detectNodeBuiltinsInClient` in `@nifrajs/web/build`). A\n * length-2 chain (`[routeFile, specifier]`) means the route imports the sink directly. When a hop can't\n * be resolved precisely (a bare pkg, a tsconfig path alias), the walk degrades to the honest direct\n * edge rather than fabricating a deeper path — never a lie.\n */\n readonly chain?: readonly string[];\n}",
|
|
680
1105
|
"doc": "/** A single machine-readable check failure — the unit an agent (or CI) acts on. */"
|
|
681
1106
|
},
|
|
682
1107
|
{
|
|
@@ -699,6 +1124,26 @@
|
|
|
699
1124
|
"signature": "export interface ChunkSize {\n /** The emitted file's basename (e.g. `index-abc123.js`). */\n readonly name: string;\n /** Raw byte length of the file. */\n readonly bytes: number;\n /** Gzipped byte length (what the client actually downloads, modulo brotli). */\n readonly gzip: number;\n}",
|
|
700
1125
|
"doc": "/** One emitted chunk's measured size, in raw bytes + gzipped bytes (over-the-wire weight). */"
|
|
701
1126
|
},
|
|
1127
|
+
{
|
|
1128
|
+
"name": "classificationAtLeast",
|
|
1129
|
+
"kind": "function",
|
|
1130
|
+
"package": "@nifrajs/core",
|
|
1131
|
+
"signature": "export declare function classificationAtLeast(value: DataClassification, floor: DataClassification): boolean;",
|
|
1132
|
+
"doc": "/** True when `value` is at least as sensitive as `floor` (e.g. `classificationAtLeast(x, \"pii\")`). */"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
"name": "classified",
|
|
1136
|
+
"kind": "function",
|
|
1137
|
+
"package": "@nifrajs/core",
|
|
1138
|
+
"signature": "export declare function classified<S extends object>(schema: S, classification: DataClassification): ClassifiedSchema<S>;",
|
|
1139
|
+
"doc": "/**\n * Attach data-classification metadata without changing validation or inferred input/output types.\n * For Nifra/TypeBox carriers the raw JSON Schema node is tagged too, so metadata survives composition\n * through `t.object`, `t.array`, `t.optional`, and unions.\n */"
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
"name": "ClassifiedSchema",
|
|
1143
|
+
"kind": "type",
|
|
1144
|
+
"package": "@nifrajs/core",
|
|
1145
|
+
"signature": "export type ClassifiedSchema<S extends object> = S & {\n readonly [CLASSIFICATION]: DataClassification;\n};"
|
|
1146
|
+
},
|
|
702
1147
|
{
|
|
703
1148
|
"name": "CLAUDE_MD_PATH",
|
|
704
1149
|
"kind": "const",
|
|
@@ -778,6 +1223,19 @@
|
|
|
778
1223
|
"package": "@nifrajs/web",
|
|
779
1224
|
"signature": "export interface CloudflarePagesRoutesOptions {\n /** Prerendered request paths (e.g. `prerenderRoutes(...).prerendered.map(p => p.path)`, or the\n * build's `prerendered.json`). Each is excluded from the worker — plus its static `_data.json`. */\n readonly prerendered: readonly string[];\n /** Extra globs to keep OFF the worker (CDN-served). Default `[\"/assets/*\"]` (the hashed bundle). */\n readonly staticGlobs?: readonly string[];\n}"
|
|
780
1225
|
},
|
|
1226
|
+
{
|
|
1227
|
+
"name": "collectAssuranceReport",
|
|
1228
|
+
"kind": "function",
|
|
1229
|
+
"package": "@nifrajs/cli",
|
|
1230
|
+
"signature": "export declare function collectAssuranceReport(cwd: string, configPath?: string): Promise<AssuranceReport>;"
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
"name": "collectCapabilityProjectReport",
|
|
1234
|
+
"kind": "function",
|
|
1235
|
+
"package": "@nifrajs/cli",
|
|
1236
|
+
"signature": "export declare function collectCapabilityProjectReport(cwd: string, source: unknown, policyInput: CapabilityPolicy): Promise<CapabilityProjectReport>;",
|
|
1237
|
+
"doc": "/** Build coverage-qualified static evidence for every reflected route. */"
|
|
1238
|
+
},
|
|
781
1239
|
{
|
|
782
1240
|
"name": "collectCheckResult",
|
|
783
1241
|
"kind": "function",
|
|
@@ -792,6 +1250,12 @@
|
|
|
792
1250
|
"signature": "export declare function collectDoctorResult(cwd: string): Promise<DoctorResult>;",
|
|
793
1251
|
"doc": "/** Run doctor against the project at `cwd`: diff source imports vs declared deps. */"
|
|
794
1252
|
},
|
|
1253
|
+
{
|
|
1254
|
+
"name": "CollectLevelsOptions",
|
|
1255
|
+
"kind": "interface",
|
|
1256
|
+
"package": "@nifrajs/cli",
|
|
1257
|
+
"signature": "export interface CollectLevelsOptions {\n readonly config?: string;\n /** Deterministic seed for the L4 invariant run. Default 1. */\n readonly seed?: number;\n}"
|
|
1258
|
+
},
|
|
795
1259
|
{
|
|
796
1260
|
"name": "collectPortResult",
|
|
797
1261
|
"kind": "function",
|
|
@@ -806,6 +1270,13 @@
|
|
|
806
1270
|
"signature": "export declare function collectTestResult(cwd: string, args?: TestToolArgs, opts?: {\n readonly signal?: AbortSignal;\n}): Promise<TestToolResult>;",
|
|
807
1271
|
"doc": "/** Run `bun test` in a project with bounded runtime and bounded output. Arguments are argv entries,\n * never a shell string, so an agent can safely pass a path pattern without command injection risk. */"
|
|
808
1272
|
},
|
|
1273
|
+
{
|
|
1274
|
+
"name": "collectVerificationLevels",
|
|
1275
|
+
"kind": "function",
|
|
1276
|
+
"package": "@nifrajs/cli",
|
|
1277
|
+
"signature": "export declare function collectVerificationLevels(cwd: string, options?: CollectLevelsOptions): Promise<VerificationLevelsResult>;",
|
|
1278
|
+
"doc": "/** Compute the ladder. Each level is evaluated independently, then gated on the levels below. */"
|
|
1279
|
+
},
|
|
809
1280
|
{
|
|
810
1281
|
"name": "combine",
|
|
811
1282
|
"kind": "function",
|
|
@@ -859,7 +1330,7 @@
|
|
|
859
1330
|
"kind": "function",
|
|
860
1331
|
"package": "@nifrajs/web-react",
|
|
861
1332
|
"signature": "export declare function compose(chain: readonly unknown[], props: RenderProps): ReactNode;",
|
|
862
|
-
"doc": "/**\n * Fold a layout chain (outermost layout → page) into a single React tree: the page\n * (innermost) receives `props` (the loader data); each layout wraps the child via its\n * `children`. Shared by the server adapter (renderToString) and the client (hydrateRoot).\n */"
|
|
1333
|
+
"doc": "/**\n * Fold a layout chain (outermost layout → page) into a single React tree: the page\n * (innermost) receives `props` (the loader data); each layout wraps the child via its\n * `children`. Shared by the server adapter (renderToString) and the client (hydrateRoot).\n *\n * The whole tree is wrapped in a {@link RouterContext} provider carrying the matched `params` + the\n * current `path` (both threaded through `RenderProps` identically on SSR and client), so the routing\n * hooks (`useParams`/`useLocation`/`useSearchParams`) read the same value on both sides — no hydration\n * mismatch. A render with no routing fields (a non-router adapter usage) provides the empty default.\n */"
|
|
863
1334
|
},
|
|
864
1335
|
{
|
|
865
1336
|
"name": "compose",
|
|
@@ -902,6 +1373,27 @@
|
|
|
902
1373
|
"signature": "export declare function computed<T>(fn: () => T): () => T;",
|
|
903
1374
|
"doc": "/** Derived value, cached into a signal — recomputes when its tracked inputs change. */"
|
|
904
1375
|
},
|
|
1376
|
+
{
|
|
1377
|
+
"name": "computeEffectDigest",
|
|
1378
|
+
"kind": "function",
|
|
1379
|
+
"package": "@nifrajs/core",
|
|
1380
|
+
"signature": "export declare function computeEffectDigest(key: Uint8Array | CryptoKey, payload: Uint8Array): Promise<string>;",
|
|
1381
|
+
"doc": "/**\n * Keyed HMAC-SHA-256 digest (hex) of an effect payload, for replay/reconciliation matching without\n * storing the payload. Keyed on purpose: a bare hash of low-entropy data (an email, a flag) is\n * brute-forceable and would itself leak. Digest the **whole** effect payload, never a single field.\n */"
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"name": "computeIdempotencyFingerprint",
|
|
1385
|
+
"kind": "function",
|
|
1386
|
+
"package": "@nifrajs/core",
|
|
1387
|
+
"signature": "export declare function computeIdempotencyFingerprint(method: string, path: string, body: Uint8Array, contentType?: string): Promise<string>;",
|
|
1388
|
+
"doc": "/**\n * SHA-256 fingerprint binding a key to one request: method, path (+ query), and the raw body bytes.\n * A collision-resistant hash matters — a weak hash would let a crafted body replay another's response.\n */"
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"name": "computeUpgrade",
|
|
1392
|
+
"kind": "function",
|
|
1393
|
+
"package": "@nifrajs/cli",
|
|
1394
|
+
"signature": "export declare function computeUpgrade(cwd: string, recipe: UpgradeRecipe, write: boolean): UpgradePlan;",
|
|
1395
|
+
"doc": "/** Compute the plan (and, when `write`, apply it) for a target recipe against `cwd`. */"
|
|
1396
|
+
},
|
|
905
1397
|
{
|
|
906
1398
|
"name": "consoleAgentExporter",
|
|
907
1399
|
"kind": "function",
|
|
@@ -979,7 +1471,7 @@
|
|
|
979
1471
|
"name": "Context",
|
|
980
1472
|
"kind": "interface",
|
|
981
1473
|
"package": "@nifrajs/core",
|
|
982
|
-
"signature": "export interface Context<Path extends string = string, S extends RouteSchema = RouteSchema> {\n readonly req: Request;\n /**\n * Alias of {@link req} — the same `Request`. Page loaders/actions receive their request as `request`;\n * this alias lets route handlers and loaders share one name, so `c.request` and `ctx.req` both work\n * everywhere (no more `c.req` vs `ctx.request` mismatch).\n */\n readonly request: Request;\n readonly params: Params<Path>;\n readonly query: QueryOf<S>;\n readonly body: BodyOf<S>;\n /** The request's cookies, parsed from the `Cookie` header (values URL-decoded). Parsed lazily on\n * first access + cached. Signed cookies arrive as `value.signature` — verify with `unsignValue`. */\n readonly cookies: Readonly<Record<string, string>>;\n readonly set: ResponseControls;\n /**\n * Aborts when the server's `requestTimeoutMs` elapses (and never, when no timeout\n * is configured). Pass it to cancellation-aware work — DB drivers, `fetch` — so a\n * timed-out request stops doing work instead of running on after the 503.\n */\n readonly signal: AbortSignal;\n /**\n * Platform bindings from `app.fetch(request, { env })` — Workers `env` (KV/D1/secrets), etc.\n * `undefined` off-edge (Bun/Node/Deno). Declare the shape with `server<Env>()` to read it typed\n * (`c.env: Env`); otherwise `unknown`. Validate at the trust boundary before use either way.\n */\n readonly env: unknown;\n /**\n * Schedule background work. On edge runtimes it extends the response lifetime (Workers\n * `ctx.waitUntil`); off-edge it runs the promise fire-and-forget (a rejection is swallowed,\n * never an unhandled rejection).\n */\n readonly waitUntil: (promise: Promise<unknown>) => void;\n /**\n * Read the raw request body as bytes, **capped** at `maxBytes` (default: the server's\n * `maxBodyBytes`). For routes with **no body schema** — raw bodies, file uploads,\n * BYO-validation — where the automatic schema cap doesn't apply. An over-cap body (by\n * `Content-Length` or while streaming) throws a flat `413`; a malformed `Content-Length`\n * throws `400`. Consumes the body stream (call once). Pass a larger `maxBytes` for an\n * upload route, a smaller one to tighten a specific endpoint.\n */\n readonly boundedBody: (maxBytes?: number) => Promise<Uint8Array>;\n /**\n * `boundedBody` + `JSON.parse` (UTF-8). Same cap + `413`/`400` semantics; additionally\n * throws a flat `400` on invalid JSON. Use for a schema-less JSON endpoint that still\n * wants the body bounded.\n */\n readonly boundedJson: <T = unknown>(maxBytes?: number) => Promise<T>;\n /**\n * Build a JSON `Response`. Pass a status number or a full `ResponseInit` as the second arg. `return` it\n * from a handler, or `throw` it from `derive`/`beforeHandle` to short-circuit — both work:\n * `throw c.json({ error: \"unauthorized\" }, 401)`. A terser alternative to\n * `new Response(JSON.stringify(...), { status, headers: { \"content-type\": \"application/json\" } })`.\n */\n readonly json: (body: unknown, init?: ResponseInit | number) => Response;\n /** Build a `text/plain; charset=utf-8` `Response`. Like {@link json}, pass a status or `ResponseInit`. */\n readonly text: (body: string, init?: ResponseInit | number) => Response;\n}",
|
|
1474
|
+
"signature": "export interface Context<Path extends string = string, S extends RouteSchema = RouteSchema> {\n readonly req: Request;\n /**\n * Alias of {@link req} — the same `Request`. Page loaders/actions receive their request as `request`;\n * this alias lets route handlers and loaders share one name, so `c.request` and `ctx.req` both work\n * everywhere (no more `c.req` vs `ctx.request` mismatch).\n */\n readonly request: Request;\n readonly params: Params<Path>;\n readonly query: QueryOf<S>;\n readonly body: BodyOf<S>;\n /** The request's cookies, parsed from the `Cookie` header (values URL-decoded). Parsed lazily on\n * first access + cached. Signed cookies arrive as `value.signature` — verify with `unsignValue`. */\n readonly cookies: Readonly<Record<string, string>>;\n readonly set: ResponseControls;\n /**\n * Aborts when the server's `requestTimeoutMs` elapses (and never, when no timeout\n * is configured). Pass it to cancellation-aware work — DB drivers, `fetch` — so a\n * timed-out request stops doing work instead of running on after the 503.\n */\n readonly signal: AbortSignal;\n /**\n * Absolute request deadline plus monotonic remaining time. It shares {@link signal}; the server\n * clamps an inbound deadline to local policy when `acceptInboundDeadlines` is enabled.\n */\n readonly budget: RequestBudget;\n /**\n * Platform bindings from `app.fetch(request, { env })` — Workers `env` (KV/D1/secrets), etc.\n * `undefined` off-edge (Bun/Node/Deno). Declare the shape with `server<Env>()` to read it typed\n * (`c.env: Env`); otherwise `unknown`. Validate at the trust boundary before use either way.\n */\n readonly env: unknown;\n /**\n * Schedule background work. On edge runtimes it extends the response lifetime (Workers\n * `ctx.waitUntil`); off-edge it runs the promise fire-and-forget (a rejection is swallowed,\n * never an unhandled rejection).\n */\n readonly waitUntil: (promise: Promise<unknown>) => void;\n /**\n * Read the raw request body as bytes, **capped** at `maxBytes` (default: the server's\n * `maxBodyBytes`). For routes with **no body schema** — raw bodies, file uploads,\n * BYO-validation — where the automatic schema cap doesn't apply. An over-cap body (by\n * `Content-Length` or while streaming) throws a flat `413`; a malformed `Content-Length`\n * throws `400`. Consumes the body stream (call once). Pass a larger `maxBytes` for an\n * upload route, a smaller one to tighten a specific endpoint.\n */\n readonly boundedBody: (maxBytes?: number) => Promise<Uint8Array>;\n /**\n * `boundedBody` + `JSON.parse` (UTF-8). Same cap + `413`/`400` semantics; additionally\n * throws a flat `400` on invalid JSON. Use for a schema-less JSON endpoint that still\n * wants the body bounded.\n */\n readonly boundedJson: <T = unknown>(maxBytes?: number) => Promise<T>;\n /**\n * Build a JSON `Response`. Pass a status number or a full `ResponseInit` as the second arg. `return` it\n * from a handler, or `throw` it from `derive`/`beforeHandle` to short-circuit — both work:\n * `throw c.json({ error: \"unauthorized\" }, 401)`. A terser alternative to\n * `new Response(JSON.stringify(...), { status, headers: { \"content-type\": \"application/json\" } })`.\n */\n readonly json: (body: unknown, init?: ResponseInit | number) => Response;\n /** Build a `text/plain; charset=utf-8` `Response`. Like {@link json}, pass a status or `ResponseInit`. */\n readonly text: (body: string, init?: ResponseInit | number) => Response;\n}",
|
|
983
1475
|
"doc": "/**\n * Handler context. `params` are inferred from the path; `body` and `query` are\n * the validated outputs of their schemas when declared (else `undefined` /\n * raw `URLSearchParams`).\n */"
|
|
984
1476
|
},
|
|
985
1477
|
{
|
|
@@ -1003,6 +1495,44 @@
|
|
|
1003
1495
|
"signature": "export declare function contextStorage(): Middleware;",
|
|
1004
1496
|
"doc": "/**\n * Store the current nifra `Context` in `AsyncLocalStorage` for helpers that run away from the handler\n * argument, e.g. repository/logger functions called deep in the stack.\n *\n * Import from `@nifrajs/middleware/context-storage` so ordinary `@nifrajs/middleware` imports stay\n * node-compat-free on edge runtimes. The runtime must support `node:async_hooks` AsyncLocalStorage.\n */"
|
|
1005
1497
|
},
|
|
1498
|
+
{
|
|
1499
|
+
"name": "ContractCaseContext",
|
|
1500
|
+
"kind": "interface",
|
|
1501
|
+
"package": "@nifrajs/testing",
|
|
1502
|
+
"signature": "export interface ContractCaseContext {\n readonly seed: number;\n readonly caseId: string;\n readonly route: ReflectedRoute;\n readonly runtime: string;\n readonly kind: ContractCaseKind;\n readonly target: ContractTarget;\n readonly mutation?: string;\n}",
|
|
1503
|
+
"doc": "/** Stable context passed to request/rejection hooks. It contains no request payloads or secrets. */"
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "ContractCaseKind",
|
|
1507
|
+
"kind": "type",
|
|
1508
|
+
"package": "@nifrajs/testing",
|
|
1509
|
+
"signature": "export type ContractCaseKind = \"input-rejection\" | \"response-conformance\";"
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"name": "ContractCoverageGap",
|
|
1513
|
+
"kind": "interface",
|
|
1514
|
+
"package": "@nifrajs/testing",
|
|
1515
|
+
"signature": "export interface ContractCoverageGap {\n readonly route?: string;\n readonly target?: ContractTarget;\n readonly code: ContractCoverageGapCode;\n readonly message: string;\n}"
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
"name": "ContractCoverageGapCode",
|
|
1519
|
+
"kind": "type",
|
|
1520
|
+
"package": "@nifrajs/testing",
|
|
1521
|
+
"signature": "export type ContractCoverageGapCode = \"NO_CONTRACT_TARGETS\" | \"NO_VALIDATOR\" | \"NO_WITNESS\" | \"INVALID_WITNESS\" | \"WITNESS_TOO_LARGE\" | \"UNSUPPORTED_BODY_METHOD\" | \"NO_REJECTED_MUTATION\" | \"NO_RUNTIME\" | \"INVALID_RUNTIME\" | \"CASE_NOT_FOUND\";"
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
"name": "ContractReplay",
|
|
1525
|
+
"kind": "interface",
|
|
1526
|
+
"package": "@nifrajs/testing",
|
|
1527
|
+
"signature": "export interface ContractReplay {\n readonly seed: number;\n readonly caseId: string;\n readonly runtime: string;\n}"
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
"name": "ContractRuntime",
|
|
1531
|
+
"kind": "interface",
|
|
1532
|
+
"package": "@nifrajs/testing",
|
|
1533
|
+
"signature": "export interface ContractRuntime {\n readonly name: string;\n fetch(request: Request): Response | Promise<Response>;\n}",
|
|
1534
|
+
"doc": "/** A runtime target for the same generated contract cases (for example Bun, Node, and Workers). */"
|
|
1535
|
+
},
|
|
1006
1536
|
{
|
|
1007
1537
|
"name": "ContractShape",
|
|
1008
1538
|
"kind": "type",
|
|
@@ -1010,6 +1540,26 @@
|
|
|
1010
1540
|
"signature": "export type ContractShape = Record<string, OperationDef>;",
|
|
1011
1541
|
"doc": "/** A contract: named operations. Names are the handler keys and OpenAPI operationIds. */"
|
|
1012
1542
|
},
|
|
1543
|
+
{
|
|
1544
|
+
"name": "ContractTarget",
|
|
1545
|
+
"kind": "type",
|
|
1546
|
+
"package": "@nifrajs/testing",
|
|
1547
|
+
"signature": "export type ContractTarget = \"body\" | \"query\" | \"response\";"
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
"name": "ContractTestApp",
|
|
1551
|
+
"kind": "interface",
|
|
1552
|
+
"package": "@nifrajs/testing",
|
|
1553
|
+
"signature": "export interface ContractTestApp {\n routes(): readonly unknown[];\n fetch(request: Request): Response | Promise<Response>;\n}",
|
|
1554
|
+
"doc": "/** Anything that exposes reflected routes and a Web-standard in-process fetch handler. */"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
"name": "ContractWitness",
|
|
1558
|
+
"kind": "interface",
|
|
1559
|
+
"package": "@nifrajs/testing",
|
|
1560
|
+
"signature": "export interface ContractWitness {\n readonly params?: Readonly<Record<string, string>>;\n readonly query?: unknown;\n readonly body?: unknown;\n readonly headers?: HeaderSource;\n}",
|
|
1561
|
+
"doc": "/** A known-good request. Missing body/query values are synthesized from inspectable JSON Schema. */"
|
|
1562
|
+
},
|
|
1013
1563
|
{
|
|
1014
1564
|
"name": "cookieJar",
|
|
1015
1565
|
"kind": "function",
|
|
@@ -1050,6 +1600,13 @@
|
|
|
1050
1600
|
"package": "@nifrajs/cli",
|
|
1051
1601
|
"signature": "export declare function countBodyHits(lowerBody: string, group: SearchTermGroup, maxHits: number): number;"
|
|
1052
1602
|
},
|
|
1603
|
+
{
|
|
1604
|
+
"name": "createAdmissionController",
|
|
1605
|
+
"kind": "function",
|
|
1606
|
+
"package": "@nifrajs/middleware",
|
|
1607
|
+
"signature": "export declare function createAdmissionController(options: AdmissionOptions): AdmissionControllerHandle;",
|
|
1608
|
+
"doc": "/**\n * Build a capacity-admission controller. Pass the returned handle as the server's `admission` option.\n */"
|
|
1609
|
+
},
|
|
1053
1610
|
{
|
|
1054
1611
|
"name": "createBunWsHandlers",
|
|
1055
1612
|
"kind": "function",
|
|
@@ -1071,6 +1628,12 @@
|
|
|
1071
1628
|
"signature": "export declare function createCachedAppLoader(cwd: string, options?: CachedAppLoaderOptions): (outDirName?: string) => Promise<LoadedApp>;",
|
|
1072
1629
|
"doc": "/** Cache LoadedApp inside one MCP server process, invalidating when config/backend mtimes change. */"
|
|
1073
1630
|
},
|
|
1631
|
+
{
|
|
1632
|
+
"name": "createCapabilityGuard",
|
|
1633
|
+
"kind": "function",
|
|
1634
|
+
"package": "@nifrajs/core",
|
|
1635
|
+
"signature": "export declare function createCapabilityGuard(allowed: readonly string[], method: string, path: string, onUse: ((event: CapabilityUseEvent) => void) | undefined): CapabilityGuard;"
|
|
1636
|
+
},
|
|
1074
1637
|
{
|
|
1075
1638
|
"name": "createClientRouter",
|
|
1076
1639
|
"kind": "function",
|
|
@@ -1091,6 +1654,20 @@
|
|
|
1091
1654
|
"signature": "export declare function createDevServer(options: DevServerOptions): Promise<DevServer>;",
|
|
1092
1655
|
"doc": "/** Start the dev server: build → serve → watch → rebuild + reload on change. */"
|
|
1093
1656
|
},
|
|
1657
|
+
{
|
|
1658
|
+
"name": "createEventLoopLagSampler",
|
|
1659
|
+
"kind": "function",
|
|
1660
|
+
"package": "@nifrajs/middleware",
|
|
1661
|
+
"signature": "export declare function createEventLoopLagSampler(resolutionMs?: number, monitor?: LoopDelayMonitor): () => number;",
|
|
1662
|
+
"doc": "/**\n * Event-loop-lag sampler. By default it measures timer drift using only Web/JS runtime primitives, so\n * it works under Node ESM, Bun, Deno, and workers without a hidden CommonJS `require` fallback. An\n * injected histogram remains available for deterministic tests or a runtime-native monitor. Each read\n * returns recent mean lag and resets the sampling window.\n */"
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
"name": "createEventRegistry",
|
|
1666
|
+
"kind": "function",
|
|
1667
|
+
"package": "@nifrajs/events",
|
|
1668
|
+
"signature": "export declare function createEventRegistry(contracts: readonly EventContract[]): EventRegistry;",
|
|
1669
|
+
"doc": "/** Build a registry from a set of contracts. Throws on a duplicate `type@version`. */"
|
|
1670
|
+
},
|
|
1094
1671
|
{
|
|
1095
1672
|
"name": "createFetcher",
|
|
1096
1673
|
"kind": "function",
|
|
@@ -1137,6 +1714,20 @@
|
|
|
1137
1714
|
"package": "@nifrajs/mcp",
|
|
1138
1715
|
"signature": "export interface CreateMcpServerOptions {\n readonly name: string;\n readonly version: string;\n readonly tools?: readonly McpTool[];\n /** MCP Apps widgets — their resources are registered and the UI capability is advertised. */\n readonly widgets?: readonly McpWidget[];\n /** Extra (non-widget) resources to expose. */\n readonly resources?: readonly McpResource[];\n readonly prompts?: readonly McpPrompt[];\n /** GET health-page text. */\n readonly health?: string;\n /** Max JSON-RPC body size in bytes (default 1 MB). */\n readonly maxBodyBytes?: number;\n}"
|
|
1139
1716
|
},
|
|
1717
|
+
{
|
|
1718
|
+
"name": "createMemoryIdempotencyStore",
|
|
1719
|
+
"kind": "function",
|
|
1720
|
+
"package": "@nifrajs/core",
|
|
1721
|
+
"signature": "export declare function createMemoryIdempotencyStore(options?: MemoryIdempotencyStoreOptions): MemoryIdempotencyStore;",
|
|
1722
|
+
"doc": "/** Convenience factory mirroring the other core primitives' `create*` style. */"
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
"name": "createMemoryLedgerSink",
|
|
1726
|
+
"kind": "function",
|
|
1727
|
+
"package": "@nifrajs/core",
|
|
1728
|
+
"signature": "export declare function createMemoryLedgerSink(options?: MemoryLedgerSinkOptions): MemoryLedgerSink;",
|
|
1729
|
+
"doc": "/** Bounded in-memory sink for tests and local development. Token-only, like every sink. */"
|
|
1730
|
+
},
|
|
1140
1731
|
{
|
|
1141
1732
|
"name": "createMockServer",
|
|
1142
1733
|
"kind": "function",
|
|
@@ -1144,6 +1735,13 @@
|
|
|
1144
1735
|
"signature": "export declare function createMockServer(app: MockableApp, options?: MockServerOptions | undefined): MockServer;",
|
|
1145
1736
|
"doc": "/**\n * Create a mock server from a Nifra app's route definitions. For each route\n * with a `schema.response`, generates a handler returning fake data that\n * matches the response schema structure. Routes without response schemas\n * return `{}`.\n */"
|
|
1146
1737
|
},
|
|
1738
|
+
{
|
|
1739
|
+
"name": "createMutation",
|
|
1740
|
+
"kind": "function",
|
|
1741
|
+
"package": "@nifrajs/web",
|
|
1742
|
+
"signature": "export declare function createMutation<TData, TVariables>(fn: (variables: TVariables) => Promise<TData>, callbacks?: MutationCallbacks<TData, TVariables>): MutationHandle<TData, TVariables>;",
|
|
1743
|
+
"doc": "/**\n * Create a standalone mutation state machine — framework-agnostic, so a per-adapter `useMutation`\n * binding just subscribes to it. Single-flight by a monotonic token: overlapping `mutate` calls each\n * run their `fn`, but only the latest publishes state (an older, slower response can't clobber a newer\n * one). The callbacks fire in TanStack order: `onMutate` (before), then `onSuccess`/`onError`, then\n * `onSettled`.\n */"
|
|
1744
|
+
},
|
|
1147
1745
|
{
|
|
1148
1746
|
"name": "createObservationLifecycle",
|
|
1149
1747
|
"kind": "function",
|
|
@@ -1178,6 +1776,32 @@
|
|
|
1178
1776
|
"signature": "export declare function createQueue(options?: QueueOptions): Queue;",
|
|
1179
1777
|
"doc": "/** Create a job queue. Define jobs, enqueue payloads, and `start()` a worker (or `drain()` once). */"
|
|
1180
1778
|
},
|
|
1779
|
+
{
|
|
1780
|
+
"name": "createRequestBudget",
|
|
1781
|
+
"kind": "function",
|
|
1782
|
+
"package": "@nifrajs/core",
|
|
1783
|
+
"signature": "export declare function createRequestBudget(options: CreateRequestBudgetOptions): RequestBudget;",
|
|
1784
|
+
"doc": "/**\n * Create a budget from an admitted absolute deadline. Wall time is sampled once; every subsequent\n * `remaining()` call is monotonic. This function does not arm a timer—the owner of `signal` does.\n */"
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
"name": "CreateRequestBudgetOptions",
|
|
1788
|
+
"kind": "interface",
|
|
1789
|
+
"package": "@nifrajs/core",
|
|
1790
|
+
"signature": "export interface CreateRequestBudgetOptions {\n /** Absolute Unix epoch deadline. */\n readonly deadline: number;\n readonly signal: AbortSignal;\n readonly clock?: BudgetClock;\n}"
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
"name": "createRequestLedger",
|
|
1794
|
+
"kind": "function",
|
|
1795
|
+
"package": "@nifrajs/core",
|
|
1796
|
+
"signature": "export declare function createRequestLedger(options: CreateRequestLedgerOptions): RequestLedger;",
|
|
1797
|
+
"doc": "/** Create a bounded per-request ledger. The server wires one per capability-declaring route. */"
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
"name": "CreateRequestLedgerOptions",
|
|
1801
|
+
"kind": "interface",
|
|
1802
|
+
"package": "@nifrajs/core",
|
|
1803
|
+
"signature": "export interface CreateRequestLedgerOptions {\n /** HTTP method of the matched route. */\n readonly method: string;\n /** The registered route pattern — callers must never pass the concrete request URL. */\n readonly path: string;\n /** The route's declared capability tokens, surfaced verbatim on the sealed ledger. Default `[]`. */\n readonly declared?: readonly string[];\n /** Entry bound; exceeding it throws {@link EffectLedgerOverflowError}. Default {@link DEFAULT_MAX_ENTRIES}. */\n readonly maxEntries?: number;\n /** Compute the tamper-evident hash chain at seal. Default false. */\n readonly chain?: boolean;\n /** Injectable monotonic clock (ms) for deterministic tests. Default `performance.now`. */\n readonly clock?: () => number;\n}"
|
|
1804
|
+
},
|
|
1181
1805
|
{
|
|
1182
1806
|
"name": "createScheduler",
|
|
1183
1807
|
"kind": "function",
|
|
@@ -1185,6 +1809,13 @@
|
|
|
1185
1809
|
"signature": "export declare function createScheduler(options?: SchedulerOptions): Scheduler;",
|
|
1186
1810
|
"doc": "/** Create an in-process cron scheduler. */"
|
|
1187
1811
|
},
|
|
1812
|
+
{
|
|
1813
|
+
"name": "createSeededRandom",
|
|
1814
|
+
"kind": "function",
|
|
1815
|
+
"package": "@nifrajs/core",
|
|
1816
|
+
"signature": "export declare function createSeededRandom(seed: number): () => number;",
|
|
1817
|
+
"doc": "/** Deterministic PRNG (mulberry32). Ambient randomness would make failures unreproducible. */"
|
|
1818
|
+
},
|
|
1188
1819
|
{
|
|
1189
1820
|
"name": "createSessions",
|
|
1190
1821
|
"kind": "function",
|
|
@@ -1198,6 +1829,13 @@
|
|
|
1198
1829
|
"signature": "export declare function createStylesheetEmitter(build: PluginBuilder, namespace: string): StylesheetEmitter;",
|
|
1199
1830
|
"doc": "/**\n * Wire the virtual-CSS-module handlers onto `build` for `namespace`, returning an {@link StylesheetEmitter}.\n * The `namespace` must be a plain identifier (letters/`-`); it's used verbatim as the import suffix and\n * the Bun namespace. Only the `\"dom\"` build should emit CSS — the `\"ssr\"` build ships no stylesheet.\n */"
|
|
1200
1831
|
},
|
|
1832
|
+
{
|
|
1833
|
+
"name": "createUnboundedRequestBudget",
|
|
1834
|
+
"kind": "function",
|
|
1835
|
+
"package": "@nifrajs/core",
|
|
1836
|
+
"signature": "export declare function createUnboundedRequestBudget(signal: AbortSignal): RequestBudget;",
|
|
1837
|
+
"doc": "/** Create a local no-deadline view. Outbound header propagation deliberately omits it. */"
|
|
1838
|
+
},
|
|
1201
1839
|
{
|
|
1202
1840
|
"name": "createViteDevServer",
|
|
1203
1841
|
"kind": "function",
|
|
@@ -1216,7 +1854,7 @@
|
|
|
1216
1854
|
"name": "CreateWebAppOptions",
|
|
1217
1855
|
"kind": "interface",
|
|
1218
1856
|
"package": "@nifrajs/web",
|
|
1219
|
-
"signature": "export interface CreateWebAppOptions {\n readonly adapter: RenderAdapter;\n readonly manifest: Manifest;\n /** URL of the built client entry (module script) injected into every page. */\n readonly clientEntry: string;\n /** Default document title for all pages. */\n readonly title?: string;\n /** Injected into each loader's `ctx.api` — typically an `inProcessClient(app)` (typed\n * per-route via `@nifrajs/client`'s `createRoutes`). Opaque to the core.\n *\n * **Auto-mount.**
|
|
1857
|
+
"signature": "export interface CreateWebAppOptions {\n readonly adapter: RenderAdapter;\n readonly manifest: Manifest;\n /** URL of the built client entry (module script) injected into every page. */\n readonly clientEntry: string;\n /** Default document title for all pages. */\n readonly title?: string;\n /** Injected into each loader's `ctx.api` — typically an `inProcessClient(app)` (typed\n * per-route via `@nifrajs/client`'s `createRoutes`). Opaque to the core.\n *\n * **Auto-mount.** Every `inProcessClient(backend)` exposes the symbol-keyed platform-aware backend\n * mount interface from `@nifrajs/core/mount`; `createWebApp` also serves that backend over HTTP at\n * {@link apiPrefix} (default `/api`): a request whose pathname starts with the prefix is dispatched\n * before page routing with the same `env`/`waitUntil` platform context, and the backend's `Response`\n * is returned untouched. Legacy custom `.fetch(url, init)` bridges remain mountable but cannot\n * receive platform context. The mount runs in `nifra dev` too. Pass `apiPrefix: \"\"` to disable it. */\n readonly api?: unknown;\n /** HTTP path prefix the {@link api} backend is auto-mounted at (default `\"/api\"`). A request whose\n * pathname is exactly the prefix or starts with `prefix + \"/\"` is dispatched to the backend before\n * page routing; the backend therefore defines its routes at the **full** path (`server().post(\"/api/\n * sync\", …)`), matching the in-process `inProcessClient` call sites. Set to `\"\"` to disable the\n * auto-mount entirely (the app serves pages only and `api` stays a loader-only `ctx.api`). Mounting\n * is also a no-op when `api` has neither the symbol mount nor a legacy callable `.fetch`. */\n readonly apiPrefix?: string;\n /** Secret for **draft / preview mode** (see `enableDraft`). When set, a request carrying a valid\n * signed `__nifra_draft` cookie gets `ctx.draft === true` in loaders/actions (else always `false`).\n * Pair with `withISR({ draftSecret })` so editors bypass the cache. Omit to disable draft mode. */\n readonly draftSecret?: string;\n /** Per-route chunk URLs (`buildClient`'s `BuildManifest.routes`) — `routeId → [layout chunks…, own\n * chunk]`. When present, each page `modulepreload`s its matched route's chunks alongside the entry,\n * so the route code downloads in parallel (no entry→route-chunk waterfall). Omit ⇒ entry-only. */\n readonly routePreload?: Readonly<Record<string, readonly string[]>>;\n /** The app's bundled stylesheet URLs (`buildClient`'s `BuildManifest.css`) — the aggregate, injected\n * as `<link rel=\"stylesheet\">` in a page's `<head>`. Used as the fallback for any route absent from\n * {@link routeStyles}. Omit ⇒ no links (dev, where Vite injects CSS, or a CSS-free app). */\n readonly styles?: readonly string[];\n /** Per-route stylesheet URLs (`buildClient`'s `BuildManifest.routeStyles`) — `routeId → [chain CSS]`.\n * When a matched route has an entry here, only those (its layout chain + own CSS) are linked instead\n * of the aggregate `styles`, so a page ships only the CSS it uses. An empty array ⇒ no `<link>` (the\n * page imports no CSS). Routes absent here fall back to `styles`. Omit ⇒ always use `styles`. */\n readonly routeStyles?: Readonly<Record<string, readonly string[]>>;\n /** SSG: the prerendered-path set (e.g. from `enumeratePrerenderedPaths` or the build's\n * `prerendered.json`). Injected as `window.__NIFRA_PRERENDERED__` on every page so a client soft-nav\n * into a prerendered route fetches its static `_data.json` instead of hitting the worker. */\n readonly prerenderedPaths?: readonly string[];\n /** SSG: per dynamic route pattern, its `getStaticPaths` `fallback` (from `enumerateStaticRoutes` or\n * the build's `prerendered.json`). A route mapped to `\"404\"` rejects any path NOT in\n * `prerenderedPaths` with the 404 page — the unlisted path simply doesn't exist. `\"ssr\"` (the\n * default for unmapped routes) renders unlisted paths on-demand. */\n readonly staticFallbacks?: Readonly<Record<string, \"ssr\" | \"404\">>;\n /** Observe every loader/action failure — for error-reporting plugins (Sentry-style). Called for\n * real throws (not control-flow `Response`s like `redirect`), **before** the nearest `_error`\n * boundary renders / a soft-nav 500 / a rethrow — so it sees errors that the boundary would\n * otherwise hide. Observation only; its own throws are swallowed so a faulty reporter can't break\n * rendering. (`beforeLoader` is intentionally omitted — the core HTTP hooks already cover\n * pre-request work.) */\n readonly onLoaderError?: (error: unknown, ctx: {\n readonly request: Request;\n readonly params: Readonly<Record<string, string>>;\n readonly route: string;\n }) => void;\n}"
|
|
1220
1858
|
},
|
|
1221
1859
|
{
|
|
1222
1860
|
"name": "CronError",
|
|
@@ -1284,6 +1922,13 @@
|
|
|
1284
1922
|
"package": "create-nifra",
|
|
1285
1923
|
"signature": "export declare const CURSOR_MCP_JSON_PATH = \".cursor/mcp.json\";"
|
|
1286
1924
|
},
|
|
1925
|
+
{
|
|
1926
|
+
"name": "DATA_CLASSIFICATION_RANK",
|
|
1927
|
+
"kind": "const",
|
|
1928
|
+
"package": "@nifrajs/core",
|
|
1929
|
+
"signature": "export declare const DATA_CLASSIFICATION_RANK: Readonly<Record<DataClassification, number>>;",
|
|
1930
|
+
"doc": "/** Total order over classifications; higher = more sensitive. */"
|
|
1931
|
+
},
|
|
1287
1932
|
{
|
|
1288
1933
|
"name": "DATA_GLOBAL",
|
|
1289
1934
|
"kind": "const",
|
|
@@ -1298,6 +1943,13 @@
|
|
|
1298
1943
|
"signature": "export declare const DATA_HEADER = \"x-nifra-data\";",
|
|
1299
1944
|
"doc": "/**\n * Request header that asks a nifra route's GET to return just the loader data as JSON (instead of\n * the full HTML document). Set by client-side navigation; read by `createWebApp`'s GET handler.\n */"
|
|
1300
1945
|
},
|
|
1946
|
+
{
|
|
1947
|
+
"name": "DataClassification",
|
|
1948
|
+
"kind": "type",
|
|
1949
|
+
"package": "@nifrajs/core",
|
|
1950
|
+
"signature": "export type DataClassification = \"public\" | \"pii\" | \"secret\";",
|
|
1951
|
+
"doc": "/** Sensitivity of the data a response carries. Ordered `public` < `pii` < `secret`. */"
|
|
1952
|
+
},
|
|
1301
1953
|
{
|
|
1302
1954
|
"name": "dataFileFor",
|
|
1303
1955
|
"kind": "function",
|
|
@@ -1330,6 +1982,50 @@
|
|
|
1330
1982
|
"package": "create-nifra",
|
|
1331
1983
|
"signature": "export interface DbPreset {\n /** Human label for messages, e.g. \"Drizzle + libSQL\". */\n readonly label: string;\n /** Which ORM/query-layer this preset wires (its query idiom + migration story differ). */\n readonly orm: Orm;\n /** SQL dialect, for the auth adapter's `provider` mapping. */\n readonly dialect: \"postgres\" | \"sqlite\";\n /** One-line runtime-fit note (next-steps message + AGENTS.md). */\n readonly note: string;\n readonly deps: Readonly<Record<string, string>>;\n readonly devDeps: Readonly<Record<string, string>>;\n readonly scripts: Readonly<Record<string, string>>;\n /** Relative path → file contents to write into the scaffolded app. */\n readonly files: Readonly<Record<string, string>>;\n}"
|
|
1332
1984
|
},
|
|
1985
|
+
{
|
|
1986
|
+
"name": "DeadlineAdmission",
|
|
1987
|
+
"kind": "type",
|
|
1988
|
+
"package": "@nifrajs/core",
|
|
1989
|
+
"signature": "export type DeadlineAdmission = {\n readonly ok: true;\n readonly inherited: boolean;\n readonly timeoutMs: number;\n /** Absent only for the unbounded no-header/no-local-timeout case. */\n readonly deadline?: number;\n} | {\n readonly ok: false;\n readonly status: 400 | 408;\n readonly reason: \"malformed_deadline\" | \"deadline_exceeded\";\n};"
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
"name": "DeadlineAdmissionOptions",
|
|
1993
|
+
"kind": "interface",
|
|
1994
|
+
"package": "@nifrajs/core",
|
|
1995
|
+
"signature": "export interface DeadlineAdmissionOptions {\n /** Local request timeout. `0` keeps requests without a wire deadline unbounded. */\n readonly localTimeoutMs?: number;\n /** Hard cap for a request carrying the wire header. Default 30 seconds. */\n readonly maxInboundDeadlineMs?: number;\n /** Injected wall clock for deterministic admission tests. */\n readonly wallNow?: () => number;\n}"
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
"name": "DeadlineExceededError",
|
|
1999
|
+
"kind": "class",
|
|
2000
|
+
"package": "@nifrajs/core",
|
|
2001
|
+
"signature": "export declare class DeadlineExceededError extends Error {\n readonly remainingMs: number;\n readonly requiredMs: number;\n readonly code: \"NIFRA_DEADLINE_EXCEEDED\";\n readonly status: 504;\n constructor(remainingMs: number, requiredMs: number);\n}"
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
"name": "DeadlineHeaderResult",
|
|
2005
|
+
"kind": "type",
|
|
2006
|
+
"package": "@nifrajs/core",
|
|
2007
|
+
"signature": "export type DeadlineHeaderResult = {\n readonly ok: true;\n readonly deadline: number;\n} | {\n readonly ok: false;\n readonly reason: \"missing\" | \"malformed\";\n};"
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
"name": "DeadlineHeadersInit",
|
|
2011
|
+
"kind": "type",
|
|
2012
|
+
"package": "@nifrajs/core",
|
|
2013
|
+
"signature": "export type DeadlineHeadersInit = Headers | Readonly<Record<string, string>> | [string, string][] | undefined;",
|
|
2014
|
+
"doc": "/** DOM-lib-independent subset accepted by the Web `Headers` constructor. */"
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
"name": "declarationApplies",
|
|
2018
|
+
"kind": "function",
|
|
2019
|
+
"package": "@nifrajs/core",
|
|
2020
|
+
"signature": "export declare function declarationApplies(declaration: AssuranceDeclaration, method: string, path: string): boolean;"
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
"name": "declaredCapabilities",
|
|
2024
|
+
"kind": "function",
|
|
2025
|
+
"package": "@nifrajs/core",
|
|
2026
|
+
"signature": "export declare function declaredCapabilities(context: object): readonly string[];",
|
|
2027
|
+
"doc": "/**\n * Read the route's token-only declaration for admission plugins. This intentionally exposes neither\n * the request nor runtime evidence; it is the stable public seam for private entitlement policy.\n */"
|
|
2028
|
+
},
|
|
1333
2029
|
{
|
|
1334
2030
|
"name": "decodeBase64",
|
|
1335
2031
|
"kind": "function",
|
|
@@ -1350,6 +2046,12 @@
|
|
|
1350
2046
|
"signature": "export interface DecodedImage {\n /** RGBA bytes, length `width * height * 4`. */\n readonly data: Uint8Array;\n readonly width: number;\n readonly height: number;\n}",
|
|
1351
2047
|
"doc": "/** A decoded image: RGBA pixels + dimensions — the lingua franca of WASM codecs (jSquash, Photon, …). */"
|
|
1352
2048
|
},
|
|
2049
|
+
{
|
|
2050
|
+
"name": "DEFAULT_ASSURANCE_CONFIG",
|
|
2051
|
+
"kind": "const",
|
|
2052
|
+
"package": "@nifrajs/cli",
|
|
2053
|
+
"signature": "export declare const DEFAULT_ASSURANCE_CONFIG = \"nifra.assurance.ts\";"
|
|
2054
|
+
},
|
|
1353
2055
|
{
|
|
1354
2056
|
"name": "DEFAULT_DEV_PORT",
|
|
1355
2057
|
"kind": "const",
|
|
@@ -1357,6 +2059,33 @@
|
|
|
1357
2059
|
"signature": "export declare const DEFAULT_DEV_PORT = 4321;",
|
|
1358
2060
|
"doc": "/**\n * The single default port for the dev server (`@nifrajs/web/dev`, `@nifrajs/web/vite`) **and**\n * `nifra start`. Deliberately uncommon: `3000`/`5173`/`8080` collide with whatever else is running\n * (Next, Vite, a stray Node API). `4321` rarely is — and being the *same* constant across `nifra dev`\n * and `nifra start` means a project's URL doesn't change between commands. Override per-run with\n * `--port <n>` or the `PORT` env var. */"
|
|
1359
2061
|
},
|
|
2062
|
+
{
|
|
2063
|
+
"name": "DEFAULT_IDEMPOTENCY_HEADER",
|
|
2064
|
+
"kind": "const",
|
|
2065
|
+
"package": "@nifrajs/core",
|
|
2066
|
+
"signature": "export declare const DEFAULT_IDEMPOTENCY_HEADER = \"idempotency-key\";",
|
|
2067
|
+
"doc": "/** Canonical request header carrying the client-chosen idempotency key. */"
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
"name": "DEFAULT_IDEMPOTENCY_TTL_MS",
|
|
2071
|
+
"kind": "const",
|
|
2072
|
+
"package": "@nifrajs/core",
|
|
2073
|
+
"signature": "export declare const DEFAULT_IDEMPOTENCY_TTL_MS = 86400000;",
|
|
2074
|
+
"doc": "/** Default retention for a stored idempotent response: 24 hours. */"
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
"name": "DEFAULT_MANIFEST_FILE",
|
|
2078
|
+
"kind": "const",
|
|
2079
|
+
"package": "@nifrajs/cli",
|
|
2080
|
+
"signature": "export declare const DEFAULT_MANIFEST_FILE = \"nifra.manifest.json\";"
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"name": "DEFAULT_MAX_ENTRIES",
|
|
2084
|
+
"kind": "const",
|
|
2085
|
+
"package": "@nifrajs/core",
|
|
2086
|
+
"signature": "export declare const DEFAULT_MAX_ENTRIES = 1000;",
|
|
2087
|
+
"doc": "/** Per-request entry bound. Generous for real handlers, small enough to stop a runaway loop. */"
|
|
2088
|
+
},
|
|
1360
2089
|
{
|
|
1361
2090
|
"name": "DEFAULT_SNAPSHOT_FILE",
|
|
1362
2091
|
"kind": "const",
|
|
@@ -1391,6 +2120,27 @@
|
|
|
1391
2120
|
"signature": "export declare const DEFERRED_RUNTIME = \"(() => {\\n const reg = new Map();\\n const get = (id) => {\\n let e = reg.get(id);\\n if (!e) {\\n let r, j;\\n const p = new Promise((a, b) => { r = a; j = b; });\\n // <Await> reads the tagged status/reason synchronously (it never .then()s a rejected promise),\\n // so attach a no-op catch to keep a rejection from surfacing as an unhandled rejection.\\n p.catch(() => {});\\n e = { p, r, j };\\n reg.set(id, e);\\n }\\n return e;\\n };\\n window.__nifraDeferred = (id) => get(id).p;\\n // Tag the promise (status/value/reason) \\u2014 React's use() reads them and returns SYNCHRONOUSLY at\\n // hydration, so it renders the resolved content directly into the <Suspense> boundary the server\\n // streamed (no re-suspend, no fallback flash). r/j also wake awaiters (Solid uses its own _$HY).\\n window.__nifraResolve = (id, v) => { const e = get(id); e.p.status = \\\"fulfilled\\\"; e.p.value = v; e.r(v); };\\n window.__nifraReject = (id, x) => { const e = get(id); e.p.status = \\\"rejected\\\"; e.p.reason = x; e.j(x); };\\n})();\";",
|
|
1392
2121
|
"doc": "/**\n * Inline client runtime injected into the shell `<head>` when a page has deferred data: a per-id\n * promise registry that streamed `__nifraResolve(id, value)` / `__nifraReject(id, err)` scripts settle\n * (created lazily, so a resolve script that arrives before the client maps the placeholder still\n * works), plus `__nifraDeferred(id)` to read the promise. A plain inline script (not the deferred\n * module entry), so it runs before any streamed resolve script.\n */"
|
|
1393
2122
|
},
|
|
2123
|
+
{
|
|
2124
|
+
"name": "defineAssuranceConfig",
|
|
2125
|
+
"kind": "function",
|
|
2126
|
+
"package": "@nifrajs/core",
|
|
2127
|
+
"signature": "export declare function defineAssuranceConfig(config: AssuranceConfig): AssuranceConfig;",
|
|
2128
|
+
"doc": "/** Identity helper for a `nifra.assurance.ts` default export. */"
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
"name": "defineAssurancePolicy",
|
|
2132
|
+
"kind": "function",
|
|
2133
|
+
"package": "@nifrajs/core",
|
|
2134
|
+
"signature": "export declare function defineAssurancePolicy(policy: AssurancePolicy): AssurancePolicy;",
|
|
2135
|
+
"doc": "/** Validate and freeze an ordered assurance policy. */"
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
"name": "defineCapabilityPolicy",
|
|
2139
|
+
"kind": "function",
|
|
2140
|
+
"package": "@nifrajs/core",
|
|
2141
|
+
"signature": "export declare function defineCapabilityPolicy(policy: CapabilityPolicy): CapabilityPolicy;",
|
|
2142
|
+
"doc": "/** Validate and freeze a capability/provenance policy. */"
|
|
2143
|
+
},
|
|
1394
2144
|
{
|
|
1395
2145
|
"name": "defineContract",
|
|
1396
2146
|
"kind": "function",
|
|
@@ -1411,6 +2161,13 @@
|
|
|
1411
2161
|
"package": "@nifrajs/env",
|
|
1412
2162
|
"signature": "export interface DefineEnvOptions {\n /**\n * Where to read variables from. Defaults to `process.env` (Bun/Node). On Cloudflare Workers there\n * is no `process.env` — pass the request's `env` bindings: `defineEnv(shape, { source: env })`.\n */\n readonly source?: Record<string, string | undefined>;\n}"
|
|
1413
2163
|
},
|
|
2164
|
+
{
|
|
2165
|
+
"name": "defineEventContract",
|
|
2166
|
+
"kind": "function",
|
|
2167
|
+
"package": "@nifrajs/events",
|
|
2168
|
+
"signature": "export declare function defineEventContract<Schema extends StandardSchemaV1>(spec: {\n type: string;\n version: number;\n payload: Schema;\n}): EventContract<Schema>;",
|
|
2169
|
+
"doc": "/** Define a portable, versioned event contract. */"
|
|
2170
|
+
},
|
|
1414
2171
|
{
|
|
1415
2172
|
"name": "defineIdentityPlugin",
|
|
1416
2173
|
"kind": "function",
|
|
@@ -1428,7 +2185,7 @@
|
|
|
1428
2185
|
"name": "DefineMcpToolOptions",
|
|
1429
2186
|
"kind": "interface",
|
|
1430
2187
|
"package": "@nifrajs/mcp",
|
|
1431
|
-
"signature": "export interface DefineMcpToolOptions {\n readonly name: string;\n readonly description: string;\n /** JSON Schema for the arguments. Defaults to an empty object schema. */\n readonly inputSchema?: Record<string, unknown>;\n /** Link a widget so the tool's result renders as interactive UI in MCP Apps hosts (iframe). */\n readonly widget?: McpWidget;\n /** Render-intent for generative hosts that build their own themed UI from `structuredContent`. Lands\n * in `_meta.ui.intent`. Independent of `widget` — a tool can offer both (widget for MCP Apps hosts,\n * intent for builders
|
|
2188
|
+
"signature": "export interface DefineMcpToolOptions {\n readonly name: string;\n readonly description: string;\n /** JSON Schema for the arguments. Defaults to an empty object schema. */\n readonly inputSchema?: Record<string, unknown>;\n /** Link a widget so the tool's result renders as interactive UI in MCP Apps hosts (iframe). */\n readonly widget?: McpWidget;\n /** Render-intent for generative hosts that build their own themed UI from `structuredContent`. Lands\n * in `_meta.ui.intent`. Independent of `widget` — a tool can offer both (widget for MCP Apps hosts,\n * intent for generative builders). */\n readonly intent?: McpUiIntent;\n readonly handler: (args: Record<string, unknown>, context: McpToolContext) => McpToolHandlerResult | Promise<McpToolHandlerResult>;\n}"
|
|
1432
2189
|
},
|
|
1433
2190
|
{
|
|
1434
2191
|
"name": "defineMcpWidget",
|
|
@@ -1456,6 +2213,13 @@
|
|
|
1456
2213
|
"signature": "export declare const defineRouterPlugin: typeof defineIdentityPlugin;",
|
|
1457
2214
|
"doc": "/**\n * Alias of {@link defineIdentityPlugin} with a name that says what it's FOR: a plugin that **mounts\n * routes/hooks but adds no context type** (an auth router, an audit logger). Use this — not\n * {@link definePlugin} — for any such plugin, or the typed client silently collapses to `any`. The\n * \"identity\" in {@link defineIdentityPlugin} refers to the type-identity it preserves; `defineRouterPlugin`\n * is the same thing under a clearer name.\n *\n * Mount routes as a **side effect**, then return the app unchanged (registering via `.get`/`.post` would\n * change the type away from the identity `S`; the mounted routes run but aren't in the caller's typed\n * registry — that's the trade that keeps everything else typed):\n *\n * ```ts\n * export const scim = defineRouterPlugin(\"scim\", (app) => {\n * app.get(\"/scim/v2/Users\", listUsers) // side effect: mounted at runtime\n * return app // return S unchanged → routes added after .use(scim) stay typed\n * })\n * const api = server().get(\"/a\", h).use(scim).get(\"/b\", h) // /a AND /b stay typed\n * ```\n */"
|
|
1458
2215
|
},
|
|
2216
|
+
{
|
|
2217
|
+
"name": "DehydratedState",
|
|
2218
|
+
"kind": "interface",
|
|
2219
|
+
"package": "@nifrajs/web",
|
|
2220
|
+
"signature": "export interface DehydratedState {\n readonly queries: ReadonlyArray<{\n readonly key: unknown;\n readonly data: unknown;\n readonly updatedAt: number;\n }>;\n}",
|
|
2221
|
+
"doc": "/** A serializable snapshot of the cache's successful queries — the SSR→client bridge payload. */"
|
|
2222
|
+
},
|
|
1459
2223
|
{
|
|
1460
2224
|
"name": "describeProject",
|
|
1461
2225
|
"kind": "function",
|
|
@@ -1557,6 +2321,13 @@
|
|
|
1557
2321
|
"package": "@nifrajs/devtools",
|
|
1558
2322
|
"signature": "export interface DevToolsOptions {\n /** Maximum events to retain in the ring buffer (default 200). */\n readonly maxEvents?: number | undefined;\n /** Maximum simultaneous SSE connections (default 5). */\n readonly maxConnections?: number | undefined;\n /** SSE path (default `/_nifra/devtools`). */\n readonly path?: string | undefined;\n /** Explicit enable switch. Defaults to true only when `NODE_ENV === \"development\"`. */\n readonly enabled?: boolean | undefined;\n /** Permit non-loopback URL hosts. Default false. */\n readonly allowRemote?: boolean | undefined;\n /** Additional origins permitted to open the stream. Same-origin requests are always allowed. */\n readonly allowedOrigins?: readonly string[] | undefined;\n /** Optional request authorization for the stream. */\n readonly authorize?: ((request: Request) => boolean | Promise<boolean>) | undefined;\n /**\n * Interval for SSE keep-alive comment frames, in milliseconds (default 15000). Pings stop\n * idle proxies/dev tunnels from dropping the stream and evict dead connections so they no\n * longer count against `maxConnections`.\n */\n readonly pingIntervalMs?: number | undefined;\n}"
|
|
1559
2323
|
},
|
|
2324
|
+
{
|
|
2325
|
+
"name": "diffCapabilitySnapshots",
|
|
2326
|
+
"kind": "function",
|
|
2327
|
+
"package": "@nifrajs/cli",
|
|
2328
|
+
"signature": "export declare function diffCapabilitySnapshots(before: CapabilitySnapshot, after: CapabilitySnapshot): readonly string[];",
|
|
2329
|
+
"doc": "/** Exact lockfile drift. Human approval is supplied by reviewing the checked-in lockfile change. */"
|
|
2330
|
+
},
|
|
1560
2331
|
{
|
|
1561
2332
|
"name": "diffManifestRoutes",
|
|
1562
2333
|
"kind": "function",
|
|
@@ -1564,6 +2335,13 @@
|
|
|
1564
2335
|
"signature": "export declare function diffManifestRoutes(manifestFiles: readonly string[], discoveredFiles: readonly string[]): ManifestDrift;",
|
|
1565
2336
|
"doc": "/**\n * Diff the route files a committed server-manifest imports against the files freshly discovered in\n * `routes/`. Returns the `missing` (in routes/, not in manifest — stale manifest) and `extra` (in\n * manifest, gone from routes/ — dangling import) sets. Empty arrays ⇒ in sync. Pure — the caller\n * supplies both file lists (the committed source is parsed via {@link parseManifestRouteFiles}; the\n * fresh list comes from `discoverRoutes`). Lists need not be pre-sorted; the result is sorted.\n */"
|
|
1566
2337
|
},
|
|
2338
|
+
{
|
|
2339
|
+
"name": "diffNifraManifests",
|
|
2340
|
+
"kind": "function",
|
|
2341
|
+
"package": "@nifrajs/core",
|
|
2342
|
+
"signature": "export declare function diffNifraManifests(before: NifraManifest, after: NifraManifest): NifraManifestDiff;",
|
|
2343
|
+
"doc": "/** Contract changes reuse the route-diff engine; governance changes fail closed on expanded risk. */"
|
|
2344
|
+
},
|
|
1567
2345
|
{
|
|
1568
2346
|
"name": "diffRouteSnapshots",
|
|
1569
2347
|
"kind": "function",
|
|
@@ -1678,6 +2456,69 @@
|
|
|
1678
2456
|
"signature": "export declare function effect(fn: () => void): () => void;",
|
|
1679
2457
|
"doc": "/**\n * Run `fn` now and again whenever any signal it read changes. Returns a disposer. Dependencies\n * re-track on every run, so conditional reads subscribe to exactly the live branch.\n */"
|
|
1680
2458
|
},
|
|
2459
|
+
{
|
|
2460
|
+
"name": "EffectChain",
|
|
2461
|
+
"kind": "interface",
|
|
2462
|
+
"package": "@nifrajs/core",
|
|
2463
|
+
"signature": "export interface EffectChain {\n /** `hashes[i]` = SHA-256(hex) over (`hashes[i-1]` + canonical entry `i`). */\n readonly hashes: readonly string[];\n /** Last entry hash, or the route-header hash for an empty ledger. Anchor/sign this externally. */\n readonly head: string;\n}",
|
|
2464
|
+
"doc": "/** Tamper-evidence over the route identity, declarations, and sealed entries. */"
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
"name": "EffectCost",
|
|
2468
|
+
"kind": "type",
|
|
2469
|
+
"package": "@nifrajs/core",
|
|
2470
|
+
"signature": "export type EffectCost = Readonly<Record<string, number>>;",
|
|
2471
|
+
"doc": "/**\n * Dimensionless resource counters (`{ ms: 12, calls: 1, bytes: 512 }`). Counters carry *how much\n * resource* an effect consumed; mapping counters to money/pricing is deliberately out of scope here.\n */"
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
"name": "EffectEntry",
|
|
2475
|
+
"kind": "interface",
|
|
2476
|
+
"package": "@nifrajs/core",
|
|
2477
|
+
"signature": "export interface EffectEntry {\n /** Monotonic position within the request (0-based). The replay/simulation order. */\n readonly seq: number;\n /** Milliseconds from the ledger's (injectable) clock at append time. */\n readonly at: number;\n readonly capability: string;\n readonly phase: EffectPhase;\n readonly target?: string;\n readonly cost?: EffectCost;\n readonly digest?: string;\n readonly error?: {\n readonly code: string;\n };\n}",
|
|
2478
|
+
"doc": "/** One recorded effect. Frozen; token-only by construction (no payload field exists). */"
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
"name": "EffectEntryInput",
|
|
2482
|
+
"kind": "interface",
|
|
2483
|
+
"package": "@nifrajs/core",
|
|
2484
|
+
"signature": "export interface EffectEntryInput {\n /** Capability token (`db.write`, `payments.charge`). Must be a valid capability id. */\n readonly capability: string;\n /** Default `\"intent\"`. Record `committed`/`failed`/`compensated` only after the outcome is known. */\n readonly phase?: EffectPhase;\n /** Adapter/resource token (`repo:orders`, `provider:payments`). A token — never a value or a row. */\n readonly target?: string;\n /** Dimensionless counters; see {@link EffectCost}. At most {@link MAX_COST_AXES} axes. */\n readonly cost?: EffectCost;\n /** Optional keyed-HMAC digest of the effect payload (see {@link computeEffectDigest}); hex, 64 chars. */\n readonly digest?: string;\n /** Outcome error as a bounded token code — never a message, never a stack. */\n readonly error?: {\n readonly code: string;\n };\n}",
|
|
2485
|
+
"doc": "/** Caller-supplied fields for one entry. Everything else (`seq`, `at`) is assigned by the ledger. */"
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
"name": "effectLedgerOf",
|
|
2489
|
+
"kind": "function",
|
|
2490
|
+
"package": "@nifrajs/core",
|
|
2491
|
+
"signature": "export declare function effectLedgerOf(context: object): RequestLedger | undefined;",
|
|
2492
|
+
"doc": "/** The request's effect ledger, when the server enabled one for this route. Read-only access. */"
|
|
2493
|
+
},
|
|
2494
|
+
{
|
|
2495
|
+
"name": "EffectLedgerOptions",
|
|
2496
|
+
"kind": "interface",
|
|
2497
|
+
"package": "@nifrajs/core",
|
|
2498
|
+
"signature": "export interface EffectLedgerOptions {\n /** Receives each request's sealed ledger (only when it recorded entries). */\n readonly sink: LedgerSink;\n /** Per-request entry bound. Default {@link DEFAULT_MAX_ENTRIES}. */\n readonly maxEntries?: number;\n /** Compute the tamper-evident hash chain at seal. Default false. */\n readonly chain?: boolean;\n}",
|
|
2499
|
+
"doc": "/** Server-level effect ledger configuration (see `server({ effectLedger })`). */"
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
"name": "EffectLedgerOverflowError",
|
|
2503
|
+
"kind": "class",
|
|
2504
|
+
"package": "@nifrajs/core",
|
|
2505
|
+
"signature": "export declare class EffectLedgerOverflowError extends Error {\n readonly maxEntries: number;\n constructor(maxEntries: number);\n}",
|
|
2506
|
+
"doc": "/** Thrown by `append` when the per-request entry bound is exceeded. Fails the request closed. */"
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
"name": "EffectLedgerSealedError",
|
|
2510
|
+
"kind": "class",
|
|
2511
|
+
"package": "@nifrajs/core",
|
|
2512
|
+
"signature": "export declare class EffectLedgerSealedError extends Error {\n constructor();\n}",
|
|
2513
|
+
"doc": "/** Thrown by `append` after `seal()` — e.g. an effect attempted while streaming a response body. */"
|
|
2514
|
+
},
|
|
2515
|
+
{
|
|
2516
|
+
"name": "EffectPhase",
|
|
2517
|
+
"kind": "type",
|
|
2518
|
+
"package": "@nifrajs/core",
|
|
2519
|
+
"signature": "export type EffectPhase = \"intent\" | \"committed\" | \"failed\" | \"compensated\";",
|
|
2520
|
+
"doc": "/** Lifecycle phase of one effect. `intent` precedes execution; the rest describe its outcome. */"
|
|
2521
|
+
},
|
|
1681
2522
|
{
|
|
1682
2523
|
"name": "EMPTY_PARAMS",
|
|
1683
2524
|
"kind": "const",
|
|
@@ -1827,6 +2668,52 @@
|
|
|
1827
2668
|
"package": "@nifrajs/middleware",
|
|
1828
2669
|
"signature": "export interface ETagOptions {\n /** Emit a weak validator (`W/\"…\"`). Default `true` — it's a content hash, not a byte-for-byte promise. */\n readonly weak?: boolean;\n /** Maximum response bytes to hash. Default `1_000_000`; larger responses pass through unchanged. */\n readonly maxBytes?: number;\n}"
|
|
1829
2670
|
},
|
|
2671
|
+
{
|
|
2672
|
+
"name": "evaluateCapabilityAssurance",
|
|
2673
|
+
"kind": "function",
|
|
2674
|
+
"package": "@nifrajs/core",
|
|
2675
|
+
"signature": "export declare function evaluateCapabilityAssurance(source: unknown, policyInput: CapabilityPolicy, evidenceSet: CapabilityEvidenceSet): CapabilityAssuranceReport;",
|
|
2676
|
+
"doc": "/** Compare declared route capabilities against coverage-qualified static/runtime evidence. */"
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
"name": "evaluateRouteAssurance",
|
|
2680
|
+
"kind": "function",
|
|
2681
|
+
"package": "@nifrajs/core",
|
|
2682
|
+
"signature": "export declare function evaluateRouteAssurance(source: unknown, policyInput: AssurancePolicy): AssuranceReport;",
|
|
2683
|
+
"doc": "/** Evaluate reflected route evidence against the first matching policy rule. */"
|
|
2684
|
+
},
|
|
2685
|
+
{
|
|
2686
|
+
"name": "EventContract",
|
|
2687
|
+
"kind": "interface",
|
|
2688
|
+
"package": "@nifrajs/events",
|
|
2689
|
+
"signature": "export interface EventContract<Schema extends StandardSchemaV1 = StandardSchemaV1> {\n readonly type: string;\n readonly version: number;\n readonly payload: Schema;\n /**\n * Validate a payload and stamp a full envelope (`id`, `occurredAt`). Throws {@link EventContractError}\n * on an invalid payload. Sync validators only — an async schema throws (use a sync payload schema for\n * events; the whole point is a cheap boundary check).\n */\n create(payload: InferInput<Schema>, options?: {\n id?: string;\n occurredAt?: string;\n }): EventEnvelope<InferOutput<Schema>>;\n /** Parse untrusted input against this exact contract (type + version + payload). Never throws. */\n parse(input: unknown): EventParseResult<InferOutput<Schema>>;\n /** Boolean guard form of {@link parse}. */\n is(input: unknown): input is EventEnvelope<InferOutput<Schema>>;\n}"
|
|
2690
|
+
},
|
|
2691
|
+
{
|
|
2692
|
+
"name": "EventContractError",
|
|
2693
|
+
"kind": "class",
|
|
2694
|
+
"package": "@nifrajs/events",
|
|
2695
|
+
"signature": "export declare class EventContractError extends Error {\n readonly type: string;\n readonly version: number;\n readonly issues: readonly StandardIssue[];\n constructor(type: string, version: number, issues: readonly StandardIssue[]);\n}",
|
|
2696
|
+
"doc": "/** Thrown by {@link EventContract.create} when the payload fails the contract schema. */"
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
"name": "EventEnvelope",
|
|
2700
|
+
"kind": "interface",
|
|
2701
|
+
"package": "@nifrajs/events",
|
|
2702
|
+
"signature": "export interface EventEnvelope<Payload = unknown> {\n /** Unique event id (`evt_<uuid>`), stable across redeliveries. */\n readonly id: string;\n /** Event type name, e.g. `order.paid`. */\n readonly type: string;\n /** Contract version. Bump on a breaking payload change; old + new versions coexist in a registry. */\n readonly version: number;\n /** ISO-8601 instant the event occurred. */\n readonly occurredAt: string;\n readonly payload: Payload;\n}",
|
|
2703
|
+
"doc": "/** The portable wire shape: identity + versioned type + timestamp + validated payload. */"
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
"name": "EventParseResult",
|
|
2707
|
+
"kind": "type",
|
|
2708
|
+
"package": "@nifrajs/events",
|
|
2709
|
+
"signature": "export type EventParseResult<Payload> = {\n readonly success: true;\n readonly envelope: EventEnvelope<Payload>;\n} | {\n readonly success: false;\n readonly issues: readonly StandardIssue[];\n};"
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
"name": "EventRegistry",
|
|
2713
|
+
"kind": "interface",
|
|
2714
|
+
"package": "@nifrajs/events",
|
|
2715
|
+
"signature": "export interface EventRegistry {\n readonly contracts: readonly EventContract[];\n /** Look up a contract by type + version (defaults to version 0). */\n get(type: string, version?: number): EventContract | undefined;\n /** Dispatch untrusted input to its contract by `type`/`version` and parse. Never throws. */\n parse(input: unknown): RegistryParseResult;\n}"
|
|
2716
|
+
},
|
|
1830
2717
|
{
|
|
1831
2718
|
"name": "Evidence",
|
|
1832
2719
|
"kind": "interface",
|
|
@@ -2086,6 +2973,18 @@
|
|
|
2086
2973
|
"package": "@nifrajs/web",
|
|
2087
2974
|
"signature": "export interface FontSource {\n /** URL of the self-hosted font file. */\n readonly url: string;\n /** `format()` hint (`woff2`, `woff`, `truetype`, …). Inferred from the URL extension when omitted. */\n readonly format?: string;\n}"
|
|
2088
2975
|
},
|
|
2976
|
+
{
|
|
2977
|
+
"name": "ForbiddenCapabilityImport",
|
|
2978
|
+
"kind": "interface",
|
|
2979
|
+
"package": "@nifrajs/core",
|
|
2980
|
+
"signature": "export interface ForbiddenCapabilityImport {\n /** Exact module specifier, or a trailing `/*` prefix rule. */\n readonly specifier: string;\n readonly reason: string;\n}"
|
|
2981
|
+
},
|
|
2982
|
+
{
|
|
2983
|
+
"name": "formatAssuranceReport",
|
|
2984
|
+
"kind": "function",
|
|
2985
|
+
"package": "@nifrajs/cli",
|
|
2986
|
+
"signature": "export declare function formatAssuranceReport(report: AssuranceReport): string;"
|
|
2987
|
+
},
|
|
2089
2988
|
{
|
|
2090
2989
|
"name": "formatBytes",
|
|
2091
2990
|
"kind": "function",
|
|
@@ -2100,6 +2999,12 @@
|
|
|
2100
2999
|
"signature": "export declare function formatDiff(diff: RoutesDiff): string;",
|
|
2101
3000
|
"doc": "/** Render a diff for terminals: breaking first, then info, then compatible. */"
|
|
2102
3001
|
},
|
|
3002
|
+
{
|
|
3003
|
+
"name": "formatManifestDiff",
|
|
3004
|
+
"kind": "function",
|
|
3005
|
+
"package": "@nifrajs/cli",
|
|
3006
|
+
"signature": "export declare function formatManifestDiff(diff: NifraManifestDiff): string;"
|
|
3007
|
+
},
|
|
2103
3008
|
{
|
|
2104
3009
|
"name": "formatManifestDrift",
|
|
2105
3010
|
"kind": "function",
|
|
@@ -2206,6 +3111,19 @@
|
|
|
2206
3111
|
"signature": "export declare function generateMockValue(schema: unknown, fieldName?: string | undefined, rng?: (() => number) | undefined): unknown;",
|
|
2207
3112
|
"doc": "/**\n * Generate a mock value from a schema object. Inspects JSON Schema properties\n * (`type`, `properties`, `items`, `enum`, `format`) that TypeBox / NifraSchema\n * objects carry directly. Unsupported constraints fail closed with\n * {@link UnsupportedMockSchemaError} rather than returning a known-invalid response.\n *\n * @param schema A JSON-Schema-shaped object (TypeBox, NifraSchema, or raw JSON Schema)\n * @param fieldName Optional field name hint for generating contextual string values\n * @param rng Optional seeded random function for deterministic output\n */"
|
|
2208
3113
|
},
|
|
3114
|
+
{
|
|
3115
|
+
"name": "generateRegressionTest",
|
|
3116
|
+
"kind": "function",
|
|
3117
|
+
"package": "@nifrajs/testing",
|
|
3118
|
+
"signature": "export declare function generateRegressionTest(capsule: IncidentCapsule, options?: GenerateRegressionTestOptions): string;",
|
|
3119
|
+
"doc": "/**\n * Emit a committable regression test from a capsule. Request string values are redacted BY DEFAULT with\n * a sanitize banner — replace the `<redacted>` placeholders with safe, reproducing values before you\n * commit. The test asserts the response contract via {@link assertIncidentReplays}.\n */"
|
|
3120
|
+
},
|
|
3121
|
+
{
|
|
3122
|
+
"name": "GenerateRegressionTestOptions",
|
|
3123
|
+
"kind": "interface",
|
|
3124
|
+
"package": "@nifrajs/testing",
|
|
3125
|
+
"signature": "export interface GenerateRegressionTestOptions {\n /** Import specifier for the app under test. Default `\"../src/app\"`. */\n readonly importPath?: string;\n /** Named export of the app. Default `\"app\"`. */\n readonly appExport?: string;\n /** Also assert the response shape. Default false (status-only is the robust regression signal). */\n readonly assertShape?: boolean;\n /** Dotted key paths in the request body whose string values are safe to embed verbatim. */\n readonly allow?: readonly string[];\n}"
|
|
3126
|
+
},
|
|
2209
3127
|
{
|
|
2210
3128
|
"name": "generateServerEntry",
|
|
2211
3129
|
"kind": "function",
|
|
@@ -2240,6 +3158,13 @@
|
|
|
2240
3158
|
"signature": "export declare function generateTraceId(): string;",
|
|
2241
3159
|
"doc": "/** A fresh 16-byte (32-hex) trace id. */"
|
|
2242
3160
|
},
|
|
3161
|
+
{
|
|
3162
|
+
"name": "getBrowserNavigate",
|
|
3163
|
+
"kind": "function",
|
|
3164
|
+
"package": "@nifrajs/web",
|
|
3165
|
+
"signature": "export declare function getBrowserNavigate(): BrowserNavigate | undefined;",
|
|
3166
|
+
"doc": "/** The active browser navigate, or `undefined` on the server / before `installHistory` has run. A\n * binding calls it when present and falls back to native navigation otherwise. */"
|
|
3167
|
+
},
|
|
2243
3168
|
{
|
|
2244
3169
|
"name": "getContext",
|
|
2245
3170
|
"kind": "function",
|
|
@@ -2247,6 +3172,12 @@
|
|
|
2247
3172
|
"signature": "export declare function getContext<C extends Context = Context>(): C;",
|
|
2248
3173
|
"doc": "/** Return the current request context, or throw when no context-storage wrapper is active. */"
|
|
2249
3174
|
},
|
|
3175
|
+
{
|
|
3176
|
+
"name": "getRecipe",
|
|
3177
|
+
"kind": "function",
|
|
3178
|
+
"package": "@nifrajs/cli",
|
|
3179
|
+
"signature": "export declare function getRecipe(version: string): UpgradeRecipe | undefined;"
|
|
3180
|
+
},
|
|
2250
3181
|
{
|
|
2251
3182
|
"name": "getSession",
|
|
2252
3183
|
"kind": "function",
|
|
@@ -2426,6 +3357,13 @@
|
|
|
2426
3357
|
"signature": "export declare function hydrate(chain: readonly unknown[], props: RenderProps, container: unknown): void;",
|
|
2427
3358
|
"doc": "/** Hydrate a server-rendered Vue layout `chain` (with the loader `props`) inside `container`. */"
|
|
2428
3359
|
},
|
|
3360
|
+
{
|
|
3361
|
+
"name": "HydrationBoundary",
|
|
3362
|
+
"kind": "function",
|
|
3363
|
+
"package": "@nifrajs/web-react",
|
|
3364
|
+
"signature": "export declare function HydrationBoundary(props: {\n readonly state: DehydratedState | undefined;\n readonly children?: ReactNode;\n}): ReactNode;",
|
|
3365
|
+
"doc": "/**\n * Seed the context's {@link QueryClient} from a server {@link dehydrate} snapshot — the SSR data bridge.\n * Wrap the app (inside `QueryClientProvider`) so server-prefetched queries are in the cache before the\n * first client render, avoiding a loading flash. Hydration runs during render (idempotent, fresher-wins),\n * so the data is available synchronously to child `useQuery`s.\n */"
|
|
3366
|
+
},
|
|
2429
3367
|
{
|
|
2430
3368
|
"name": "I18nProvider",
|
|
2431
3369
|
"kind": "function",
|
|
@@ -2485,12 +3423,51 @@
|
|
|
2485
3423
|
"package": "@nifrajs/middleware",
|
|
2486
3424
|
"signature": "export declare function idempotency(options: IdempotencyOptions): Middleware;"
|
|
2487
3425
|
},
|
|
3426
|
+
{
|
|
3427
|
+
"name": "IdempotencyAbandonInput",
|
|
3428
|
+
"kind": "interface",
|
|
3429
|
+
"package": "@nifrajs/core",
|
|
3430
|
+
"signature": "export interface IdempotencyAbandonInput extends IdempotencyEntryKey {\n /** Opaque ownership token returned by `begin(state:\"new\")`. */\n readonly reservation: string;\n}"
|
|
3431
|
+
},
|
|
3432
|
+
{
|
|
3433
|
+
"name": "IdempotencyBeginInput",
|
|
3434
|
+
"kind": "interface",
|
|
3435
|
+
"package": "@nifrajs/core",
|
|
3436
|
+
"signature": "export interface IdempotencyBeginInput extends IdempotencyEntryKey {\n readonly fingerprint: string;\n readonly ttlMs: number;\n}"
|
|
3437
|
+
},
|
|
3438
|
+
{
|
|
3439
|
+
"name": "IdempotencyBeginResult",
|
|
3440
|
+
"kind": "type",
|
|
3441
|
+
"package": "@nifrajs/core",
|
|
3442
|
+
"signature": "export type IdempotencyBeginResult = {\n readonly state: \"new\";\n readonly reservation: string;\n} | {\n readonly state: \"replay\";\n readonly response: StoredResponse;\n} | {\n readonly state: \"mismatch\";\n} | {\n readonly state: \"in-flight\";\n} | {\n readonly state: \"capacity\";\n};",
|
|
3443
|
+
"doc": "/**\n * Outcome of reserving a key. `new` → the caller runs the handler and later calls {@link\n * IdempotencyStore.complete}. `replay` → return the stored response, handler never runs. `mismatch`\n * → same key, different request fingerprint (client bug) → 409. `in-flight` → the key is reserved but\n * not yet completed (a concurrent duplicate) → 409 + Retry-After.\n */"
|
|
3444
|
+
},
|
|
2488
3445
|
{
|
|
2489
3446
|
"name": "IdempotencyClaim",
|
|
2490
3447
|
"kind": "type",
|
|
2491
3448
|
"package": "@nifrajs/middleware",
|
|
2492
3449
|
"signature": "export type IdempotencyClaim = {\n readonly state: \"new\";\n} | {\n readonly state: \"in_flight\";\n} | {\n readonly state: \"replay\";\n readonly record: IdempotencyRecord;\n};"
|
|
2493
3450
|
},
|
|
3451
|
+
{
|
|
3452
|
+
"name": "IdempotencyCompletionInput",
|
|
3453
|
+
"kind": "interface",
|
|
3454
|
+
"package": "@nifrajs/core",
|
|
3455
|
+
"signature": "export interface IdempotencyCompletionInput extends IdempotencyEntryKey {\n /** Opaque ownership token returned by `begin(state:\"new\")`. */\n readonly reservation: string;\n readonly response: StoredResponse;\n}"
|
|
3456
|
+
},
|
|
3457
|
+
{
|
|
3458
|
+
"name": "IdempotencyConfig",
|
|
3459
|
+
"kind": "interface",
|
|
3460
|
+
"package": "@nifrajs/core",
|
|
3461
|
+
"signature": "export interface IdempotencyConfig {\n /** `request` = in-process dedupe; `durable` = cross-restart, backed by a durable store. */\n readonly scope: IdempotencyScope;\n /** Retention for the stored response. Default 24h. */\n readonly ttlMs?: number;\n /** Store override. Defaults to the server's shared in-memory store; inject a durable store here. */\n readonly store?: IdempotencyStore;\n /** Header carrying the key. Default `idempotency-key`. */\n readonly headerName?: string;\n /** Maximum response bytes retained for replay. Defaults to the server body limit. */\n readonly maxResponseBytes?: number;\n /**\n * Required server-owned key namespace. Use a tenant/subject-scoped opaque token for authenticated\n * routes so two principals choosing the same header key never collide. A static namespace is an\n * explicit shared/public scope and is safe only when the response is principal-independent. The\n * resolver receives a clone and must not derive identity from unauthenticated client input.\n */\n readonly namespace: string | ((request: {\n readonly method: string;\n readonly url: string;\n readonly headers: {\n get(name: string): string | null;\n };\n }, platform: Platform | undefined) => string | Promise<string>);\n}",
|
|
3462
|
+
"doc": "/**\n * Declares a mutating route as idempotent: the server dedupes retries on an `Idempotency-Key` header\n * (see {@link RouteSchema.idempotency}). Satisfies the capability-assurance idempotency requirement\n * for a request-idempotent `write` capability. Durable response replay is deliberately NOT durable-\n * command evidence: a command/provider key must still prove the side effect itself is deduplicated.\n */"
|
|
3463
|
+
},
|
|
3464
|
+
{
|
|
3465
|
+
"name": "IdempotencyEntryKey",
|
|
3466
|
+
"kind": "interface",
|
|
3467
|
+
"package": "@nifrajs/core",
|
|
3468
|
+
"signature": "export interface IdempotencyEntryKey {\n readonly namespace: string;\n readonly key: string;\n}",
|
|
3469
|
+
"doc": "/** Namespaces isolate the same client key across tenants/subjects without putting identity in a header. */"
|
|
3470
|
+
},
|
|
2494
3471
|
{
|
|
2495
3472
|
"name": "IdempotencyOptions",
|
|
2496
3473
|
"kind": "interface",
|
|
@@ -2504,6 +3481,26 @@
|
|
|
2504
3481
|
"signature": "export interface IdempotencyRecord {\n readonly status: number;\n /** Response headers, **excluding `Set-Cookie`** (cookies are session-specific — see {@link idempotency}). */\n readonly headers: ReadonlyArray<readonly [string, string]>;\n /** Response body, base64-encoded. */\n readonly body: string;\n}",
|
|
2505
3482
|
"doc": "/** A captured response, replayed verbatim on a retry. Body is base64 (binary-safe + JSON-serializable). */"
|
|
2506
3483
|
},
|
|
3484
|
+
{
|
|
3485
|
+
"name": "IdempotencyResponseTooLargeError",
|
|
3486
|
+
"kind": "class",
|
|
3487
|
+
"package": "@nifrajs/core",
|
|
3488
|
+
"signature": "export declare class IdempotencyResponseTooLargeError extends Error {\n readonly maxBytes: number;\n constructor(maxBytes: number);\n}"
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
"name": "IdempotencyScope",
|
|
3492
|
+
"kind": "type",
|
|
3493
|
+
"package": "@nifrajs/core",
|
|
3494
|
+
"signature": "export type IdempotencyScope = \"request\" | \"durable\";",
|
|
3495
|
+
"doc": "/** Whether a route's idempotency is satisfied by an in-process store or a durable (cross-restart) one. */"
|
|
3496
|
+
},
|
|
3497
|
+
{
|
|
3498
|
+
"name": "IdempotencyStore",
|
|
3499
|
+
"kind": "interface",
|
|
3500
|
+
"package": "@nifrajs/core",
|
|
3501
|
+
"signature": "export interface IdempotencyStore {\n /**\n * An honest durability marker. Omit/`memory` for process-local stores; a route declaring\n * `scope: \"durable\"` rejects anything other than `durable` at registration.\n */\n readonly durability?: \"memory\" | \"durable\";\n /** Reserve one namespaced key. Exactly one concurrent caller may receive `new`. */\n begin(input: IdempotencyBeginInput): IdempotencyBeginResult | Promise<IdempotencyBeginResult>;\n /**\n * Persist the final response only when `reservation` still owns the key. Returns false for a stale\n * completion (for example after expiry + re-reservation), which prevents an older request from\n * overwriting a newer result.\n */\n complete(input: IdempotencyCompletionInput): boolean | Promise<boolean>;\n /** Release only the pending reservation owned by `reservation`. */\n abandon(input: IdempotencyAbandonInput): boolean | Promise<boolean>;\n}",
|
|
3502
|
+
"doc": "/**\n * Storage seam for idempotent responses. `begin` MUST be atomic: for one key, exactly one concurrent\n * caller sees `new`; the rest see `in-flight` (or `replay` once completed). The in-memory store gets\n * this free from the single-threaded event loop; a durable store uses an atomic insert.\n */"
|
|
3503
|
+
},
|
|
2507
3504
|
{
|
|
2508
3505
|
"name": "IdempotencyStore",
|
|
2509
3506
|
"kind": "interface",
|
|
@@ -2511,6 +3508,13 @@
|
|
|
2511
3508
|
"signature": "export interface IdempotencyStore {\n /**\n * Atomically claim `key`: `\"replay\"` if a completed response is stored, `\"in_flight\"` if another\n * request holds the lock, else `\"new\"` (the caller now owns the lock and must `complete`/`release`).\n * The in-flight lock expires after `lockTtlMs` so a crashed handler can't wedge the key forever.\n */\n begin(key: string, lockTtlMs: number): Promise<IdempotencyClaim>;\n /** Store the completed response and release the lock (kept for `ttlMs`). */\n complete(key: string, record: IdempotencyRecord, ttlMs: number): Promise<void>;\n /** Release the lock without storing (handler errored / response not cacheable). */\n release(key: string): Promise<void>;\n}",
|
|
2512
3509
|
"doc": "/**\n * Store backing the idempotency guarantee. Production deploys MUST use a shared store so the key holds\n * across instances; `begin` MUST be **atomic** (e.g. Redis `SET key NX PX lockTtlMs`) or two concurrent\n * retries can both see `\"new\"`. {@link MemoryIdempotencyStore} is for dev / single-instance only.\n */"
|
|
2513
3510
|
},
|
|
3511
|
+
{
|
|
3512
|
+
"name": "IDEMPOTENT_REPLAY_HEADER",
|
|
3513
|
+
"kind": "const",
|
|
3514
|
+
"package": "@nifrajs/core",
|
|
3515
|
+
"signature": "export declare const IDEMPOTENT_REPLAY_HEADER = \"x-nifra-idempotent-replay\";",
|
|
3516
|
+
"doc": "/** Header stamped on a replayed response so clients/proxies can tell a replay from a fresh run. */"
|
|
3517
|
+
},
|
|
2514
3518
|
{
|
|
2515
3519
|
"name": "identityLoader",
|
|
2516
3520
|
"kind": "const",
|
|
@@ -2657,12 +3661,43 @@
|
|
|
2657
3661
|
"signature": "export declare function implement<const C extends ContractShape, H extends HandlersFor<C>>(contract: C, handlers: H): Server<RegistryFromImpl<C, H>>;",
|
|
2658
3662
|
"doc": "/**\n * Bind handlers to a contract, producing a real {@link Server} you can `.listen()`\n * or `.fetch()`. Each op is registered through the same path as the inline\n * builder, so the result is identical to writing the routes inline — handlers\n * lift over **unchanged** (\"graduation\"), and body/query schemas validate at the\n * request boundary exactly as in inline mode.\n */"
|
|
2659
3663
|
},
|
|
3664
|
+
{
|
|
3665
|
+
"name": "ImportChange",
|
|
3666
|
+
"kind": "interface",
|
|
3667
|
+
"package": "@nifrajs/cli",
|
|
3668
|
+
"signature": "export interface ImportChange {\n readonly file: string;\n readonly from: string;\n readonly to: string;\n readonly count: number;\n}"
|
|
3669
|
+
},
|
|
2660
3670
|
{
|
|
2661
3671
|
"name": "importHmacKey",
|
|
2662
3672
|
"kind": "function",
|
|
2663
3673
|
"package": "@nifrajs/middleware",
|
|
2664
3674
|
"signature": "export declare function importHmacKey(secret: string | Uint8Array, hash?: string): Promise<CryptoKey>;"
|
|
2665
3675
|
},
|
|
3676
|
+
{
|
|
3677
|
+
"name": "ImportMove",
|
|
3678
|
+
"kind": "interface",
|
|
3679
|
+
"package": "@nifrajs/cli",
|
|
3680
|
+
"signature": "export interface ImportMove {\n readonly from: string;\n readonly to: string;\n}",
|
|
3681
|
+
"doc": "/** An exact import-specifier rewrite (string-level, not AST): `from` → `to`. */"
|
|
3682
|
+
},
|
|
3683
|
+
{
|
|
3684
|
+
"name": "IncidentCapsule",
|
|
3685
|
+
"kind": "interface",
|
|
3686
|
+
"package": "@nifrajs/testing",
|
|
3687
|
+
"signature": "export interface IncidentCapsule {\n readonly id: string;\n readonly capturedAt: string;\n readonly request: CapturedRequest;\n readonly response: {\n readonly status: number;\n readonly bodyShape?: unknown;\n };\n readonly note?: string;\n}"
|
|
3688
|
+
},
|
|
3689
|
+
{
|
|
3690
|
+
"name": "IncidentReplayError",
|
|
3691
|
+
"kind": "class",
|
|
3692
|
+
"package": "@nifrajs/testing",
|
|
3693
|
+
"signature": "export declare class IncidentReplayError extends Error {\n readonly result: IncidentReplayResult;\n readonly capsuleId: string;\n constructor(capsule: IncidentCapsule, result: IncidentReplayResult);\n}"
|
|
3694
|
+
},
|
|
3695
|
+
{
|
|
3696
|
+
"name": "IncidentReplayResult",
|
|
3697
|
+
"kind": "interface",
|
|
3698
|
+
"package": "@nifrajs/testing",
|
|
3699
|
+
"signature": "export interface IncidentReplayResult {\n readonly reproduced: boolean;\n readonly status: number;\n readonly expectedStatus: number;\n readonly statusMatches: boolean;\n /** null when shape was not checked. */\n readonly shapeMatches: boolean | null;\n}"
|
|
3700
|
+
},
|
|
2666
3701
|
{
|
|
2667
3702
|
"name": "InferInput",
|
|
2668
3703
|
"kind": "type",
|
|
@@ -2682,6 +3717,27 @@
|
|
|
2682
3717
|
"signature": "export type InferOutput<S extends StandardSchemaV1> = NonNullable<S[\"~standard\"][\"types\"]>[\"output\"];",
|
|
2683
3718
|
"doc": "/** Extract a Standard Schema's validated output type. */"
|
|
2684
3719
|
},
|
|
3720
|
+
{
|
|
3721
|
+
"name": "InfiniteData",
|
|
3722
|
+
"kind": "interface",
|
|
3723
|
+
"package": "@nifrajs/web",
|
|
3724
|
+
"signature": "export interface InfiniteData<T, P> {\n readonly pages: readonly T[];\n readonly pageParams: readonly P[];\n}",
|
|
3725
|
+
"doc": "/** An infinite (paged) query's accumulated data: the fetched `pages` in order + the `pageParam` each\n * was fetched with (so the next/previous param can be derived). */"
|
|
3726
|
+
},
|
|
3727
|
+
{
|
|
3728
|
+
"name": "InfiniteQueryHandle",
|
|
3729
|
+
"kind": "interface",
|
|
3730
|
+
"package": "@nifrajs/web",
|
|
3731
|
+
"signature": "export interface InfiniteQueryHandle<T, P> {\n snapshot: () => QueryState<InfiniteData<T, P>>;\n subscribe: (listener: () => void) => () => void;\n /** Fetch the first page when absent/stale (fresh ⇒ no-op). */\n fetch: () => Promise<InfiniteData<T, P>>;\n /** Refetch every currently-loaded page (in order), replacing the data. */\n refetch: () => Promise<InfiniteData<T, P>>;\n /** Append the next page (a no-op when `hasNextPage()` is false or a fetch is already in flight). */\n fetchNextPage: () => Promise<InfiniteData<T, P>>;\n /** Prepend the previous page (a no-op without `getPreviousPageParam` or when there is none). */\n fetchPreviousPage: () => Promise<InfiniteData<T, P>>;\n /** Whether another page can be appended (derived from `getNextPageParam` of the last page). */\n hasNextPage: () => boolean;\n /** Whether a page can be prepended (derived from `getPreviousPageParam` of the first page). */\n hasPreviousPage: () => boolean;\n}",
|
|
3732
|
+
"doc": "/** A stable per-key handle for an infinite (paged) query. */"
|
|
3733
|
+
},
|
|
3734
|
+
{
|
|
3735
|
+
"name": "InfiniteQueryOptions",
|
|
3736
|
+
"kind": "interface",
|
|
3737
|
+
"package": "@nifrajs/web",
|
|
3738
|
+
"signature": "export interface InfiniteQueryOptions<T, P> extends QueryOptions {\n /** The param the FIRST page is fetched with. */\n readonly initialPageParam: P;\n /** Derive the next page's param from the last fetched page (and all pages/params). `undefined`/`null`\n * ⇒ no next page (`hasNextPage` is false). */\n readonly getNextPageParam: (lastPage: T, allPages: readonly T[], lastPageParam: P, allPageParams: readonly P[]) => P | undefined | null;\n /** Derive the previous page's param (for bidirectional infinite lists). Omit ⇒ no previous page. */\n readonly getPreviousPageParam?: (firstPage: T, allPages: readonly T[], firstPageParam: P, allPageParams: readonly P[]) => P | undefined | null;\n}",
|
|
3739
|
+
"doc": "/** Options for an {@link InfiniteQueryHandle}. `getNextPageParam` (required) derives the param for the\n * next page from the last page — return `undefined`/`null` to signal there is no next page. */"
|
|
3740
|
+
},
|
|
2685
3741
|
{
|
|
2686
3742
|
"name": "initAgents",
|
|
2687
3743
|
"kind": "function",
|
|
@@ -2712,8 +3768,15 @@
|
|
|
2712
3768
|
"name": "inProcessClient",
|
|
2713
3769
|
"kind": "function",
|
|
2714
3770
|
"package": "@nifrajs/client",
|
|
2715
|
-
"signature": "export declare function inProcessClient<App extends {\n fetch(request: Request): Response | Promise<Response>;\n}>(app: App, options?: Omit<ClientOptions, \"fetch\">):
|
|
2716
|
-
"doc": "/**\n * A {@link client} whose `fetch` calls a nifra app's own `fetch` in-process — no network, full\n * lifecycle (validation, middleware, contracts). For SSR loaders. Typed from `App` exactly like\n * the network client. The `(url, init) → Request` bridge is required because the client calls\n * `fetch(url, init)` while `app.fetch` takes a `Request`.\n *\n * The returned
|
|
3771
|
+
"signature": "export declare function inProcessClient<App extends {\n fetch(request: Request): Response | Promise<Response>;\n}>(app: App, options?: Omit<ClientOptions, \"fetch\">): InProcessClient<App>;",
|
|
3772
|
+
"doc": "/**\n * A {@link client} whose `fetch` calls a nifra app's own `fetch` in-process — no network, full\n * lifecycle (validation, middleware, contracts). For SSR loaders. Typed from `App` exactly like\n * the network client. The `(url, init) → Request` bridge is required because the client calls\n * `fetch(url, init)` while `app.fetch` takes a `Request`.\n *\n * The returned proxy also implements the explicit symbol-keyed {@link BackendMount} interface, so\n * `createWebApp({ api: inProcessClient(backend) })` can auto-mount the backend while forwarding the\n * outer runtime's `env` and `waitUntil`. The released `.fetch(url, init)` bridge remains available as\n * a compatibility surface for custom integrations, but the platform-aware mount never relies on it.\n */"
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
"name": "InProcessClient",
|
|
3776
|
+
"kind": "type",
|
|
3777
|
+
"package": "@nifrajs/client",
|
|
3778
|
+
"signature": "export type InProcessClient<App> = Treaty<App> & BackendMount;",
|
|
3779
|
+
"doc": "/** Typed route client plus the explicit platform-aware backend mount capability. */"
|
|
2717
3780
|
},
|
|
2718
3781
|
{
|
|
2719
3782
|
"name": "installForms",
|
|
@@ -2734,6 +3797,31 @@
|
|
|
2734
3797
|
"package": "@nifrajs/web",
|
|
2735
3798
|
"signature": "export interface InstallHistoryOptions {\n /** Full-page fallback when a client navigation can't proceed (default: `location.assign`). */\n readonly fallback?: (path: string) => void;\n}"
|
|
2736
3799
|
},
|
|
3800
|
+
{
|
|
3801
|
+
"name": "InvariantExecutor",
|
|
3802
|
+
"kind": "type",
|
|
3803
|
+
"package": "@nifrajs/core",
|
|
3804
|
+
"signature": "export type InvariantExecutor = (request: Request) => Response | Promise<Response>;"
|
|
3805
|
+
},
|
|
3806
|
+
{
|
|
3807
|
+
"name": "InvariantFinding",
|
|
3808
|
+
"kind": "interface",
|
|
3809
|
+
"package": "@nifrajs/core",
|
|
3810
|
+
"signature": "export interface InvariantFinding {\n readonly code: InvariantFindingCode;\n readonly method: string;\n readonly path: string;\n /** The case's deterministic seed — rerun with it to reproduce the exact request. */\n readonly seed?: number;\n readonly message: string;\n}"
|
|
3811
|
+
},
|
|
3812
|
+
{
|
|
3813
|
+
"name": "InvariantFindingCode",
|
|
3814
|
+
"kind": "type",
|
|
3815
|
+
"package": "@nifrajs/core",
|
|
3816
|
+
"signature": "export type InvariantFindingCode = \"classification-understated\" | \"server-error-on-valid-input\" | \"response-schema-violation\" | \"validation-bypass\" | \"server-error-on-invalid-input\";",
|
|
3817
|
+
"doc": "/**\n * Contract-generated invariant tests: the declared contract *is* the test suite.\n *\n * `runContractInvariants(app)` reads each route's reflected contract (schemas, classification) and\n * verifies, with deterministic seeded fuzzing, the properties the contract already promises:\n *\n * 1. **Classification consistency** (static) — a route whose response fields are tagged more\n * sensitive than its declared route-level classification is understating what it emits.\n * 2. **Valid input never crashes** (dynamic) — schema-generated valid requests must not produce 5xx.\n * 3. **Response conformance** (dynamic) — a 2xx response body must validate against the declared\n * response schema; an undeclared response shape is exactly where sensitive data leaks.\n * 4. **Validation fails closed** (dynamic) — schema-violating bodies must be rejected (4xx), never\n * accepted (2xx) and never crash (5xx).\n *\n * Everything is deterministic: a seeded PRNG (no ambient randomness, no wall clock), so a failing\n * case reproduces from its seed. Routes whose inputs cannot be generated from their JSON Schema are\n * reported in `skipped` — never silently dropped.\n */"
|
|
3818
|
+
},
|
|
3819
|
+
{
|
|
3820
|
+
"name": "InvariantReport",
|
|
3821
|
+
"kind": "interface",
|
|
3822
|
+
"package": "@nifrajs/core",
|
|
3823
|
+
"signature": "export interface InvariantReport {\n readonly ok: boolean;\n /** Routes exercised dynamically. */\n readonly tested: readonly {\n readonly method: string;\n readonly path: string;\n }[];\n /** Routes that could not be exercised, with the reason — reported, never silently dropped. */\n readonly skipped: readonly SkippedRoute[];\n readonly findings: readonly InvariantFinding[];\n}"
|
|
3824
|
+
},
|
|
2737
3825
|
{
|
|
2738
3826
|
"name": "IpMatcher",
|
|
2739
3827
|
"kind": "type",
|
|
@@ -2767,6 +3855,13 @@
|
|
|
2767
3855
|
"signature": "export declare function isBuildTarget(value: string): value is BuildTarget;",
|
|
2768
3856
|
"doc": "/** A type guard narrowing an arbitrary string to a {@link BuildTarget}. */"
|
|
2769
3857
|
},
|
|
3858
|
+
{
|
|
3859
|
+
"name": "isDataClassification",
|
|
3860
|
+
"kind": "function",
|
|
3861
|
+
"package": "@nifrajs/core",
|
|
3862
|
+
"signature": "export declare function isDataClassification(value: unknown): value is DataClassification;",
|
|
3863
|
+
"doc": "/** Whether `value` is a known classification token. */"
|
|
3864
|
+
},
|
|
2770
3865
|
{
|
|
2771
3866
|
"name": "isDraftEnabled",
|
|
2772
3867
|
"kind": "function",
|
|
@@ -3135,6 +4230,20 @@
|
|
|
3135
4230
|
"signature": "export interface LayoutEntry {\n readonly file: string;\n readonly load: () => Promise<{\n default: unknown;\n meta?: MetaInput;\n }>;\n}",
|
|
3136
4231
|
"doc": "/** A layout (or `_404`/`_error`) entry: its source file (for client codegen) + a lazy loader.\n *\n * A `_layout.tsx` may export `meta` (static {@link Meta} or a function of the loader data + params,\n * same shape as a route's) to contribute sitewide `<head>` tags — `hreflang`/`preconnect`/etc. that\n * belong on every page under the layout. The layout chain's heads merge with the page's: arrays\n * (`meta`/`link`) concatenate outermost→innermost→page; scalars (`title`) are nearest-wins (the page\n * overrides an inner layout, which overrides an outer one). See `mergeHeads` in `@nifrajs/web`. */"
|
|
3137
4232
|
},
|
|
4233
|
+
{
|
|
4234
|
+
"name": "LedgerSink",
|
|
4235
|
+
"kind": "type",
|
|
4236
|
+
"package": "@nifrajs/core",
|
|
4237
|
+
"signature": "export type LedgerSink = (ledger: SealedEffectLedger) => void | Promise<void>;",
|
|
4238
|
+
"doc": "/**\n * Receives each sealed ledger once per request (only when it has entries). Implementations must not\n * assume a payload: the ledger is token-only. A durable/tenant-scoped sink lives behind this seam.\n */"
|
|
4239
|
+
},
|
|
4240
|
+
{
|
|
4241
|
+
"name": "Link",
|
|
4242
|
+
"kind": "const",
|
|
4243
|
+
"package": "@nifrajs/web-react",
|
|
4244
|
+
"signature": "export declare const Link: import(\"react\").ForwardRefExoticComponent<LinkProps & import(\"react\").RefAttributes<HTMLAnchorElement>>;",
|
|
4245
|
+
"doc": "/**\n * A client-navigating anchor. Renders a real `<a href={to}>` (so it's a working link before hydration\n * and for right-click / open-in-new-tab), and on a plain left-click navigates through the router\n * instead of a full reload. Calling `navigate` + `preventDefault` here means `installHistory`'s\n * document-level click handler sees `defaultPrevented` and stands down — exactly one navigation.\n */"
|
|
4246
|
+
},
|
|
3138
4247
|
{
|
|
3139
4248
|
"name": "LinkDescriptor",
|
|
3140
4249
|
"kind": "interface",
|
|
@@ -3142,12 +4251,26 @@
|
|
|
3142
4251
|
"signature": "export interface LinkDescriptor {\n readonly rel?: string;\n readonly href?: string;\n readonly hreflang?: string;\n readonly crossorigin?: string;\n readonly media?: string;\n readonly sizes?: string;\n readonly type?: string;\n readonly as?: string;\n readonly integrity?: string;\n readonly referrerpolicy?: string;\n readonly fetchpriority?: string;\n readonly title?: string;\n readonly imagesrcset?: string;\n readonly imagesizes?: string;\n readonly color?: string;\n readonly disabled?: boolean;\n readonly [attr: string]: string | boolean | undefined;\n}",
|
|
3143
4252
|
"doc": "/**\n * One `<link>` tag's attributes for a route/layout's `meta.link`. The common HTML `<link>` attributes\n * are spelled out and **optional** so a typed partial like `{ rel, href, hreflang }` is assignable —\n * the previous `Record<string, string>` required *every* value to be a present string, which rejected\n * exactly that idiomatic shape (the bug this fixes). The index signature keeps custom/`data-*` attrs\n * (and any future standard attr) passing without a cast; `boolean` covers boolean attributes like\n * `disabled` (rendered as a bare attribute when `true`, omitted when `false`), and `undefined` lets a\n * caller spread in a conditionally-absent attribute. Attribute *names* are still shape-validated and\n * values HTML-escaped at render — a widened type never widens the injection surface.\n */"
|
|
3144
4253
|
},
|
|
4254
|
+
{
|
|
4255
|
+
"name": "LinkProps",
|
|
4256
|
+
"kind": "interface",
|
|
4257
|
+
"package": "@nifrajs/web-react",
|
|
4258
|
+
"signature": "export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n /** Same-origin destination path (e.g. `/users/7?tab=posts`). Rendered as the `<a href>`. */\n readonly to: string;\n /** Replace the current history entry instead of pushing. */\n readonly replace?: boolean;\n}",
|
|
4259
|
+
"doc": "/** {@link Link} props: every `<a>` attribute except `href` (set from `to`), plus `to` + `replace`. */"
|
|
4260
|
+
},
|
|
3145
4261
|
{
|
|
3146
4262
|
"name": "ListOptions",
|
|
3147
4263
|
"kind": "interface",
|
|
3148
4264
|
"package": "@nifrajs/storage",
|
|
3149
4265
|
"signature": "export interface ListOptions {\n /** Only keys starting with this prefix. */\n readonly prefix?: string;\n /** Cap the number of keys returned. */\n readonly limit?: number;\n}"
|
|
3150
4266
|
},
|
|
4267
|
+
{
|
|
4268
|
+
"name": "listRecipeVersions",
|
|
4269
|
+
"kind": "function",
|
|
4270
|
+
"package": "@nifrajs/cli",
|
|
4271
|
+
"signature": "export declare function listRecipeVersions(): string[];",
|
|
4272
|
+
"doc": "/** Available target versions, ascending. */"
|
|
4273
|
+
},
|
|
3151
4274
|
{
|
|
3152
4275
|
"name": "load",
|
|
3153
4276
|
"kind": "function",
|
|
@@ -3168,6 +4291,12 @@
|
|
|
3168
4291
|
"package": "@nifrajs/cli",
|
|
3169
4292
|
"signature": "export interface LoadAppOptions {\n /** Optional dynamic-import query used by long-lived MCP processes to bust Bun's module cache. */\n readonly importQuery?: string;\n}"
|
|
3170
4293
|
},
|
|
4294
|
+
{
|
|
4295
|
+
"name": "loadAssuranceConfig",
|
|
4296
|
+
"kind": "function",
|
|
4297
|
+
"package": "@nifrajs/cli",
|
|
4298
|
+
"signature": "export declare function loadAssuranceConfig(cwd: string, configPath?: string): Promise<AssuranceConfig>;"
|
|
4299
|
+
},
|
|
3171
4300
|
{
|
|
3172
4301
|
"name": "loadBackend",
|
|
3173
4302
|
"kind": "function",
|
|
@@ -3269,6 +4398,13 @@
|
|
|
3269
4398
|
"signature": "export type Locale = string;",
|
|
3270
4399
|
"doc": "/**\n * Locale negotiation — pick the best supported locale for a request, from (in priority order) an\n * explicit cookie, then the `Accept-Language` header (quality-ranked, with a base-tag fallback so\n * `fr-CA` matches a supported `fr`). Pure + runtime-agnostic.\n */"
|
|
3271
4400
|
},
|
|
4401
|
+
{
|
|
4402
|
+
"name": "Location",
|
|
4403
|
+
"kind": "interface",
|
|
4404
|
+
"package": "@nifrajs/web-react",
|
|
4405
|
+
"signature": "export interface Location {\n readonly pathname: string;\n readonly search: string;\n readonly hash: string;\n}",
|
|
4406
|
+
"doc": "/** The parsed current location. `hash` is always `\"\"` — the fragment is client-only and never reaches\n * the router state / server, so exposing a live hash would hydration-mismatch; read `window.location.hash`\n * directly (in an effect) if you truly need it. */"
|
|
4407
|
+
},
|
|
3272
4408
|
{
|
|
3273
4409
|
"name": "LogFields",
|
|
3274
4410
|
"kind": "type",
|
|
@@ -3302,6 +4438,20 @@
|
|
|
3302
4438
|
"signature": "export declare function lookupType(types: readonly TypeEntry[], name: string): TypeEntry[];",
|
|
3303
4439
|
"doc": "/** Exact (case-insensitive) name lookup — returns every declaration with that name (a name can exist in\n * more than one package). */"
|
|
3304
4440
|
},
|
|
4441
|
+
{
|
|
4442
|
+
"name": "LoopDelayHistogram",
|
|
4443
|
+
"kind": "interface",
|
|
4444
|
+
"package": "@nifrajs/middleware",
|
|
4445
|
+
"signature": "export interface LoopDelayHistogram {\n enable(): void;\n reset(): void;\n readonly mean: number;\n}",
|
|
4446
|
+
"doc": "/** The slice of a `perf_hooks` event-loop-delay histogram the sampler needs. */"
|
|
4447
|
+
},
|
|
4448
|
+
{
|
|
4449
|
+
"name": "LoopDelayMonitor",
|
|
4450
|
+
"kind": "type",
|
|
4451
|
+
"package": "@nifrajs/middleware",
|
|
4452
|
+
"signature": "export type LoopDelayMonitor = (resolutionMs: number) => LoopDelayHistogram | undefined;",
|
|
4453
|
+
"doc": "/**\n * Acquires a loop-delay histogram for a resolution, or `undefined` when the runtime has none. This is\n * an optional test/runtime seam; the default sampler is a portable timer-drift monitor.\n */"
|
|
4454
|
+
},
|
|
3305
4455
|
{
|
|
3306
4456
|
"name": "Manifest",
|
|
3307
4457
|
"kind": "interface",
|
|
@@ -3336,6 +4486,27 @@
|
|
|
3336
4486
|
"signature": "export declare function matches(fields: CronFields, date: Date): boolean;",
|
|
3337
4487
|
"doc": "/**\n * Does `date` (in its LOCAL time — cron is local-time by convention) match the fields, to the\n * minute? Day-of-month and day-of-week follow the standard OR rule: when BOTH are restricted, a\n * match on EITHER is a match; when only one is restricted, only that one must match.\n */"
|
|
3338
4488
|
},
|
|
4489
|
+
{
|
|
4490
|
+
"name": "matchesAssuranceSelector",
|
|
4491
|
+
"kind": "function",
|
|
4492
|
+
"package": "@nifrajs/core",
|
|
4493
|
+
"signature": "export declare function matchesAssuranceSelector(route: Pick<ReflectedRoute, \"method\" | \"path\" | \"tool\">, selector: AssuranceRouteSelector): boolean;",
|
|
4494
|
+
"doc": "/** Shared selector semantics for policy rules and framework adapters. */"
|
|
4495
|
+
},
|
|
4496
|
+
{
|
|
4497
|
+
"name": "MAX_COST_AXES",
|
|
4498
|
+
"kind": "const",
|
|
4499
|
+
"package": "@nifrajs/core",
|
|
4500
|
+
"signature": "export declare const MAX_COST_AXES = 8;",
|
|
4501
|
+
"doc": "/** Most cost axes one entry may carry. */"
|
|
4502
|
+
},
|
|
4503
|
+
{
|
|
4504
|
+
"name": "maxClassification",
|
|
4505
|
+
"kind": "function",
|
|
4506
|
+
"package": "@nifrajs/core",
|
|
4507
|
+
"signature": "export declare function maxClassification(values: Iterable<DataClassification>): DataClassification;",
|
|
4508
|
+
"doc": "/** The most sensitive classification among the inputs; `\"public\"` when none are given. */"
|
|
4509
|
+
},
|
|
3339
4510
|
{
|
|
3340
4511
|
"name": "MaybePromise",
|
|
3341
4512
|
"kind": "type",
|
|
@@ -3524,7 +4695,7 @@
|
|
|
3524
4695
|
"kind": "type",
|
|
3525
4696
|
"package": "@nifrajs/mcp",
|
|
3526
4697
|
"signature": "export type McpUiIntent = \"table\" | \"list\" | \"cards\" | \"form\" | \"metric\" | \"detail\" | \"chart\" | (string & {});",
|
|
3527
|
-
"doc": "/**\n * A render-intent hint for GENERATIVE hosts
|
|
4698
|
+
"doc": "/**\n * A render-intent hint for GENERATIVE hosts: how to present the result's\n * `structuredContent` when the host renders its OWN themed UI rather than an iframe widget. The host maps\n * the intent to a component in its design system (a shadcn/Tailwind table, form, metric card, …). Open\n * union — pick a known tag or a custom one.\n */"
|
|
3528
4699
|
},
|
|
3529
4700
|
{
|
|
3530
4701
|
"name": "McpWidget",
|
|
@@ -3558,6 +4729,13 @@
|
|
|
3558
4729
|
"package": "@nifrajs/web",
|
|
3559
4730
|
"signature": "export interface MemoryCacheStoreOptions {\n /** Allow the in-memory store in production. Off by default — per-instance caching means revalidation\n * won't propagate across instances and each instance caches separately. */\n readonly allowInProduction?: boolean;\n /** Hard cap on entries; the least-recently-used is evicted past it (default 500). */\n readonly max?: number;\n}"
|
|
3560
4731
|
},
|
|
4732
|
+
{
|
|
4733
|
+
"name": "MemoryIdempotencyStore",
|
|
4734
|
+
"kind": "class",
|
|
4735
|
+
"package": "@nifrajs/core",
|
|
4736
|
+
"signature": "export declare class MemoryIdempotencyStore implements IdempotencyStore {\n readonly durability: \"memory\";\n private readonly entries;\n private readonly now;\n private readonly maxEntries;\n constructor(options?: MemoryIdempotencyStoreOptions);\n begin(input: IdempotencyBeginInput): IdempotencyBeginResult;\n complete(input: IdempotencyCompletionInput): boolean;\n abandon(input: IdempotencyAbandonInput): boolean;\n /** Evict expired entries. Callers may run this on an interval; access-time eviction covers the rest. */\n sweep(): void;\n /** Live entry count (post-sweep semantics are the caller's; this is a raw size for tests/metrics). */\n get size(): number;\n private storageKey;\n}",
|
|
4737
|
+
"doc": "/**\n * In-process idempotency store. Reservation is atomic by construction — `begin` never awaits, so the\n * single-threaded event loop serializes concurrent callers for one key. Expired entries are treated\n * as absent (lazy eviction on access); a periodic {@link MemoryIdempotencyStore.sweep} bounds memory.\n */"
|
|
4738
|
+
},
|
|
3561
4739
|
{
|
|
3562
4740
|
"name": "MemoryIdempotencyStore",
|
|
3563
4741
|
"kind": "class",
|
|
@@ -3565,6 +4743,12 @@
|
|
|
3565
4743
|
"signature": "export declare class MemoryIdempotencyStore implements IdempotencyStore {\n private readonly entries;\n constructor(options?: MemoryIdempotencyStoreOptions);\n begin(key: string, lockTtlMs: number): Promise<IdempotencyClaim>;\n complete(key: string, record: IdempotencyRecord, ttlMs: number): Promise<void>;\n release(key: string): Promise<void>;\n}",
|
|
3566
4744
|
"doc": "/** In-process store. Refuses to run in production unless explicitly allowed (per-instance ⇒ no cross-instance dedupe). */"
|
|
3567
4745
|
},
|
|
4746
|
+
{
|
|
4747
|
+
"name": "MemoryIdempotencyStoreOptions",
|
|
4748
|
+
"kind": "interface",
|
|
4749
|
+
"package": "@nifrajs/core",
|
|
4750
|
+
"signature": "export interface MemoryIdempotencyStoreOptions {\n /** Injectable clock (epoch ms) for deterministic TTL tests. Default `Date.now`. */\n readonly now?: () => number;\n /** Hard memory bound. At capacity new keys fail closed; completed/pending entries are never evicted early. */\n readonly maxEntries?: number;\n}"
|
|
4751
|
+
},
|
|
3568
4752
|
{
|
|
3569
4753
|
"name": "MemoryIdempotencyStoreOptions",
|
|
3570
4754
|
"kind": "interface",
|
|
@@ -3578,6 +4762,18 @@
|
|
|
3578
4762
|
"signature": "export declare class MemoryJobStore implements JobStore {\n private readonly jobs;\n private readonly dead;\n private seq;\n private readonly idFor;\n constructor(options?: {\n idFor?: () => string;\n });\n enqueue(job: {\n name: string;\n payload: unknown;\n runAt: number;\n maxAttempts: number;\n }): string;\n lease(now: number, limit: number, leaseMs: number): StoredJob[];\n complete(id: string): void;\n retry(id: string, runAt: number): void;\n deadLetter(id: string, error: string): void;\n counts(now?: number): JobCounts;\n /** The dead-letter queue — inspect/requeue failed jobs (not part of the {@link JobStore} contract). */\n deadLetters(): DeadRecord[];\n}",
|
|
3579
4763
|
"doc": "/** Construct an in-memory job store. `idFor` is injectable for deterministic tests. */"
|
|
3580
4764
|
},
|
|
4765
|
+
{
|
|
4766
|
+
"name": "MemoryLedgerSink",
|
|
4767
|
+
"kind": "interface",
|
|
4768
|
+
"package": "@nifrajs/core",
|
|
4769
|
+
"signature": "export interface MemoryLedgerSink {\n readonly sink: LedgerSink;\n /** Sealed ledgers received so far, oldest first. */\n readonly ledgers: readonly SealedEffectLedger[];\n clear(): void;\n}"
|
|
4770
|
+
},
|
|
4771
|
+
{
|
|
4772
|
+
"name": "MemoryLedgerSinkOptions",
|
|
4773
|
+
"kind": "interface",
|
|
4774
|
+
"package": "@nifrajs/core",
|
|
4775
|
+
"signature": "export interface MemoryLedgerSinkOptions {\n /** Retain at most this many sealed ledgers (oldest evicted first). Default 1000. */\n readonly maxLedgers?: number;\n}"
|
|
4776
|
+
},
|
|
3581
4777
|
{
|
|
3582
4778
|
"name": "MemoryResponseCache",
|
|
3583
4779
|
"kind": "class",
|
|
@@ -3687,9 +4883,16 @@
|
|
|
3687
4883
|
"name": "Middleware",
|
|
3688
4884
|
"kind": "interface",
|
|
3689
4885
|
"package": "@nifrajs/core",
|
|
3690
|
-
"signature": "export interface Middleware {\n readonly name?: string;\n readonly onRequest?: (req: Request) => MaybePromise<OnRequestResult>;\n readonly around?: <T>(context: Context, next: () => MaybePromise<T>) => MaybePromise<T>;\n readonly beforeHandle?: (context: Context) => MaybePromise<unknown>;\n readonly afterHandle?: (result: unknown, context: Context) => MaybePromise<unknown>;\n readonly onResponse?: (response: Response, req: Request) => MaybePromise<Response>;\n readonly onResponseFinalized?: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>;\n readonly onError?: (error: unknown, context: Context) => MaybePromise<unknown>;\n}",
|
|
4886
|
+
"signature": "export interface Middleware {\n readonly name?: string;\n readonly onRequest?: (req: Request, platform?: Platform) => MaybePromise<OnRequestResult>;\n readonly around?: <T>(context: Context, next: () => MaybePromise<T>) => MaybePromise<T>;\n readonly beforeHandle?: (context: Context) => MaybePromise<unknown>;\n readonly afterHandle?: (result: unknown, context: Context) => MaybePromise<unknown>;\n readonly onResponse?: (response: Response, req: Request) => MaybePromise<Response>;\n readonly onResponseFinalized?: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>;\n readonly onError?: (error: unknown, context: Context) => MaybePromise<unknown>;\n}",
|
|
3691
4887
|
"doc": "/**\n * A bundle of lifecycle hooks applied together via {@link Server.use} — the unit\n * `@nifrajs/middleware` ships (cors, security headers, rate-limit). Every hook is\n * optional and wired to its lifecycle point. Middleware is context-agnostic (sees\n * the base `Context`); `use` does no context-type merging — the full type-merging\n * plugin system is deferred, and `.use` is reserved as its future entry point.\n */"
|
|
3692
4888
|
},
|
|
4889
|
+
{
|
|
4890
|
+
"name": "MIN_DIGEST_KEY_BYTES",
|
|
4891
|
+
"kind": "const",
|
|
4892
|
+
"package": "@nifrajs/core",
|
|
4893
|
+
"signature": "export declare const MIN_DIGEST_KEY_BYTES = 16;",
|
|
4894
|
+
"doc": "/** Minimum digest key material. A short key would make the keyed digest brute-forceable. */"
|
|
4895
|
+
},
|
|
3693
4896
|
{
|
|
3694
4897
|
"name": "MockableApp",
|
|
3695
4898
|
"kind": "interface",
|
|
@@ -3793,6 +4996,34 @@
|
|
|
3793
4996
|
"signature": "export interface MovableStorageAdapter extends StorageAdapter {\n copy(sourceKey: string, destinationKey: string): Promise<void>;\n move(sourceKey: string, destinationKey: string): Promise<void>;\n}",
|
|
3794
4997
|
"doc": "/** Optional server-side copy/move capability. */"
|
|
3795
4998
|
},
|
|
4999
|
+
{
|
|
5000
|
+
"name": "MutationCallbacks",
|
|
5001
|
+
"kind": "interface",
|
|
5002
|
+
"package": "@nifrajs/web",
|
|
5003
|
+
"signature": "export interface MutationCallbacks<TData, TVariables> {\n readonly onMutate?: (variables: TVariables) => void | Promise<void>;\n readonly onSuccess?: (data: TData, variables: TVariables) => void | Promise<void>;\n readonly onError?: (error: unknown, variables: TVariables) => void | Promise<void>;\n readonly onSettled?: (data: TData | undefined, error: unknown, variables: TVariables) => void | Promise<void>;\n}",
|
|
5004
|
+
"doc": "/** Lifecycle callbacks for a mutation. All optional; `onSettled` runs after success OR error. */"
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
"name": "MutationHandle",
|
|
5008
|
+
"kind": "interface",
|
|
5009
|
+
"package": "@nifrajs/web",
|
|
5010
|
+
"signature": "export interface MutationHandle<TData, TVariables> {\n snapshot: () => MutationState<TData, TVariables>;\n subscribe: (listener: () => void) => () => void;\n /** Run the mutation. Resolves to the data (and runs onSuccess/onSettled) or rejects (onError/onSettled).\n * The latest concurrent call wins the published state (older results are dropped). */\n mutate: (variables: TVariables) => Promise<TData>;\n /** Rebind the latest `fn`/callbacks (closures change between renders) without losing state. */\n rebind: (fn: (variables: TVariables) => Promise<TData>, callbacks: MutationCallbacks<TData, TVariables>) => void;\n /** Reset to the idle state (clears data/error/variables). */\n reset: () => void;\n}",
|
|
5011
|
+
"doc": "/** A standalone mutation store: subscribe to its state, fire `mutate`, `reset` back to idle. */"
|
|
5012
|
+
},
|
|
5013
|
+
{
|
|
5014
|
+
"name": "MutationState",
|
|
5015
|
+
"kind": "interface",
|
|
5016
|
+
"package": "@nifrajs/web",
|
|
5017
|
+
"signature": "export interface MutationState<TData, TVariables> {\n readonly status: MutationStatus;\n readonly data: TData | undefined;\n readonly error: unknown;\n /** The variables of the in-flight / last mutation (`undefined` before the first call). */\n readonly variables: TVariables | undefined;\n}",
|
|
5018
|
+
"doc": "/** A mutation's observable state. A new (frozen) object per transition (reference-comparable). */"
|
|
5019
|
+
},
|
|
5020
|
+
{
|
|
5021
|
+
"name": "MutationStatus",
|
|
5022
|
+
"kind": "type",
|
|
5023
|
+
"package": "@nifrajs/web",
|
|
5024
|
+
"signature": "export type MutationStatus = \"idle\" | \"pending\" | \"success\" | \"error\";",
|
|
5025
|
+
"doc": "/** A mutation's lifecycle status. */"
|
|
5026
|
+
},
|
|
3796
5027
|
{
|
|
3797
5028
|
"name": "namedCombine",
|
|
3798
5029
|
"kind": "function",
|
|
@@ -3800,6 +5031,55 @@
|
|
|
3800
5031
|
"signature": "export declare function namedCombine(name: string, ...items: readonly Composable[]): NifraPlugin;",
|
|
3801
5032
|
"doc": "/** Compose middleware/plugins into one idempotent named bundle. */"
|
|
3802
5033
|
},
|
|
5034
|
+
{
|
|
5035
|
+
"name": "Navigate",
|
|
5036
|
+
"kind": "function",
|
|
5037
|
+
"package": "@nifrajs/web-react",
|
|
5038
|
+
"signature": "export declare function Navigate({ to, replace }: NavigateProps): null;",
|
|
5039
|
+
"doc": "/**\n * Declaratively navigate on mount — the component analogue of `useNavigate` (e.g. a guard that renders\n * `<Navigate to=\"/login\" replace />`). Navigates in an effect, so it's a safe no-op during SSR (renders\n * `null`); the redirect happens once on the client after hydration.\n */"
|
|
5040
|
+
},
|
|
5041
|
+
{
|
|
5042
|
+
"name": "NavigateFunction",
|
|
5043
|
+
"kind": "type",
|
|
5044
|
+
"package": "@nifrajs/web-react",
|
|
5045
|
+
"signature": "export type NavigateFunction = (to: string | number, options?: NavigateOptions) => void;",
|
|
5046
|
+
"doc": "/** A programmatic navigate: a string path (push, or replace via `{ replace: true }`) or a history delta\n * (`-1`/`1`). A no-op on the server / before hydration (a render-time navigate isn't valid — use\n * {@link Navigate}, which navigates in an effect). */"
|
|
5047
|
+
},
|
|
5048
|
+
{
|
|
5049
|
+
"name": "NavigateOptions",
|
|
5050
|
+
"kind": "interface",
|
|
5051
|
+
"package": "@nifrajs/web",
|
|
5052
|
+
"signature": "export interface NavigateOptions {\n /** Replace the current history entry instead of pushing a new one (like `history.replaceState`). */\n readonly replace?: boolean;\n}",
|
|
5053
|
+
"doc": "/** Options for a programmatic navigation. */"
|
|
5054
|
+
},
|
|
5055
|
+
{
|
|
5056
|
+
"name": "NavigateProps",
|
|
5057
|
+
"kind": "interface",
|
|
5058
|
+
"package": "@nifrajs/web-react",
|
|
5059
|
+
"signature": "export interface NavigateProps {\n readonly to: string;\n readonly replace?: boolean;\n}",
|
|
5060
|
+
"doc": "/** {@link Navigate} props: the destination `to` and whether to `replace` the history entry. */"
|
|
5061
|
+
},
|
|
5062
|
+
{
|
|
5063
|
+
"name": "NavLink",
|
|
5064
|
+
"kind": "const",
|
|
5065
|
+
"package": "@nifrajs/web-react",
|
|
5066
|
+
"signature": "export declare const NavLink: import(\"react\").ForwardRefExoticComponent<NavLinkProps & import(\"react\").RefAttributes<HTMLAnchorElement>>;",
|
|
5067
|
+
"doc": "/**\n * A {@link Link} that knows whether it points at the current location. Adds `aria-current=\"page\"` when\n * active and resolves function-form `className`/`style`/`children` with `{ isActive, isPending }`.\n * Default matching is prefix-on-segment-boundary (so `/users` is active on `/users/7`); pass `end` for\n * an exact match.\n */"
|
|
5068
|
+
},
|
|
5069
|
+
{
|
|
5070
|
+
"name": "NavLinkProps",
|
|
5071
|
+
"kind": "interface",
|
|
5072
|
+
"package": "@nifrajs/web-react",
|
|
5073
|
+
"signature": "export interface NavLinkProps extends Omit<LinkProps, \"className\" | \"style\" | \"children\"> {\n /** Match the full path exactly instead of as a prefix (use for `to=\"/\"` so it isn't always active). */\n readonly end?: boolean;\n /** Match case-sensitively (default: case-insensitive, like the DOM). */\n readonly caseSensitive?: boolean;\n readonly className?: string | ((props: NavLinkRenderProps) => string | undefined);\n readonly style?: CSSProperties | ((props: NavLinkRenderProps) => CSSProperties | undefined);\n readonly children?: ReactNode | ((props: NavLinkRenderProps) => ReactNode);\n}",
|
|
5074
|
+
"doc": "/** {@link NavLink} props — like {@link LinkProps}, but `className`/`style`/`children` may be functions\n * of the active state, and `end`/`caseSensitive` tune matching. */"
|
|
5075
|
+
},
|
|
5076
|
+
{
|
|
5077
|
+
"name": "NavLinkRenderProps",
|
|
5078
|
+
"kind": "interface",
|
|
5079
|
+
"package": "@nifrajs/web-react",
|
|
5080
|
+
"signature": "export interface NavLinkRenderProps {\n /** True when the current location matches this link's `to` (prefix match, or exact when `end`). */\n readonly isActive: boolean;\n /** Reserved for a future pending-navigation signal; currently always `false`. */\n readonly isPending: boolean;\n}",
|
|
5081
|
+
"doc": "/** The state a {@link NavLink}'s function-form `className`/`style`/`children` receive. */"
|
|
5082
|
+
},
|
|
3803
5083
|
{
|
|
3804
5084
|
"name": "ndjsonStream",
|
|
3805
5085
|
"kind": "function",
|
|
@@ -3827,6 +5107,33 @@
|
|
|
3827
5107
|
"signature": "export declare function nextRun(fields: CronFields, from: Date): Date | null;",
|
|
3828
5108
|
"doc": "/**\n * The next instant at/after `from` (exclusive of the current minute's already-started second) that\n * matches. Steps minute-by-minute with a safety cap (~5 years) so a never-matching expression\n * returns `null` instead of looping forever.\n */"
|
|
3829
5109
|
},
|
|
5110
|
+
{
|
|
5111
|
+
"name": "NIFRA_ASSURANCE",
|
|
5112
|
+
"kind": "const",
|
|
5113
|
+
"package": "@nifrajs/core",
|
|
5114
|
+
"signature": "export declare const NIFRA_ASSURANCE: Readonly<{\n readonly AUTHENTICATED: \"nifra.authenticated\";\n readonly BODY_BOUNDED: \"nifra.body-bounded\";\n readonly CSRF: \"nifra.csrf\";\n readonly DURABLE_COMMAND: \"nifra.durable-command\";\n readonly IDEMPOTENCY_KEY: \"nifra.idempotency-key\";\n readonly IP_RESTRICTED: \"nifra.ip-restricted\";\n readonly RATE_LIMITED: \"nifra.rate-limited\";\n readonly SECURITY_HEADERS: \"nifra.security-headers\";\n}>;",
|
|
5115
|
+
"doc": "/** Canonical evidence ids emitted by Nifra's official middleware modules. */"
|
|
5116
|
+
},
|
|
5117
|
+
{
|
|
5118
|
+
"name": "NIFRA_ASSURANCE_IDS",
|
|
5119
|
+
"kind": "const",
|
|
5120
|
+
"package": "@nifrajs/core",
|
|
5121
|
+
"signature": "export declare const NIFRA_ASSURANCE_IDS: Readonly<{\n readonly AUTHENTICATED: \"nifra.authenticated\";\n readonly BODY_BOUNDED: \"nifra.body-bounded\";\n readonly CSRF: \"nifra.csrf\";\n readonly DURABLE_COMMAND: \"nifra.durable-command\";\n readonly IDEMPOTENCY_KEY: \"nifra.idempotency-key\";\n readonly IP_RESTRICTED: \"nifra.ip-restricted\";\n readonly RATE_LIMITED: \"nifra.rate-limited\";\n readonly SECURITY_HEADERS: \"nifra.security-headers\";\n}>;"
|
|
5122
|
+
},
|
|
5123
|
+
{
|
|
5124
|
+
"name": "NIFRA_BACKEND_MOUNT",
|
|
5125
|
+
"kind": "const",
|
|
5126
|
+
"package": "@nifrajs/core",
|
|
5127
|
+
"signature": "export declare const NIFRA_BACKEND_MOUNT: unique symbol;",
|
|
5128
|
+
"doc": "/** Global symbol so independently bundled copies of core/client/web still agree on the mount seam. */"
|
|
5129
|
+
},
|
|
5130
|
+
{
|
|
5131
|
+
"name": "NIFRA_DEADLINE_HEADER",
|
|
5132
|
+
"kind": "const",
|
|
5133
|
+
"package": "@nifrajs/core",
|
|
5134
|
+
"signature": "export declare const NIFRA_DEADLINE_HEADER = \"x-nifra-deadline\";",
|
|
5135
|
+
"doc": "/** Canonical wire header carrying an absolute Unix epoch deadline in milliseconds. */"
|
|
5136
|
+
},
|
|
3830
5137
|
{
|
|
3831
5138
|
"name": "NifraFramework",
|
|
3832
5139
|
"kind": "interface",
|
|
@@ -3834,6 +5141,54 @@
|
|
|
3834
5141
|
"signature": "export interface NifraFramework {\n /** The render adapter, e.g. `reactAdapter` from `@nifrajs/web-react`. */\n readonly adapter: unknown;\n /** The client runtime module providing `mountRouter`, e.g. `\"@nifrajs/web-react/client\"`. */\n readonly clientModule: string;\n /** Vite plugins for `nifra dev`'s HMR, e.g. `[react()]` / `() => import(\"@vitejs/plugin-vue\")…`. */\n readonly vitePlugins?: PluginsField;\n /** Bun build plugins that compile routes for the CLIENT bundle (`nifra build`), e.g.\n * `[vueBunPlugin(\"dom\")]`. React/Preact JSX is Bun-native → none. */\n readonly clientPlugins?: PluginsField;\n /** Bun runtime plugins that compile routes for SSR — `nifra dev` (Bun-native route import) and\n * `nifra start` register them via `Bun.plugin`, e.g. `[vueBunPlugin(\"ssr\")]`. React/Preact → none. */\n readonly serverPlugins?: PluginsField;\n /** Extra Bun.build / Vite resolve conditions, e.g. Solid's `[\"solid\"]`. */\n readonly conditions?: readonly string[];\n /** Compile-time `define` replacements, e.g. Vue's `__VUE_*` flags. */\n readonly define?: Readonly<Record<string, string>>;\n}",
|
|
3835
5142
|
"doc": "/**\n * The CLI's framework wiring — exported from `nifra.config.ts` (or `framework.ts` as a fallback).\n * `create-nifra` generates it. Only `adapter` + `clientModule` are required; the plugin/condition\n * fields are framework-specific extras (Vue/Svelte/Solid need them; React/Preact don't).\n */"
|
|
3836
5143
|
},
|
|
5144
|
+
{
|
|
5145
|
+
"name": "NifraManifest",
|
|
5146
|
+
"kind": "interface",
|
|
5147
|
+
"package": "@nifrajs/core",
|
|
5148
|
+
"signature": "export interface NifraManifest {\n readonly manifestVersion: 1;\n readonly routes: readonly NifraManifestRoute[];\n /** SHA-256 hex of the canonical manifest body (`manifestVersion` + `routes`). */\n readonly contentHash: string;\n}"
|
|
5149
|
+
},
|
|
5150
|
+
{
|
|
5151
|
+
"name": "NifraManifestAssurance",
|
|
5152
|
+
"kind": "interface",
|
|
5153
|
+
"package": "@nifrajs/core",
|
|
5154
|
+
"signature": "export interface NifraManifestAssurance {\n readonly rule?: string;\n readonly evidence: readonly {\n readonly id: string;\n readonly source: string;\n }[];\n}"
|
|
5155
|
+
},
|
|
5156
|
+
{
|
|
5157
|
+
"name": "NifraManifestCapabilities",
|
|
5158
|
+
"kind": "interface",
|
|
5159
|
+
"package": "@nifrajs/core",
|
|
5160
|
+
"signature": "export interface NifraManifestCapabilities {\n readonly declared: readonly string[];\n readonly evidenced: readonly string[];\n readonly unproven: readonly string[];\n readonly covered: boolean;\n}"
|
|
5161
|
+
},
|
|
5162
|
+
{
|
|
5163
|
+
"name": "NifraManifestChange",
|
|
5164
|
+
"kind": "interface",
|
|
5165
|
+
"package": "@nifrajs/core",
|
|
5166
|
+
"signature": "export interface NifraManifestChange {\n readonly severity: DiffSeverity;\n readonly method: string;\n readonly path: string;\n readonly section: RouteChange[\"section\"] | \"assurance\" | \"capabilities\" | \"classification\";\n readonly field?: string;\n readonly message: string;\n}"
|
|
5167
|
+
},
|
|
5168
|
+
{
|
|
5169
|
+
"name": "NifraManifestDiff",
|
|
5170
|
+
"kind": "interface",
|
|
5171
|
+
"package": "@nifrajs/core",
|
|
5172
|
+
"signature": "export interface NifraManifestDiff {\n readonly changes: readonly NifraManifestChange[];\n readonly hasBreaking: boolean;\n}"
|
|
5173
|
+
},
|
|
5174
|
+
{
|
|
5175
|
+
"name": "NifraManifestRoute",
|
|
5176
|
+
"kind": "interface",
|
|
5177
|
+
"package": "@nifrajs/core",
|
|
5178
|
+
"signature": "export interface NifraManifestRoute {\n readonly method: string;\n readonly path: string;\n readonly schema?: RouteSnapshotSchema;\n readonly assurance?: NifraManifestAssurance;\n readonly capabilities?: NifraManifestCapabilities;\n readonly classification?: ResponseClassification;\n}"
|
|
5179
|
+
},
|
|
5180
|
+
{
|
|
5181
|
+
"name": "NifraManifestSignature",
|
|
5182
|
+
"kind": "interface",
|
|
5183
|
+
"package": "@nifrajs/core",
|
|
5184
|
+
"signature": "export interface NifraManifestSignature {\n readonly nifraManifestSignature: 1;\n readonly algorithm: \"Ed25519\";\n readonly keyId: string;\n readonly contentHash: string;\n /** Base64url Ed25519 signature over the canonical manifest body. */\n readonly signature: string;\n}"
|
|
5185
|
+
},
|
|
5186
|
+
{
|
|
5187
|
+
"name": "NifraManifestSigner",
|
|
5188
|
+
"kind": "interface",
|
|
5189
|
+
"package": "@nifrajs/core",
|
|
5190
|
+
"signature": "export interface NifraManifestSigner {\n readonly algorithm: \"Ed25519\";\n readonly keyId: string;\n sign(payload: Uint8Array): ArrayBuffer | Uint8Array | Promise<ArrayBuffer | Uint8Array>;\n}"
|
|
5191
|
+
},
|
|
3837
5192
|
{
|
|
3838
5193
|
"name": "NifraMonorepoConfig",
|
|
3839
5194
|
"kind": "interface",
|
|
@@ -3910,6 +5265,12 @@
|
|
|
3910
5265
|
"signature": "export declare function normalizeRolldownPlugins(plugins: readonly unknown[], isRolldown: boolean): readonly unknown[];",
|
|
3911
5266
|
"doc": "/**\n * Strip `optimizeDeps.rollupOptions.jsx` from a plugin's `config` hook output when running under\n * rolldown-vite — the source of the scary, harmless `Warning: Invalid input options … \"jsx\" Invalid\n * key: Expected never but received \"jsx\"` on `nifra dev`.\n *\n * Why it happens: `@vitejs/plugin-react@4.x` (and peers) target an *older* rolldown-vite optimizeDeps\n * API — they inject `optimizeDeps.rollupOptions.jsx` to tell the dep pre-bundler to transform JSX. Vite\n * 8's rolldown dep-optimizer renamed that surface to `optimizeDeps.rolldownOptions` (and moved jsx under\n * `transform.jsx`), so the stale `rollupOptions.jsx` is an unrecognized input option → the warning. It's\n * a version-skew artifact, not a real misconfig: the route source JSX transform runs through the\n * plugin's own `transform` hook (untouched here), and node_modules deps that get pre-bundled almost\n * never contain raw JSX — so dropping the dead key changes no behavior and keeps HMR/Fast Refresh\n * intact. We *strip* (rather than translate to `rolldownOptions`) so the fix is version-agnostic: a\n * plugin already emitting the correct `rolldownOptions` is left untouched, and a future plugin bump that\n * stops emitting `rollupOptions.jsx` makes this a no-op.\n *\n * Scoped narrowly: only the `optimizeDeps.rollupOptions.jsx` key is removed, only under rolldown-vite,\n * and only from the value a plugin's `config` hook returns. Non-rolldown Vite is passed through verbatim.\n *\n * FLATTEN FIRST: a Vite plugin factory may return an ARRAY of plugins — `@vitejs/plugin-react`'s `react()`\n * returns `[vite:react-babel, vite:react-refresh]`, and it's `react:react-babel`'s `config` hook that emits\n * the offending `optimizeDeps.rollupOptions.jsx`. `nifra.config.ts` writes `vitePlugins = [react()]`, so the\n * plugin list arrives NESTED (`[[babel, refresh]]`). Without flattening, `.map` sees the inner array (which\n * has no `config`), leaves it untouched, and Vite — which flattens plugin arrays itself before running them\n * — then executes the un-stripped babel hook, so the warning survives. Flattening here (Vite accepts a flat\n * list identically) is what lets the strip reach every real plugin.\n */"
|
|
3912
5267
|
},
|
|
5268
|
+
{
|
|
5269
|
+
"name": "normalizeRouteCapabilities",
|
|
5270
|
+
"kind": "function",
|
|
5271
|
+
"package": "@nifrajs/core",
|
|
5272
|
+
"signature": "export declare function normalizeRouteCapabilities(values: readonly string[] | undefined): readonly string[];"
|
|
5273
|
+
},
|
|
3913
5274
|
{
|
|
3914
5275
|
"name": "number",
|
|
3915
5276
|
"kind": "function",
|
|
@@ -4047,7 +5408,7 @@
|
|
|
4047
5408
|
"name": "OperationDef",
|
|
4048
5409
|
"kind": "interface",
|
|
4049
5410
|
"package": "@nifrajs/core",
|
|
4050
|
-
"signature": "export interface OperationDef {\n readonly method: Method;\n readonly path: string;\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n readonly response?: StandardSchemaV1;\n /** Short summary (OpenAPI `summary`). */\n readonly summary?: string;\n /** Longer description (OpenAPI `description`, CommonMark). */\n readonly description?: string;\n /** Grouping tags (OpenAPI `tags`). */\n readonly tags?: readonly string[];\n /** Mark the operation deprecated. */\n readonly deprecated?: boolean;\n /** Security requirements (names ref `securitySchemes`); `[]` = explicitly public. Omit ⇒ inherit the document default. */\n readonly security?: ReadonlyArray<Readonly<Record<string, readonly string[]>>>;\n /** Request body content type. Default `application/json`. */\n readonly requestContentType?: string;\n /** Content type of the success (`200`) response. Default `application/json`. */\n readonly responseContentType?: string;\n /** Additional responses by status code, e.g. `{ \"404\": { description: \"Not found\" } }`. */\n readonly responses?: Readonly<Record<string, ResponseDef>>;\n}",
|
|
5411
|
+
"signature": "export interface OperationDef {\n readonly method: Method;\n readonly path: string;\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n readonly response?: StandardSchemaV1;\n /** Declared effect tokens, carried into route reflection and capability assurance. */\n readonly capabilities?: readonly string[];\n /** Dedupe retries of this operation on an `Idempotency-Key` header (see {@link RouteSchema.idempotency}). */\n readonly idempotency?: IdempotencyConfig;\n /** Highest data-sensitivity the response carries (see {@link RouteSchema.classification}). */\n readonly classification?: DataClassification;\n /** Short summary (OpenAPI `summary`). */\n readonly summary?: string;\n /** Longer description (OpenAPI `description`, CommonMark). */\n readonly description?: string;\n /** Grouping tags (OpenAPI `tags`). */\n readonly tags?: readonly string[];\n /** Mark the operation deprecated. */\n readonly deprecated?: boolean;\n /** Security requirements (names ref `securitySchemes`); `[]` = explicitly public. Omit ⇒ inherit the document default. */\n readonly security?: ReadonlyArray<Readonly<Record<string, readonly string[]>>>;\n /** Request body content type. Default `application/json`. */\n readonly requestContentType?: string;\n /** Content type of the success (`200`) response. Default `application/json`. */\n readonly responseContentType?: string;\n /** Additional responses by status code, e.g. `{ \"404\": { description: \"Not found\" } }`. */\n readonly responses?: Readonly<Record<string, ResponseDef>>;\n}",
|
|
4051
5412
|
"doc": "/**\n * One operation in a contract. Input schemas are any Standard Schema; `response` is optional.\n *\n * The fields below `response` are **optional OpenAPI metadata** — they don't affect runtime\n * validation or the inferred handler types, they enrich the document `toOpenAPI` emits. A contract is\n * the natural home for them: it's the versionable description of the API, decoupled from the impl.\n */"
|
|
4052
5413
|
},
|
|
4053
5414
|
{
|
|
@@ -4126,6 +5487,12 @@
|
|
|
4126
5487
|
"signature": "export declare function parseArgs(argv: readonly string[]): ParsedArgs;",
|
|
4127
5488
|
"doc": "/** Parse `[dir] [--template|-t <t>] [--framework|-f <fw>] [--deploy|-d <target>] [--ci|-c github]\n * [--db <preset>] [--auth <preset>] [--force] [--link <path>]`.\n * `--framework`/`--deploy`/`--ci` all default the template to `site`. */"
|
|
4128
5489
|
},
|
|
5490
|
+
{
|
|
5491
|
+
"name": "parseCapabilityLockfile",
|
|
5492
|
+
"kind": "function",
|
|
5493
|
+
"package": "@nifrajs/cli",
|
|
5494
|
+
"signature": "export declare function parseCapabilityLockfile(content: string, sourcePath: string): CapabilitySnapshot;"
|
|
5495
|
+
},
|
|
4129
5496
|
{
|
|
4130
5497
|
"name": "parseContentLength",
|
|
4131
5498
|
"kind": "function",
|
|
@@ -4152,6 +5519,13 @@
|
|
|
4152
5519
|
"signature": "export declare function parseCron(expression: string): CronFields;",
|
|
4153
5520
|
"doc": "/** Parse a 5-field cron expression (or a `@macro`) into matchable {@link CronFields}. */"
|
|
4154
5521
|
},
|
|
5522
|
+
{
|
|
5523
|
+
"name": "parseDeadlineHeader",
|
|
5524
|
+
"kind": "function",
|
|
5525
|
+
"package": "@nifrajs/core",
|
|
5526
|
+
"signature": "export declare function parseDeadlineHeader(headers: Headers): DeadlineHeaderResult;",
|
|
5527
|
+
"doc": "/** Parse the canonical deadline header without trusting or clamping it. */"
|
|
5528
|
+
},
|
|
4155
5529
|
{
|
|
4156
5530
|
"name": "ParsedFontFace",
|
|
4157
5531
|
"kind": "interface",
|
|
@@ -4200,6 +5574,20 @@
|
|
|
4200
5574
|
"signature": "export declare function parseNdjsonData(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): Promise<unknown>;",
|
|
4201
5575
|
"doc": "/**\n * Client side of {@link ndjsonStream} (used by the router's `defaultFetchData` on a soft nav): read\n * the NDJSON body into a data object whose deferred markers settle as resolution lines arrive.\n * Returns after **line 1** so the router can apply the critical data + render immediately; the\n * markers' promises settle/reject in the background. If the stream ends (or `signal` aborts) with\n * markers unsettled, they reject — so `<Await>` never hangs.\n */"
|
|
4202
5576
|
},
|
|
5577
|
+
{
|
|
5578
|
+
"name": "parseNifraManifest",
|
|
5579
|
+
"kind": "function",
|
|
5580
|
+
"package": "@nifrajs/core",
|
|
5581
|
+
"signature": "export declare function parseNifraManifest(content: string, source?: string): Promise<NifraManifest>;",
|
|
5582
|
+
"doc": "/** Parse and hash-verify an emitted manifest before it is trusted by diff/codegen tooling. */"
|
|
5583
|
+
},
|
|
5584
|
+
{
|
|
5585
|
+
"name": "parseNifraManifestSignature",
|
|
5586
|
+
"kind": "function",
|
|
5587
|
+
"package": "@nifrajs/core",
|
|
5588
|
+
"signature": "export declare function parseNifraManifestSignature(content: string, source?: string): NifraManifestSignature;",
|
|
5589
|
+
"doc": "/** Parse the detached sidecar before selecting its operator-controlled public key. */"
|
|
5590
|
+
},
|
|
4203
5591
|
{
|
|
4204
5592
|
"name": "parseSnapshotFile",
|
|
4205
5593
|
"kind": "function",
|
|
@@ -4234,6 +5622,26 @@
|
|
|
4234
5622
|
"signature": "export declare function pickLanguage<const L extends readonly string[]>(header: string | null, supported: L, defaultLanguage: L[number]): LanguageMatch;",
|
|
4235
5623
|
"doc": "/**\n * Pick the best supported language for an `Accept-Language` header. Exact tags win, then compatible\n * base-language matches, then `*`, then the configured default.\n */"
|
|
4236
5624
|
},
|
|
5625
|
+
{
|
|
5626
|
+
"name": "PinChange",
|
|
5627
|
+
"kind": "interface",
|
|
5628
|
+
"package": "@nifrajs/cli",
|
|
5629
|
+
"signature": "export interface PinChange {\n readonly file: string;\n readonly field: string;\n readonly name: string;\n readonly from: string;\n readonly to: string;\n}"
|
|
5630
|
+
},
|
|
5631
|
+
{
|
|
5632
|
+
"name": "PinRule",
|
|
5633
|
+
"kind": "interface",
|
|
5634
|
+
"package": "@nifrajs/cli",
|
|
5635
|
+
"signature": "export interface PinRule {\n /** Package-name prefix, e.g. `@nifrajs/`, or an exact package name. */\n readonly match: string;\n /** Bare target version, e.g. `1.8.0`. The range operator (`^`/`~`/exact) is preserved per-spec. */\n readonly to: string;\n}",
|
|
5636
|
+
"doc": "/** A pin rule: every dependency whose name starts with `match` is set to version `to`. */"
|
|
5637
|
+
},
|
|
5638
|
+
{
|
|
5639
|
+
"name": "pinSweepText",
|
|
5640
|
+
"kind": "function",
|
|
5641
|
+
"package": "@nifrajs/cli",
|
|
5642
|
+
"signature": "export declare function pinSweepText(text: string, rules: readonly {\n match: string;\n to: string;\n}[]): {\n text: string;\n changes: Array<Omit<PinChange, \"file\">>;\n};",
|
|
5643
|
+
"doc": "/**\n * Apply pin rules to one package.json's TEXT (format-preserving — targeted string replaces, never a\n * JSON re-serialize that would reorder keys or drop comments-as-formatting). Returns the new text and\n * the changes made.\n */"
|
|
5644
|
+
},
|
|
4237
5645
|
{
|
|
4238
5646
|
"name": "pipeWebBodyToNode",
|
|
4239
5647
|
"kind": "function",
|
|
@@ -4555,7 +5963,7 @@
|
|
|
4555
5963
|
"name": "QueryClient",
|
|
4556
5964
|
"kind": "interface",
|
|
4557
5965
|
"package": "@nifrajs/web",
|
|
4558
|
-
"signature": "export interface QueryClient {\n /** Get the stable {@link QueryHandle} for `key`, fetched via `fn`. Re-binds the latest `fn`
|
|
5966
|
+
"signature": "export interface QueryClient {\n /** Get the stable {@link QueryHandle} for `key`, fetched via `fn`. Re-binds the latest `fn` (and\n * `options`) each call (closures change between renders); returns the same handle for the same\n * (hashed) key. */\n query: <T>(key: unknown, fn: () => Promise<T>, options?: QueryOptions) => QueryHandle<T>;\n /** Get the stable {@link InfiniteQueryHandle} for `key`, whose pages are fetched via `fn(pageParam)`. */\n infiniteQuery: <T, P>(key: unknown, fn: (pageParam: P) => Promise<T>, options: InfiniteQueryOptions<T, P>) => InfiniteQueryHandle<T, P>;\n /** Mark matching cached queries stale and refetch the **mounted** ones (subscribers > 0). Array\n * keys match by **prefix** (`[\"todo\"]` ⇒ every `[\"todo\", …]`); other keys match exactly. */\n invalidateQueries: (keyOrPrefix: unknown) => void;\n /** Read a cached query's data (`undefined` if absent or not yet successful). Synchronous, no fetch. */\n getQueryData: <T>(key: unknown) => T | undefined;\n /** Write a query's data directly (optimistic updates, or seeding). Creates the entry if absent; marks\n * it fresh (`updatedAt = now`). `updater` may be a value or a function of the previous data. */\n setQueryData: <T>(key: unknown, updater: T | ((prev: T | undefined) => T)) => void;\n /** Fetch + cache a query's data WITHOUT subscribing (SSR prefetch, hover warm). Resolves when cached;\n * a fresh entry is a no-op. Rejects if the fetch throws (caller may swallow). */\n prefetchQuery: <T>(key: unknown, fn: () => Promise<T>, options?: QueryOptions) => Promise<void>;\n /** Serialize every successful query to a transferable snapshot (server → client SSR bridge). */\n dehydrate: () => DehydratedState;\n /** Seed the cache from a {@link dehydrate} snapshot (client boot). Existing fresher entries win. */\n hydrate: (state: DehydratedState) => void;\n}",
|
|
4559
5967
|
"doc": "/** The keyed query cache. One per app (a binding registers it like the router). */"
|
|
4560
5968
|
},
|
|
4561
5969
|
{
|
|
@@ -4564,6 +5972,13 @@
|
|
|
4564
5972
|
"package": "@nifrajs/web",
|
|
4565
5973
|
"signature": "export interface QueryClientOptions {\n /** Monotonic clock in ms — injected so the core stays deterministic + testable; the adapter binding\n * passes `() => Date.now()`. */\n readonly now: () => number;\n /** Data stays fresh this long after a fetch; older ⇒ refetch on the next `fetch()` (default `0`). */\n readonly staleTime?: number;\n /** Evict an entry this long (ms) after its last subscriber leaves (default 5 min). */\n readonly gcTime?: number;\n /** Hard cap on cached entries — LRU-evict the oldest *unsubscribed* entry past it (default 1000). */\n readonly max?: number;\n}"
|
|
4566
5974
|
},
|
|
5975
|
+
{
|
|
5976
|
+
"name": "QueryClientProvider",
|
|
5977
|
+
"kind": "function",
|
|
5978
|
+
"package": "@nifrajs/web-react",
|
|
5979
|
+
"signature": "export declare function QueryClientProvider(props: {\n readonly client: QueryClient;\n readonly children?: ReactNode;\n}): ReactNode;",
|
|
5980
|
+
"doc": "/** Provide a {@link QueryClient} to the tree — required for SSR dehydrate/hydrate and for tests; a\n * client-only app can omit it and rely on the built-in client-side singleton. */"
|
|
5981
|
+
},
|
|
4567
5982
|
{
|
|
4568
5983
|
"name": "QueryHandle",
|
|
4569
5984
|
"kind": "interface",
|
|
@@ -4577,6 +5992,13 @@
|
|
|
4577
5992
|
"package": "@nifrajs/core",
|
|
4578
5993
|
"signature": "export declare function queryObjectOf(search: string): Record<string, QueryValue>;"
|
|
4579
5994
|
},
|
|
5995
|
+
{
|
|
5996
|
+
"name": "QueryOptions",
|
|
5997
|
+
"kind": "interface",
|
|
5998
|
+
"package": "@nifrajs/web",
|
|
5999
|
+
"signature": "export interface QueryOptions {\n /** Data stays fresh this long (ms) after a fetch; older ⇒ refetch on the next `fetch()`. Overrides\n * the client default for this key. */\n readonly staleTime?: number;\n}",
|
|
6000
|
+
"doc": "/** Per-query overrides passed alongside the fetcher. */"
|
|
6001
|
+
},
|
|
4580
6002
|
{
|
|
4581
6003
|
"name": "QueryState",
|
|
4582
6004
|
"kind": "interface",
|
|
@@ -4649,6 +6071,13 @@
|
|
|
4649
6071
|
"package": "@nifrajs/storage",
|
|
4650
6072
|
"signature": "export declare class R2Storage implements StorageAdapter {\n private readonly bucket;\n constructor(bucket: R2BucketLike);\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n get(key: string): Promise<StorageObject | null>;\n delete(key: string): Promise<void>;\n exists(key: string): Promise<boolean>;\n list(options?: ListOptions): Promise<string[]>;\n}"
|
|
4651
6073
|
},
|
|
6074
|
+
{
|
|
6075
|
+
"name": "randomEffectDigestKey",
|
|
6076
|
+
"kind": "function",
|
|
6077
|
+
"package": "@nifrajs/core",
|
|
6078
|
+
"signature": "export declare function randomEffectDigestKey(): Uint8Array;",
|
|
6079
|
+
"doc": "/** Fresh random digest key (32 bytes). Per-process by default — persist one externally to correlate across restarts. */"
|
|
6080
|
+
},
|
|
4652
6081
|
{
|
|
4653
6082
|
"name": "rateLimit",
|
|
4654
6083
|
"kind": "function",
|
|
@@ -4749,6 +6178,27 @@
|
|
|
4749
6178
|
"signature": "export declare function readImageDimensions(source: {\n arrayBuffer(): Promise<ArrayBuffer>;\n stream?: () => ReadableStream<Uint8Array>;\n}, maxBytes?: number): Promise<ImageInfo | null>;",
|
|
4750
6179
|
"doc": "/**\n * Read just the leading bytes of an image file (via the platform `Bun.file`/`fetch` blob) and parse its\n * dimensions. Build-time tooling: pre-read dimensions into a manifest so `<Image>` is CLS-safe without\n * hardcoding sizes. Reads at most `maxBytes` (default 64 KB — enough for any header).\n */"
|
|
4751
6180
|
},
|
|
6181
|
+
{
|
|
6182
|
+
"name": "recipe",
|
|
6183
|
+
"kind": "const",
|
|
6184
|
+
"package": "@nifrajs/cli",
|
|
6185
|
+
"signature": "export declare const recipe: UpgradeRecipe;",
|
|
6186
|
+
"doc": "/**\n * Upgrade recipe for nifra 1.8.0.\n *\n * 1.8.0 is a fixed-group bump: every `@nifrajs/*` package moves in lockstep. The pin sweep sets them\n * all to 1.8.0 (preserving each spec's `^`/`~`/exact style). 1.8.0 introduced no breaking import moves\n * in the public packages — the new surfaces (route assurance, adversarial testing, `@nifrajs/events`)\n * are additive — so `importMoves` is empty. The notes flag the additive follow-ups a bump can't do for\n * you (wiring the new assurance config), keeping the runner honest about what it did and didn't touch.\n */"
|
|
6187
|
+
},
|
|
6188
|
+
{
|
|
6189
|
+
"name": "recordCapabilityOutcome",
|
|
6190
|
+
"kind": "function",
|
|
6191
|
+
"package": "@nifrajs/core",
|
|
6192
|
+
"signature": "export declare function recordCapabilityOutcome(context: object, capability: string, options: CapabilityOutcomeOptions): void;",
|
|
6193
|
+
"doc": "/** Record the terminal outcome of an already-admitted capability without debiting admission twice. */"
|
|
6194
|
+
},
|
|
6195
|
+
{
|
|
6196
|
+
"name": "redactForEmission",
|
|
6197
|
+
"kind": "function",
|
|
6198
|
+
"package": "@nifrajs/testing",
|
|
6199
|
+
"signature": "export declare function redactForEmission(value: unknown, allow: ReadonlySet<string>, path?: string): unknown;",
|
|
6200
|
+
"doc": "/**\n * Redact leaf string values by default (unless the dotted key path is allow-listed). Non-strings are\n * kept — they carry the structure that makes the fixture reproduce — so review the emitted file. This\n * is intentionally aggressive: a committed fixture must not leak PII/secrets.\n */"
|
|
6201
|
+
},
|
|
4752
6202
|
{
|
|
4753
6203
|
"name": "redactLogFields",
|
|
4754
6204
|
"kind": "function",
|
|
@@ -4784,11 +6234,18 @@
|
|
|
4784
6234
|
"signature": "export interface RedirectOptions {\n /** HTTP status (default 303 See Other; pass 307/308 to preserve the method). */\n readonly status?: number;\n /** Allow an off-origin / absolute destination. Off by default: only a same-origin path (a single\n * leading `/`) is permitted, so an action can't be turned into an open redirect by passing\n * attacker-controlled input straight through. Set `true` for a deliberate external redirect. */\n readonly external?: boolean;\n}",
|
|
4785
6235
|
"doc": "/** Options for {@link redirect}. */"
|
|
4786
6236
|
},
|
|
6237
|
+
{
|
|
6238
|
+
"name": "reflectClassification",
|
|
6239
|
+
"kind": "function",
|
|
6240
|
+
"package": "@nifrajs/core",
|
|
6241
|
+
"signature": "export declare function reflectClassification(schema: unknown): ResponseClassification | undefined;",
|
|
6242
|
+
"doc": "/** Read field-level metadata from an introspectable response schema. Never invokes its validator. */"
|
|
6243
|
+
},
|
|
4787
6244
|
{
|
|
4788
6245
|
"name": "ReflectedRoute",
|
|
4789
6246
|
"kind": "interface",
|
|
4790
6247
|
"package": "@nifrajs/core",
|
|
4791
|
-
"signature": "export interface ReflectedRoute {\n readonly method: string;\n readonly path: string;\n readonly schema?: ReflectedRouteSchema;\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}"
|
|
6248
|
+
"signature": "export interface ReflectedRoute {\n readonly method: string;\n readonly path: string;\n readonly schema?: ReflectedRouteSchema;\n readonly assurance?: readonly AssuranceEvidence[];\n readonly capabilities?: readonly string[];\n /** Field-level response classification plus the highest sensitivity present. */\n readonly classification?: ResponseClassification;\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}"
|
|
4792
6249
|
},
|
|
4793
6250
|
{
|
|
4794
6251
|
"name": "ReflectedRouteSchema",
|
|
@@ -4852,6 +6309,12 @@
|
|
|
4852
6309
|
"signature": "export type RegistryOf<App> = App extends Server<infer R, infer _Ctx> ? R : never;",
|
|
4853
6310
|
"doc": "/** Extract the accumulated route registry from a server's type (`typeof app`), ignoring its middleware context. */"
|
|
4854
6311
|
},
|
|
6312
|
+
{
|
|
6313
|
+
"name": "RegistryParseResult",
|
|
6314
|
+
"kind": "type",
|
|
6315
|
+
"package": "@nifrajs/events",
|
|
6316
|
+
"signature": "export type RegistryParseResult = {\n readonly success: true;\n readonly envelope: EventEnvelope;\n readonly contract: EventContract;\n} | {\n readonly success: false;\n readonly reason: \"not-an-object\" | \"unknown-contract\" | \"invalid-payload\";\n readonly message: string;\n};"
|
|
6317
|
+
},
|
|
4855
6318
|
{
|
|
4856
6319
|
"name": "RenderAdapter",
|
|
4857
6320
|
"kind": "interface",
|
|
@@ -4925,7 +6388,7 @@
|
|
|
4925
6388
|
"name": "RenderPageOptions",
|
|
4926
6389
|
"kind": "interface",
|
|
4927
6390
|
"package": "@nifrajs/web",
|
|
4928
|
-
"signature": "export interface RenderPageOptions {\n readonly adapter: RenderAdapter;\n /** The layout chain to render — outermost layout → page (opaque; the adapter renders it). */\n readonly chain: readonly unknown[];\n /** The loader output for this request. */\n readonly data: unknown;\n /** An action's data return (POST only) — surfaced to the page as `actionData` + serialized\n * for the client so post-POST hydration matches. Omit on GETs. */\n readonly actionData?: unknown;\n /** URL of the built client entry (loaded as a module script). */\n readonly clientEntry: string;\n /** Chunk URLs for the **matched** route (its layout chain + own chunk) to `modulepreload` in the\n * shell — so the route code downloads in parallel with the entry instead of after it\n * (`buildClient`'s per-route map). Empty/omitted ⇒ only the entry is preloaded (unchanged). */\n readonly preload?: readonly string[];\n /** Stylesheet URLs for the **matched** route (its layout chain + own CSS, from `buildClient`'s\n * `BuildManifest.css`) — injected as `<link rel=\"stylesheet\">` in `<head>` so styles arrive with the\n * first paint (no FOUC). Rendered even on non-hydrated pages. Empty/omitted ⇒ none (unchanged). */\n readonly styles?: readonly string[];\n /** SSG: the prerendered-path set, serialized to `window.__NIFRA_PRERENDERED__` so the client fetches\n * a static `_data.json` on soft-nav into a prerendered route. Empty/omitted ⇒ not injected. */\n readonly prerenderedPaths?: readonly string[];\n /** ISR: route freshness in seconds, emitted as the `x-nifra-isr-revalidate` header for a `withISR`\n * wrapper to read. Omit ⇒ no header (the wrapper's default TTL applies). */\n readonly revalidate?: number;\n /** Matched route id; written to `window.__NIFRA_ROUTE__` so the client hydrates this chain. */\n readonly routeId?: string;\n /** HTTP status for the response (default 200; e.g. 404 for a not-found page). */\n readonly status?: number;\n /** Document title (fallback when `head.title` is unset). */\n readonly title?: string;\n /** Resolved route head — `title` overrides `title` above; `meta`/`link` render as managed\n * (`data-nifra`) tags the client updates on navigation.\n *\n * **Head contract (the layout chain contributes).** `createWebApp` resolves this via\n * {@link mergeHeads}: a route's head is its **layout chain's** `meta`/`head` exports merged with the\n * page's. A `_layout.tsx` may `export const meta` (or `export function meta(args)`) — its tags land\n * on every page below it (the home for `hreflang`, `preconnect`, a section-default `<title>`). The\n * merge is **nearest-wins for scalars** (the page's `title` overrides an inner layout's, which\n * overrides an outer one; an undefined page title keeps the layout's) and **concatenated for the\n * `meta`/`link` arrays** (outermost layout first, page last). `<link>` attributes are name-validated\n * (any letter/digit/hyphen name — covers `rel`/`href`/`hreflang`/`crossorigin`/`media`/`sizes`/`as`/\n * `integrity`/`fetchpriority`/…) and value-escaped against XSS. */\n readonly head?: Meta;\n /** Id of the container wrapping the app markup (default `\"root\"`). */\n readonly rootId?: string;\n /** When `false`, emit a complete but **non-hydrated** document — no client entry script, data\n * globals, or modulepreloads. Used for server-rendered `_error` pages: a terminal state that needs no\n * client takeover, and it sidesteps an SSR/hydrate mismatch (the server rendered the boundary, not\n * the page the client manifest maps this route id to). Default `true`. */\n readonly hydrate?: boolean;\n /** Island client bundles (`@nifrajs/web/islands`) to load as `<script type=\"module\">` in the document\n * tail — emitted **regardless of `hydrate`**, so a static (`hydrate: false`) page can still mount\n * no-framework islands. URLs are attribute-escaped. Empty/omitted ⇒ none (unchanged output). */\n readonly islandScripts?: readonly string[];\n}"
|
|
6391
|
+
"signature": "export interface RenderPageOptions {\n readonly adapter: RenderAdapter;\n /** The layout chain to render — outermost layout → page (opaque; the adapter renders it). */\n readonly chain: readonly unknown[];\n /** The loader output for this request. */\n readonly data: unknown;\n /** An action's data return (POST only) — surfaced to the page as `actionData` + serialized\n * for the client so post-POST hydration matches. Omit on GETs. */\n readonly actionData?: unknown;\n /** URL of the built client entry (loaded as a module script). */\n readonly clientEntry: string;\n /** Chunk URLs for the **matched** route (its layout chain + own chunk) to `modulepreload` in the\n * shell — so the route code downloads in parallel with the entry instead of after it\n * (`buildClient`'s per-route map). Empty/omitted ⇒ only the entry is preloaded (unchanged). */\n readonly preload?: readonly string[];\n /** Stylesheet URLs for the **matched** route (its layout chain + own CSS, from `buildClient`'s\n * `BuildManifest.css`) — injected as `<link rel=\"stylesheet\">` in `<head>` so styles arrive with the\n * first paint (no FOUC). Rendered even on non-hydrated pages. Empty/omitted ⇒ none (unchanged). */\n readonly styles?: readonly string[];\n /** SSG: the prerendered-path set, serialized to `window.__NIFRA_PRERENDERED__` so the client fetches\n * a static `_data.json` on soft-nav into a prerendered route. Empty/omitted ⇒ not injected. */\n readonly prerenderedPaths?: readonly string[];\n /** ISR: route freshness in seconds, emitted as the `x-nifra-isr-revalidate` header for a `withISR`\n * wrapper to read. Omit ⇒ no header (the wrapper's default TTL applies). */\n readonly revalidate?: number;\n /** Matched route id; written to `window.__NIFRA_ROUTE__` so the client hydrates this chain. */\n readonly routeId?: string;\n /** The matched route's decoded path params — surfaced to the page as `params` (via {@link RenderProps})\n * so an adapter's `useParams` is SSR-correct. Omit ⇒ `{}` (a route with no dynamic segments, or an\n * error/404 render). */\n readonly params?: Readonly<Record<string, string>>;\n /** The request's `pathname + search` — surfaced as `path` (via {@link RenderProps}) so an adapter's\n * `useLocation`/`useSearchParams` render the right URL server-side and hydrate without drift. Omit ⇒\n * `\"\"`. */\n readonly path?: string;\n /** HTTP status for the response (default 200; e.g. 404 for a not-found page). */\n readonly status?: number;\n /** Document title (fallback when `head.title` is unset). */\n readonly title?: string;\n /** Resolved route head — `title` overrides `title` above; `meta`/`link` render as managed\n * (`data-nifra`) tags the client updates on navigation.\n *\n * **Head contract (the layout chain contributes).** `createWebApp` resolves this via\n * {@link mergeHeads}: a route's head is its **layout chain's** `meta`/`head` exports merged with the\n * page's. A `_layout.tsx` may `export const meta` (or `export function meta(args)`) — its tags land\n * on every page below it (the home for `hreflang`, `preconnect`, a section-default `<title>`). The\n * merge is **nearest-wins for scalars** (the page's `title` overrides an inner layout's, which\n * overrides an outer one; an undefined page title keeps the layout's) and **concatenated for the\n * `meta`/`link` arrays** (outermost layout first, page last). `<link>` attributes are name-validated\n * (any letter/digit/hyphen name — covers `rel`/`href`/`hreflang`/`crossorigin`/`media`/`sizes`/`as`/\n * `integrity`/`fetchpriority`/…) and value-escaped against XSS. */\n readonly head?: Meta;\n /** Id of the container wrapping the app markup (default `\"root\"`). */\n readonly rootId?: string;\n /** When `false`, emit a complete but **non-hydrated** document — no client entry script, data\n * globals, or modulepreloads. Used for server-rendered `_error` pages: a terminal state that needs no\n * client takeover, and it sidesteps an SSR/hydrate mismatch (the server rendered the boundary, not\n * the page the client manifest maps this route id to). Default `true`. */\n readonly hydrate?: boolean;\n /** Island client bundles (`@nifrajs/web/islands`) to load as `<script type=\"module\">` in the document\n * tail — emitted **regardless of `hydrate`**, so a static (`hydrate: false`) page can still mount\n * no-framework islands. URLs are attribute-escaped. Empty/omitted ⇒ none (unchanged output). */\n readonly islandScripts?: readonly string[];\n}"
|
|
4929
6392
|
},
|
|
4930
6393
|
{
|
|
4931
6394
|
"name": "renderPageResult",
|
|
@@ -4944,7 +6407,7 @@
|
|
|
4944
6407
|
"name": "RenderProps",
|
|
4945
6408
|
"kind": "interface",
|
|
4946
6409
|
"package": "@nifrajs/web",
|
|
4947
|
-
"signature": "export interface RenderProps {\n readonly data: unknown;\n readonly actionData?: unknown;\n /** True while a client navigation or submit is in flight (client-only; absent/false on SSR). */\n readonly pending?: boolean;\n /** The in-flight client submit, for optimistic UI (client-only; absent on SSR + when idle). */\n readonly submission?: Submission;\n}",
|
|
6410
|
+
"signature": "export interface RenderProps {\n readonly data: unknown;\n readonly actionData?: unknown;\n /** True while a client navigation or submit is in flight (client-only; absent/false on SSR). */\n readonly pending?: boolean;\n /** The in-flight client submit, for optimistic UI (client-only; absent on SSR + when idle). */\n readonly submission?: Submission;\n /** The matched route's decoded path params (`/users/:id` → `{ id: \"7\" }`). Threaded identically on\n * SSR (from the request match) and on client navigation (from router state) so an adapter's\n * `useParams` reads the same value on both, with no hydration mismatch. Absent ⇒ no params (`{}`). */\n readonly params?: Readonly<Record<string, string>>;\n /** The current URL's `pathname + search` (no hash — the hash never reaches the server). Threaded on\n * SSR and client alike so an adapter's `useLocation`/`useSearchParams` hydrate consistently. Absent\n * on adapters/callers that don't supply it (treated as `\"\"`). */\n readonly path?: string;\n}",
|
|
4948
6411
|
"doc": "/** The data handed to a route component. Opaque to the core. `actionData` is the return of a\n * route `action` after a POST (absent on plain GETs). `pending` + `submission` are client-only\n * (absent on SSR): they drive **optimistic UI** — render from `submission.formData` while `pending`. */"
|
|
4949
6412
|
},
|
|
4950
6413
|
{
|
|
@@ -4976,11 +6439,24 @@
|
|
|
4976
6439
|
"doc": "/**\n * Render a {@link SizeReport} as a terse aligned table (biggest first) with a totals row — the text\n * `nifra build --report` prints. Pure (string in, string out) so the formatting is unit-testable.\n */"
|
|
4977
6440
|
},
|
|
4978
6441
|
{
|
|
4979
|
-
"name": "renderTypesResult",
|
|
4980
|
-
"kind": "function",
|
|
4981
|
-
"package": "@nifrajs/cli",
|
|
4982
|
-
"signature": "export declare function renderTypesResult(types: readonly TypeEntry[], name: string | undefined, query: string | undefined, limit: number): string;",
|
|
4983
|
-
"doc": "/**\n * Render the tool result. `name` → the exact declaration(s); else `query` → the top matches; else a\n * per-package index of type names. The signatures are authoritative (generated from the built `.d.ts`),\n * so this is the complete answer — there is no need to read a `.d.ts` file.\n */"
|
|
6442
|
+
"name": "renderTypesResult",
|
|
6443
|
+
"kind": "function",
|
|
6444
|
+
"package": "@nifrajs/cli",
|
|
6445
|
+
"signature": "export declare function renderTypesResult(types: readonly TypeEntry[], name: string | undefined, query: string | undefined, limit: number): string;",
|
|
6446
|
+
"doc": "/**\n * Render the tool result. `name` → the exact declaration(s); else `query` → the top matches; else a\n * per-package index of type names. The signatures are authoritative (generated from the built `.d.ts`),\n * so this is the complete answer — there is no need to read a `.d.ts` file.\n */"
|
|
6447
|
+
},
|
|
6448
|
+
{
|
|
6449
|
+
"name": "replayIncident",
|
|
6450
|
+
"kind": "function",
|
|
6451
|
+
"package": "@nifrajs/testing",
|
|
6452
|
+
"signature": "export declare function replayIncident(app: AppLike, capsule: IncidentCapsule, options?: ReplayIncidentOptions): Promise<IncidentReplayResult>;",
|
|
6453
|
+
"doc": "/** Replay a captured incident against the current app and report whether it reproduces. */"
|
|
6454
|
+
},
|
|
6455
|
+
{
|
|
6456
|
+
"name": "ReplayIncidentOptions",
|
|
6457
|
+
"kind": "interface",
|
|
6458
|
+
"package": "@nifrajs/testing",
|
|
6459
|
+
"signature": "export interface ReplayIncidentOptions {\n readonly origin?: string;\n /** Also require the response body SHAPE to match the captured shape (not just status). Default false. */\n readonly assertShape?: boolean;\n}"
|
|
4984
6460
|
},
|
|
4985
6461
|
{
|
|
4986
6462
|
"name": "reproduciblePath",
|
|
@@ -4989,6 +6465,13 @@
|
|
|
4989
6465
|
"signature": "export declare function reproduciblePath(absolutePath: string): string;",
|
|
4990
6466
|
"doc": "/**\n * A **package-root-relative**, forward-slashed form of an absolute path — the input to {@link hash8} for\n * any build-stable identifier (e.g. CSS-module scoped names). Anchoring on the file's nearest\n * `package.json` (not the absolute path, not `process.cwd()`) makes the result independent of BOTH the\n * machine's directory layout AND the working directory: the dom build and the ssr runtime — even on\n * different machines or from different cwds — derive the SAME relative path for a given file, so their\n * scoped class maps always agree. (Hashing the absolute path would differ across CI/host; a\n * cwd-relative path would silently desync if the SSR server started from a non-project-root cwd.)\n */"
|
|
4991
6467
|
},
|
|
6468
|
+
{
|
|
6469
|
+
"name": "RequestBudget",
|
|
6470
|
+
"kind": "interface",
|
|
6471
|
+
"package": "@nifrajs/core",
|
|
6472
|
+
"signature": "export interface RequestBudget {\n /** Absolute Unix epoch deadline for wire propagation. */\n readonly deadline: number;\n /** The request cancellation signal. Nifra drives this when its effective deadline elapses. */\n readonly signal: AbortSignal;\n /** Non-negative milliseconds remaining, measured with the monotonic clock. */\n remaining(): number;\n /** A view that finishes `reserveMs` before this budget, preserving time for response cleanup. */\n child(reserveMs: number): RequestBudget;\n}",
|
|
6473
|
+
"doc": "/** A time budget shared by one request and every downstream hop it initiates. */"
|
|
6474
|
+
},
|
|
4992
6475
|
{
|
|
4993
6476
|
"name": "requestId",
|
|
4994
6477
|
"kind": "function",
|
|
@@ -5002,6 +6485,13 @@
|
|
|
5002
6485
|
"package": "@nifrajs/middleware",
|
|
5003
6486
|
"signature": "export interface RequestIdOptions {\n /** Header read for an inbound id (trace propagation) + echoed on the response. Default `\"x-request-id\"`. */\n readonly header?: string;\n /** Generate an id when the inbound header is absent. Default `crypto.randomUUID()`. */\n readonly generate?: () => string;\n}"
|
|
5004
6487
|
},
|
|
6488
|
+
{
|
|
6489
|
+
"name": "RequestLedger",
|
|
6490
|
+
"kind": "interface",
|
|
6491
|
+
"package": "@nifrajs/core",
|
|
6492
|
+
"signature": "export interface RequestLedger {\n /** Validate, freeze, and record one entry. Throws on invalid input, overflow, or after seal. */\n append(input: EffectEntryInput): EffectEntry;\n /** Entries recorded so far (frozen snapshot view). */\n entries(): readonly EffectEntry[];\n readonly size: number;\n readonly sealed: boolean;\n /** Finalize the ledger (computing the chain when enabled). Idempotent — always the same result. */\n seal(): Promise<SealedEffectLedger>;\n}",
|
|
6493
|
+
"doc": "/** Per-request ledger. `append` is synchronous (hot-path safe); `seal` is idempotent and async. */"
|
|
6494
|
+
},
|
|
5005
6495
|
{
|
|
5006
6496
|
"name": "RequestLogFields",
|
|
5007
6497
|
"kind": "interface",
|
|
@@ -5169,6 +6659,13 @@
|
|
|
5169
6659
|
"package": "@nifrajs/middleware",
|
|
5170
6660
|
"signature": "export interface ResponseCacheStore {\n get(key: string): MaybePromise<CachedResponse | undefined>;\n set(key: string, response: CachedResponse): MaybePromise<void>;\n delete?(key: string): MaybePromise<void>;\n}"
|
|
5171
6661
|
},
|
|
6662
|
+
{
|
|
6663
|
+
"name": "ResponseClassification",
|
|
6664
|
+
"kind": "interface",
|
|
6665
|
+
"package": "@nifrajs/core",
|
|
6666
|
+
"signature": "export interface ResponseClassification {\n readonly fields: Readonly<Record<string, DataClassification>>;\n readonly max: DataClassification;\n}",
|
|
6667
|
+
"doc": "/** Field paths use JSON Pointer segments; array items use a `*` segment. */"
|
|
6668
|
+
},
|
|
5172
6669
|
{
|
|
5173
6670
|
"name": "ResponseControls",
|
|
5174
6671
|
"kind": "interface",
|
|
@@ -5190,6 +6687,13 @@
|
|
|
5190
6687
|
"signature": "export interface ResponseFinalization {\n /** The final response, or the last response available when a transformation failed. */\n readonly response: Response;\n /** A response-hook failure. Terminal observers run fail-open before the error is rethrown. */\n readonly error?: unknown;\n}",
|
|
5191
6688
|
"doc": "/** The terminal response-pipeline outcome observed after every transforming `onResponse` hook. */"
|
|
5192
6689
|
},
|
|
6690
|
+
{
|
|
6691
|
+
"name": "responseFromStored",
|
|
6692
|
+
"kind": "function",
|
|
6693
|
+
"package": "@nifrajs/core",
|
|
6694
|
+
"signature": "export declare function responseFromStored(stored: StoredResponse, options?: {\n readonly maxBytes?: number;\n}): Response;",
|
|
6695
|
+
"doc": "/** Rebuild a live response from storage, stamping the replay marker header. */"
|
|
6696
|
+
},
|
|
5193
6697
|
{
|
|
5194
6698
|
"name": "Result",
|
|
5195
6699
|
"kind": "type",
|
|
@@ -5237,6 +6741,13 @@
|
|
|
5237
6741
|
"signature": "export interface RevalidateResult<T> {\n readonly __nifraRevalidate: readonly string[];\n readonly data: T;\n}",
|
|
5238
6742
|
"doc": "/** The wrapper `revalidate()` returns: the action's `data` plus the paths it changed. A plain tagged\n * shape (not a class) so `@nifrajs/client`'s `ActionData` can unwrap it structurally without importing\n * from `@nifrajs/web`. `createWebApp` strips the wrapper — the client receives `data` as the body and\n * the paths via the `X-Nifra-Revalidate` header. */"
|
|
5239
6743
|
},
|
|
6744
|
+
{
|
|
6745
|
+
"name": "rewriteVersionSpec",
|
|
6746
|
+
"kind": "function",
|
|
6747
|
+
"package": "@nifrajs/cli",
|
|
6748
|
+
"signature": "export declare function rewriteVersionSpec(spec: string, toVersion: string): string | null;",
|
|
6749
|
+
"doc": "/**\n * Rewrite a dependency version spec to `toVersion`, preserving the range operator (`^`, `~`, …).\n * Returns null when the spec is not a plain semver spec (→ skip it) or already equals the target.\n */"
|
|
6750
|
+
},
|
|
5240
6751
|
{
|
|
5241
6752
|
"name": "robots",
|
|
5242
6753
|
"kind": "function",
|
|
@@ -5270,12 +6781,25 @@
|
|
|
5270
6781
|
"signature": "export type RouteBody<App, Path extends string, Method extends string> = Path extends keyof RegistryOf<App> ? Uppercase<Method> extends keyof RegistryOf<App>[Path] ? (RegistryOf<App>[Path][Uppercase<Method>] & RouteInfo)[\"body\"] : never : never;",
|
|
5271
6782
|
"doc": "/** The body object type of `App`'s `Method Path` route (`never` when the route declares no body). */"
|
|
5272
6783
|
},
|
|
6784
|
+
{
|
|
6785
|
+
"name": "RouteCapabilityEvidence",
|
|
6786
|
+
"kind": "interface",
|
|
6787
|
+
"package": "@nifrajs/core",
|
|
6788
|
+
"signature": "export interface RouteCapabilityEvidence {\n readonly method: string;\n readonly path: string;\n /** True only when the route's reachable module graph was actually scanned. */\n readonly covered: boolean;\n readonly evidence: readonly CapabilityEvidence[];\n}"
|
|
6789
|
+
},
|
|
5273
6790
|
{
|
|
5274
6791
|
"name": "RouteChange",
|
|
5275
6792
|
"kind": "interface",
|
|
5276
6793
|
"package": "@nifrajs/core",
|
|
5277
6794
|
"signature": "export interface RouteChange {\n readonly severity: DiffSeverity;\n readonly method: string;\n readonly path: string;\n /** Which part of the contract changed; \"route\" for add/remove of the whole route. */\n readonly section: \"route\" | \"body\" | \"query\" | \"response\" | \"sse\" | \"errors\";\n /** The top-level field (or error status) the change is about, when field-granular. */\n readonly field?: string;\n readonly message: string;\n}"
|
|
5278
6795
|
},
|
|
6796
|
+
{
|
|
6797
|
+
"name": "routeClassification",
|
|
6798
|
+
"kind": "function",
|
|
6799
|
+
"package": "@nifrajs/core",
|
|
6800
|
+
"signature": "export declare function routeClassification(responseSchema: unknown, fallback: DataClassification | undefined): ResponseClassification | undefined;",
|
|
6801
|
+
"doc": "/** Merge field metadata with an optional route-level sensitivity fallback. */"
|
|
6802
|
+
},
|
|
5279
6803
|
{
|
|
5280
6804
|
"name": "RouteConfigError",
|
|
5281
6805
|
"kind": "class",
|
|
@@ -5287,14 +6811,14 @@
|
|
|
5287
6811
|
"name": "RouteConfigErrorCode",
|
|
5288
6812
|
"kind": "type",
|
|
5289
6813
|
"package": "@nifrajs/core",
|
|
5290
|
-
"signature": "export type RouteConfigErrorCode = \"DUPLICATE_ROUTE\" | \"DUPLICATE_PARAM\" | \"PARAM_NAME_CONFLICT\" | \"INVALID_PATH\" | \"INVALID_PARAM_NAME\" | \"WILDCARD_NOT_LAST\" | \"INVALID_METHOD\";",
|
|
6814
|
+
"signature": "export type RouteConfigErrorCode = \"DUPLICATE_ROUTE\" | \"DUPLICATE_PARAM\" | \"PARAM_NAME_CONFLICT\" | \"INVALID_PATH\" | \"INVALID_PARAM_NAME\" | \"WILDCARD_NOT_LAST\" | \"INVALID_METHOD\" | \"INVALID_ASSURANCE\" | \"INVALID_IDEMPOTENCY\";",
|
|
5291
6815
|
"doc": "/** Stable codes for boot-time (L2) route configuration failures. */"
|
|
5292
6816
|
},
|
|
5293
6817
|
{
|
|
5294
6818
|
"name": "RouteDescriptor",
|
|
5295
6819
|
"kind": "interface",
|
|
5296
6820
|
"package": "@nifrajs/core",
|
|
5297
|
-
"signature": "export interface RouteDescriptor {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}",
|
|
6821
|
+
"signature": "export interface RouteDescriptor {\n readonly method: Method;\n readonly path: string;\n readonly schema: RouteSchema | undefined;\n /** Effective enforcement evidence, populated only during reflection/introspection. */\n readonly assurance?: readonly AssuranceEvidence[];\n /** Normalized declared effect tokens, populated only when the route declares any. */\n readonly capabilities?: readonly string[];\n readonly tool?: {\n readonly name: string;\n readonly description: string;\n readonly annotations?: ToolAnnotations;\n };\n}",
|
|
5298
6822
|
"doc": "/**\n * A registered route's public descriptor — method, path, and input schemas. The\n * router trie discards the original patterns, so this flat list is what lets tools\n * (e.g. `toOpenAPI`) enumerate routes after registration.\n */"
|
|
5299
6823
|
},
|
|
5300
6824
|
{
|
|
@@ -5304,6 +6828,13 @@
|
|
|
5304
6828
|
"signature": "export interface RouteEntry {\n readonly id: string;\n readonly pattern: string;\n readonly layoutIds: readonly string[];\n /** `_error` boundary ids in this route's ancestor chain (outermost → innermost). The last is the\n * **nearest** boundary, rendered when the route's loader throws. Always set by `buildManifest`\n * (optional only so hand-built test manifests may omit it); absent/empty ⇒ no boundary (error 500s). */\n readonly errorIds?: readonly string[];\n readonly file: string;\n readonly load: () => Promise<RouteModule>;\n}",
|
|
5305
6829
|
"doc": "/** One matched route: pattern, nested layout ids (outermost → innermost), source file, loader. */"
|
|
5306
6830
|
},
|
|
6831
|
+
{
|
|
6832
|
+
"name": "routeGlob",
|
|
6833
|
+
"kind": "function",
|
|
6834
|
+
"package": "@nifrajs/core",
|
|
6835
|
+
"signature": "export declare function routeGlob(pattern: string): RegExp;",
|
|
6836
|
+
"doc": "/** Compile an absolute route glob. `*` is one segment; `**` is zero or more segments. */"
|
|
6837
|
+
},
|
|
5307
6838
|
{
|
|
5308
6839
|
"name": "RouteInfo",
|
|
5309
6840
|
"kind": "interface",
|
|
@@ -5388,6 +6919,20 @@
|
|
|
5388
6919
|
"signature": "export declare class Router<T> {\n private readonly root;\n /**\n * Fast path: fully-static paths (no `:param`/`*`) resolve in a single map\n * lookup keyed by the full path, skipping the trie walk entirely. Values are\n * the same `Terminal` objects held in the trie, so adding a method later\n * updates both views at once.\n */\n private readonly staticRoutes;\n /**\n * Scratch storage for param/wildcard captures during a synchronous trie walk. `find()` copies the\n * values into the returned params object before clearing this array, so returned matches never share\n * mutable state. Kept per Router instance, not module-global, to avoid cross-app coupling.\n */\n private readonly paramValuesScratch;\n constructor();\n /**\n * Register a payload for `method` + `path`. Throws {@link RouteConfigError}\n * (boot-time, L2) on a duplicate route, a malformed pattern, or conflicting\n * parameter names for the same path shape.\n */\n add(method: Method, path: string, payload: T): void;\n /**\n * Resolve `method` + `path`. Tolerant of a missing leading slash and of\n * method casing. Never throws.\n */\n find(method: string, path: string): RouterMatch<T>;\n private findDynamic;\n private maybeCacheDynamicMatch;\n}",
|
|
5389
6920
|
"doc": "/**\n * Radix-style segment trie router. Matching precedence is static > param >\n * wildcard. Parameter/wildcard values are returned RAW (not percent-decoded);\n * the server boundary decodes and rejects malformed encodings with a 400,\n * keeping this layer pure and allocation-light.\n *\n * @typeParam T - the payload stored per (method, path); a route descriptor in\n * practice, but the router is agnostic to it.\n */"
|
|
5390
6921
|
},
|
|
6922
|
+
{
|
|
6923
|
+
"name": "RouterContext",
|
|
6924
|
+
"kind": "const",
|
|
6925
|
+
"package": "@nifrajs/web-react",
|
|
6926
|
+
"signature": "export declare const RouterContext: import(\"react\").Context<RouterContextValue>;",
|
|
6927
|
+
"doc": "/** Router context. The default ({} params, \"\" path) is what a component sees when rendered outside a\n * nifra route tree — the hooks stay defined (no throw) so a stray `useParams` degrades gracefully. */"
|
|
6928
|
+
},
|
|
6929
|
+
{
|
|
6930
|
+
"name": "RouterContextValue",
|
|
6931
|
+
"kind": "interface",
|
|
6932
|
+
"package": "@nifrajs/web-react",
|
|
6933
|
+
"signature": "export interface RouterContextValue {\n /** The matched route's decoded path params (`/users/:id` → `{ id: \"7\" }`). */\n readonly params: Readonly<Record<string, string>>;\n /** The current URL's `pathname + search` (no hash — the router never carries one). */\n readonly path: string;\n}",
|
|
6934
|
+
"doc": "/** The current route the routing hooks read. Provided by `compose` on SSR + client mount alike. */"
|
|
6935
|
+
},
|
|
5391
6936
|
{
|
|
5392
6937
|
"name": "RouterMatch",
|
|
5393
6938
|
"kind": "type",
|
|
@@ -5406,7 +6951,7 @@
|
|
|
5406
6951
|
"name": "RouteSchema",
|
|
5407
6952
|
"kind": "interface",
|
|
5408
6953
|
"package": "@nifrajs/core",
|
|
5409
|
-
"signature": "export interface RouteSchema {\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n /** Optional **response contract**. When declared: the handler's return is type-checked against it\n * (the implementation can't drift from the contract), the typed client sees THIS as the response type\n * (the contract — not the handler's incidental return), and it's emitted into OpenAPI/JSON-Schema so\n * tooling and coding agents can read the exact shape. It is **not** validated at runtime (zero\n * hot-path cost) — purely a compile-time + introspection contract. */\n readonly response?: StandardSchemaV1;\n /**\n * Optional **error-response contract**: a map of HTTP status code → the Standard Schema of that error's\n * body. Declares a route's failure modes so they flow into OpenAPI (as non-2xx `responses`), the\n * `/llms.txt` context, and other introspection — the whole contract, not just the happy path, is legible\n * to tooling and coding agents. Like `response`, it is **not** validated at runtime (zero hot-path cost);\n * it's a compile-time + introspection contract. Example: `{ 404: NotFound, 409: Conflict }`. */\n readonly errors?: Readonly<Record<number, StandardSchemaV1>>;\n /**\n * Optional **SSE event contract**: the Standard Schema of each event's `data` payload on a\n * streaming route (declared via `app.sse()`). Marks the route as a typed event stream — the\n * typed client grows a `.subscribe()` for it, and the schema flows into reflection. Like\n * `response`, it is **not** validated at runtime (zero hot-path cost); the server-side\n * `stream.send()` is compile-time-checked against it instead.\n */\n readonly sse?: StandardSchemaV1;\n /**\n * Hook fired when the request fails `body`/`query` validation, before the handler runs. `kind` says\n * which input failed (`\"body\"` | `\"query\"`). Its return value selects one of three outcomes (may be async):\n * - a **`Response`** → returned as-is, short-circuiting the route (custom error envelope, redirect, …).\n * - **any other value** → treated as a repaired payload and **re-validated once** against the same\n * schema. If it now passes, the handler runs with it; if it still fails, the original `422` stands.\n * Re-validation means a bad return can't bypass the schema — the trust boundary holds.\n * - **`undefined`** → give up; the original validation `422` is returned unchanged.\n * A route hook **overrides** the app-wide default set via `server({ onValidationError })`; return\n * `undefined` to fall through to the plain `422` even when an app default exists. Typical uses: a custom\n * error envelope, coercing the input, or prompting an LLM to repair the payload (re-validated, so it can't\n * bypass the schema).\n */\n readonly onValidationError?: (issues: ReadonlyArray<StandardIssue>, ctx: Context, kind: \"body\" | \"query\") => Response | unknown | Promise<Response | unknown>;\n}",
|
|
6954
|
+
"signature": "export interface RouteSchema {\n /** Declared effect tokens. Reflected for assurance; never read by validation or serialization. */\n readonly capabilities?: readonly string[];\n /**\n * Dedupe retries of this (mutating) route on an `Idempotency-Key` header. The first request runs and\n * its response is stored; a retry with the same key replays that response without re-running the\n * handler, and a key reused with a different body is rejected (409). A missing key on an\n * idempotency-required route fails closed (400). Off the hot path — routes without it are unchanged.\n */\n readonly idempotency?: IdempotencyConfig;\n /**\n * Highest data-sensitivity this route's response body carries (`public` | `pii` | `secret`). A\n * declarative, compile-time + introspection fact — never validated at runtime. Reflected for tooling,\n * recorded in the capability lockfile (so a route that starts returning PII is a reviewable change),\n * and read by downstream policy (e.g. a partner-API surface refusing to expose `pii`/`secret`).\n */\n readonly classification?: DataClassification;\n readonly body?: StandardSchemaV1;\n readonly query?: StandardSchemaV1;\n /** Optional **response contract**. When declared: the handler's return is type-checked against it\n * (the implementation can't drift from the contract), the typed client sees THIS as the response type\n * (the contract — not the handler's incidental return), and it's emitted into OpenAPI/JSON-Schema so\n * tooling and coding agents can read the exact shape. It is **not** validated at runtime (zero\n * hot-path cost) — purely a compile-time + introspection contract. */\n readonly response?: StandardSchemaV1;\n /**\n * Optional **error-response contract**: a map of HTTP status code → the Standard Schema of that error's\n * body. Declares a route's failure modes so they flow into OpenAPI (as non-2xx `responses`), the\n * `/llms.txt` context, and other introspection — the whole contract, not just the happy path, is legible\n * to tooling and coding agents. Like `response`, it is **not** validated at runtime (zero hot-path cost);\n * it's a compile-time + introspection contract. Example: `{ 404: NotFound, 409: Conflict }`. */\n readonly errors?: Readonly<Record<number, StandardSchemaV1>>;\n /**\n * Optional **SSE event contract**: the Standard Schema of each event's `data` payload on a\n * streaming route (declared via `app.sse()`). Marks the route as a typed event stream — the\n * typed client grows a `.subscribe()` for it, and the schema flows into reflection. Like\n * `response`, it is **not** validated at runtime (zero hot-path cost); the server-side\n * `stream.send()` is compile-time-checked against it instead.\n */\n readonly sse?: StandardSchemaV1;\n /**\n * Hook fired when the request fails `body`/`query` validation, before the handler runs. `kind` says\n * which input failed (`\"body\"` | `\"query\"`). Its return value selects one of three outcomes (may be async):\n * - a **`Response`** → returned as-is, short-circuiting the route (custom error envelope, redirect, …).\n * - **any other value** → treated as a repaired payload and **re-validated once** against the same\n * schema. If it now passes, the handler runs with it; if it still fails, the original `422` stands.\n * Re-validation means a bad return can't bypass the schema — the trust boundary holds.\n * - **`undefined`** → give up; the original validation `422` is returned unchanged.\n * A route hook **overrides** the app-wide default set via `server({ onValidationError })`; return\n * `undefined` to fall through to the plain `422` even when an app default exists. Typical uses: a custom\n * error envelope, coercing the input, or prompting an LLM to repair the payload (re-validated, so it can't\n * bypass the schema).\n */\n readonly onValidationError?: (issues: ReadonlyArray<StandardIssue>, ctx: Context, kind: \"body\" | \"query\") => Response | unknown | Promise<Response | unknown>;\n}",
|
|
5410
6955
|
"doc": "/** Per-route input schemas. Each is any Standard Schema (zod/valibot/arktype/…). */"
|
|
5411
6956
|
},
|
|
5412
6957
|
{
|
|
@@ -5474,6 +7019,13 @@
|
|
|
5474
7019
|
"signature": "export declare function run(argv: readonly string[]): Promise<{\n code: 0 | 1;\n message: string;\n}>;",
|
|
5475
7020
|
"doc": "/**\n * Run the CLI for `argv` and return the exit code + the message to print — no `process.exit`, `console`,\n * or `process.argv`, so the whole flow (parse → scaffold → next-steps) is unit-testable in-process.\n */"
|
|
5476
7021
|
},
|
|
7022
|
+
{
|
|
7023
|
+
"name": "runAdversarialContract",
|
|
7024
|
+
"kind": "function",
|
|
7025
|
+
"package": "@nifrajs/testing",
|
|
7026
|
+
"signature": "export declare function runAdversarialContract(app: ContractTestApp, options?: AdversarialContractOptions): Promise<AdversarialContractReport>;",
|
|
7027
|
+
"doc": "/**\n * Execute contract-derived hostile inputs and declared-response conformance against a runtime matrix.\n * Runtime/request failures are captured in the report; inspect `report.ok`, `failures`, and `gaps`\n * (or use {@link assertAdversarialContract} for a throwing test assertion).\n */"
|
|
7028
|
+
},
|
|
5477
7029
|
{
|
|
5478
7030
|
"name": "runApp",
|
|
5479
7031
|
"kind": "function",
|
|
@@ -5481,6 +7033,12 @@
|
|
|
5481
7033
|
"signature": "export declare function runApp(app: AppLike, requests: readonly RequestSpec[], options?: RunOptions): Promise<RunResult[]>;",
|
|
5482
7034
|
"doc": "/**\n * Run a batch of requests through the app, in order, and return a result per request. Never throws:\n * an app crash on any request is captured as that result's `error` and the run continues.\n */"
|
|
5483
7035
|
},
|
|
7036
|
+
{
|
|
7037
|
+
"name": "runAssurance",
|
|
7038
|
+
"kind": "function",
|
|
7039
|
+
"package": "@nifrajs/cli",
|
|
7040
|
+
"signature": "export declare function runAssurance(cwd: string, options?: {\n readonly json?: boolean;\n readonly config?: string;\n}): Promise<boolean>;"
|
|
7041
|
+
},
|
|
5484
7042
|
{
|
|
5485
7043
|
"name": "runBackend",
|
|
5486
7044
|
"kind": "function",
|
|
@@ -5488,6 +7046,20 @@
|
|
|
5488
7046
|
"signature": "export declare function runBackend(cwd: string, requests: unknown, entry?: string): Promise<{\n results: unknown;\n} | {\n error: string;\n}>;",
|
|
5489
7047
|
"doc": "/**\n * Resolve the backend entry under `cwd`, import it, and run `requests` through its exported app. Never\n * throws — every failure (missing/invalid entry, import/compile/runtime error) becomes `{ error }`, so\n * the caller (and the agent) always gets actionable output. An import error here IS the failure the\n * agent needs to see and fix.\n */"
|
|
5490
7048
|
},
|
|
7049
|
+
{
|
|
7050
|
+
"name": "runCapabilityCheck",
|
|
7051
|
+
"kind": "function",
|
|
7052
|
+
"package": "@nifrajs/cli",
|
|
7053
|
+
"signature": "export declare function runCapabilityCheck(cwd: string, options?: {\n readonly config?: string;\n readonly lockfile?: string;\n readonly json?: boolean;\n}): Promise<boolean>;",
|
|
7054
|
+
"doc": "/** Fail on assurance violations or any drift from the checked-in capability lockfile. */"
|
|
7055
|
+
},
|
|
7056
|
+
{
|
|
7057
|
+
"name": "runCapabilitySnapshot",
|
|
7058
|
+
"kind": "function",
|
|
7059
|
+
"package": "@nifrajs/cli",
|
|
7060
|
+
"signature": "export declare function runCapabilitySnapshot(cwd: string, options?: {\n readonly config?: string;\n readonly out?: string;\n}): Promise<boolean>;",
|
|
7061
|
+
"doc": "/** Write a lockfile only from a clean, fully-covered project report. */"
|
|
7062
|
+
},
|
|
5491
7063
|
{
|
|
5492
7064
|
"name": "runCheck",
|
|
5493
7065
|
"kind": "function",
|
|
@@ -5495,6 +7067,13 @@
|
|
|
5495
7067
|
"signature": "export declare function runCheck(cwd: string, opts?: {\n readonly json?: boolean;\n readonly lintsOnly?: boolean;\n}): Promise<boolean>;",
|
|
5496
7068
|
"doc": "/** Run the full check; print a report (`--json` for machine output) and return whether it passed. */"
|
|
5497
7069
|
},
|
|
7070
|
+
{
|
|
7071
|
+
"name": "runContractInvariants",
|
|
7072
|
+
"kind": "function",
|
|
7073
|
+
"package": "@nifrajs/core",
|
|
7074
|
+
"signature": "export declare function runContractInvariants(app: ReflectableApp, options?: RunInvariantsOptions): Promise<InvariantReport>;",
|
|
7075
|
+
"doc": "/** Run the contract-derived invariant suite against a reflectable app. Pure; no ambient state. */"
|
|
7076
|
+
},
|
|
5498
7077
|
{
|
|
5499
7078
|
"name": "runDiff",
|
|
5500
7079
|
"kind": "function",
|
|
@@ -5516,6 +7095,33 @@
|
|
|
5516
7095
|
"signature": "export declare function runInitAgents(cwd: string, opts?: {\n readonly json?: boolean;\n readonly force?: boolean;\n}): Promise<boolean>;",
|
|
5517
7096
|
"doc": "/**\n * CLI entry: run the retrofit at `cwd` and print the result. Returns `true` (the command always succeeds\n * unless a write throws — which propagates as a non-zero exit via the dispatcher's catch). `--json`\n * emits the structured result for agents/CI.\n */"
|
|
5518
7097
|
},
|
|
7098
|
+
{
|
|
7099
|
+
"name": "RunInvariantsOptions",
|
|
7100
|
+
"kind": "interface",
|
|
7101
|
+
"package": "@nifrajs/core",
|
|
7102
|
+
"signature": "export interface RunInvariantsOptions {\n /** Deterministic seed for the fuzzer. Default 1. */\n readonly seed?: number;\n /** Valid-input cases per route. Default 8. */\n readonly casesPerRoute?: number;\n /** Invalid-input (mutated) cases per route with a body schema. Default 4. */\n readonly invalidCasesPerRoute?: number;\n /**\n * Explicit isolated executor for dynamic cases. It must point at a disposable test app, sandbox,\n * or transaction that is rolled back. The runner never calls `source.fetch()` implicitly: doing so\n * could charge cards, send mail, or mutate production state merely by running a verification tool.\n */\n readonly executor?: InvariantExecutor;\n}"
|
|
7103
|
+
},
|
|
7104
|
+
{
|
|
7105
|
+
"name": "runLevels",
|
|
7106
|
+
"kind": "function",
|
|
7107
|
+
"package": "@nifrajs/cli",
|
|
7108
|
+
"signature": "export declare function runLevels(cwd: string, options?: CollectLevelsOptions & {\n readonly json?: boolean;\n readonly min?: number;\n}): Promise<boolean>;",
|
|
7109
|
+
"doc": "/** CLI entry: print the ladder (or JSON) and return whether the requested floor is met. */"
|
|
7110
|
+
},
|
|
7111
|
+
{
|
|
7112
|
+
"name": "runManifestDiff",
|
|
7113
|
+
"kind": "function",
|
|
7114
|
+
"package": "@nifrajs/cli",
|
|
7115
|
+
"signature": "export declare function runManifestDiff(cwd: string, beforePath: string, afterPath: string, options?: {\n readonly json?: boolean;\n}): Promise<boolean>;",
|
|
7116
|
+
"doc": "/** Diff two already-emitted, hash-verified artifacts. Suitable for deploy promotion gates. */"
|
|
7117
|
+
},
|
|
7118
|
+
{
|
|
7119
|
+
"name": "runManifestEmit",
|
|
7120
|
+
"kind": "function",
|
|
7121
|
+
"package": "@nifrajs/cli",
|
|
7122
|
+
"signature": "export declare function runManifestEmit(cwd: string, options?: {\n readonly config?: string;\n readonly out?: string;\n readonly sign?: string;\n}): Promise<boolean>;",
|
|
7123
|
+
"doc": "/** Build only after both assurance layers pass, then optionally create an operator-signed sidecar. */"
|
|
7124
|
+
},
|
|
5519
7125
|
{
|
|
5520
7126
|
"name": "runMcpServer",
|
|
5521
7127
|
"kind": "function",
|
|
@@ -5582,6 +7188,13 @@
|
|
|
5582
7188
|
"signature": "export declare function runSnapshot(cwd: string, options: {\n out?: string;\n}): Promise<void>;",
|
|
5583
7189
|
"doc": "/** `nifra snapshot`: write the current contract as the CI baseline. */"
|
|
5584
7190
|
},
|
|
7191
|
+
{
|
|
7192
|
+
"name": "runUpgrade",
|
|
7193
|
+
"kind": "function",
|
|
7194
|
+
"package": "@nifrajs/cli",
|
|
7195
|
+
"signature": "export declare function runUpgrade(cwd: string, options: UpgradeOptions): Promise<boolean>;",
|
|
7196
|
+
"doc": "/** CLI entry. Returns false (→ non-zero exit) on an unknown version, no project, or a failed verify. */"
|
|
7197
|
+
},
|
|
5585
7198
|
{
|
|
5586
7199
|
"name": "runWebSocket",
|
|
5587
7200
|
"kind": "function",
|
|
@@ -5652,6 +7265,13 @@
|
|
|
5652
7265
|
"package": "@nifrajs/cli",
|
|
5653
7266
|
"signature": "export interface ScaffoldWriteResult extends ScaffoldResult {\n readonly written: boolean;\n readonly reason?: string;\n}"
|
|
5654
7267
|
},
|
|
7268
|
+
{
|
|
7269
|
+
"name": "scanEffectImports",
|
|
7270
|
+
"kind": "function",
|
|
7271
|
+
"package": "@nifrajs/cli",
|
|
7272
|
+
"signature": "export declare function scanEffectImports(content: string): string[];",
|
|
7273
|
+
"doc": "/** Value-bearing import edges relevant to effect provenance, in source order. */"
|
|
7274
|
+
},
|
|
5655
7275
|
{
|
|
5656
7276
|
"name": "scanFetchText",
|
|
5657
7277
|
"kind": "function",
|
|
@@ -5793,6 +7413,13 @@
|
|
|
5793
7413
|
"package": "@nifrajs/web",
|
|
5794
7414
|
"signature": "export interface ScssPluginOptions {\n /** Inject the compiler (default: the `sass` optional peer, loaded lazily). Pass `sass-embedded` or a stub. */\n readonly compiler?: SassCompiler;\n /** Output style handed to Sass. Default `\"expanded\"` (Bun minifies the final CSS bundle anyway). */\n readonly style?: \"expanded\" | \"compressed\";\n /** Extra import search paths for `@use`/`@import`, in addition to the source file's own directory. */\n readonly loadPaths?: readonly string[];\n}"
|
|
5795
7415
|
},
|
|
7416
|
+
{
|
|
7417
|
+
"name": "SealedEffectLedger",
|
|
7418
|
+
"kind": "interface",
|
|
7419
|
+
"package": "@nifrajs/core",
|
|
7420
|
+
"signature": "export interface SealedEffectLedger {\n readonly method: string;\n /** The registered route pattern (`/users/:id`) — never the concrete request URL. */\n readonly path: string;\n readonly entries: readonly EffectEntry[];\n /** The route's declared capability tokens — the runtime-enforcement view: recorded ⊆ declared is\n * guaranteed by the beacon, and `declared` minus the recorded ids is the unused declaration set. */\n readonly declared: readonly string[];\n /** Present when the ledger was created with `chain: true`. */\n readonly chain?: EffectChain;\n}",
|
|
7421
|
+
"doc": "/** The immutable result of sealing a request's ledger. Token-only; safe to hand to any sink. */"
|
|
7422
|
+
},
|
|
5796
7423
|
{
|
|
5797
7424
|
"name": "searchExamples",
|
|
5798
7425
|
"kind": "function",
|
|
@@ -5806,6 +7433,13 @@
|
|
|
5806
7433
|
"package": "@nifrajs/core",
|
|
5807
7434
|
"signature": "export declare function searchOf(url: string): string;"
|
|
5808
7435
|
},
|
|
7436
|
+
{
|
|
7437
|
+
"name": "SearchParamsInit",
|
|
7438
|
+
"kind": "type",
|
|
7439
|
+
"package": "@nifrajs/web-react",
|
|
7440
|
+
"signature": "export type SearchParamsInit = URLSearchParams | Record<string, string | readonly string[]> | string;",
|
|
7441
|
+
"doc": "/** The value forms `setSearchParams` accepts. */"
|
|
7442
|
+
},
|
|
5809
7443
|
{
|
|
5810
7444
|
"name": "searchSections",
|
|
5811
7445
|
"kind": "function",
|
|
@@ -5887,6 +7521,27 @@
|
|
|
5887
7521
|
"signature": "export declare function serializeData(data: unknown): string;",
|
|
5888
7522
|
"doc": "/**\n * Serialize loader data for embedding inside an inline `<script>`. `JSON.stringify` alone\n * is NOT safe there: a string containing `</script>` or `<!--` would break out of the\n * script element (an XSS vector). Escape `<`/`>` to `\\uXXXX`, plus the U+2028/U+2029\n * separators.\n */"
|
|
5889
7523
|
},
|
|
7524
|
+
{
|
|
7525
|
+
"name": "serializeNifraManifest",
|
|
7526
|
+
"kind": "function",
|
|
7527
|
+
"package": "@nifrajs/core",
|
|
7528
|
+
"signature": "export declare function serializeNifraManifest(manifest: NifraManifest): string;",
|
|
7529
|
+
"doc": "/** Byte-stable artifact serialization (including `contentHash`). */"
|
|
7530
|
+
},
|
|
7531
|
+
{
|
|
7532
|
+
"name": "serializeNifraManifestSignature",
|
|
7533
|
+
"kind": "function",
|
|
7534
|
+
"package": "@nifrajs/core",
|
|
7535
|
+
"signature": "export declare function serializeNifraManifestSignature(signature: NifraManifestSignature): string;",
|
|
7536
|
+
"doc": "/** Byte-stable serialization for the detached signature sidecar. */"
|
|
7537
|
+
},
|
|
7538
|
+
{
|
|
7539
|
+
"name": "serializeResponse",
|
|
7540
|
+
"kind": "function",
|
|
7541
|
+
"package": "@nifrajs/core",
|
|
7542
|
+
"signature": "export declare function serializeResponse(response: Response, options?: {\n readonly maxBytes?: number;\n}): Promise<StoredResponse>;",
|
|
7543
|
+
"doc": "/** Buffer a response into a storable form. Clones first so the live response body stays intact. */"
|
|
7544
|
+
},
|
|
5890
7545
|
{
|
|
5891
7546
|
"name": "serve",
|
|
5892
7547
|
"kind": "function",
|
|
@@ -5924,7 +7579,7 @@
|
|
|
5924
7579
|
"name": "Server",
|
|
5925
7580
|
"kind": "class",
|
|
5926
7581
|
"package": "@nifrajs/core",
|
|
5927
|
-
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly router;\n /** WebSocket routes, matched separately at upgrade time (a GET + `Upgrade: websocket`). */\n private readonly wsRouter;\n private wsRouteCount;\n /** In-process pub/sub backing `ws.subscribe(topic)` + `app.publish(topic, data)` (single-instance).\n * Created by the first `app.ws()` via the `@nifrajs/core/ws` runtime — `undefined` until then, so a\n * no-WebSocket app never constructs (or bundles) it. */\n private topics;\n private readonly routeList;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n private readonly gracefulSignals;\n private readonly logger;\n /** App-wide validation-error fallback; a route's own `schema.onValidationError` takes precedence. */\n private readonly defaultOnValidationError?;\n private bunServer;\n private readonly derives;\n private readonly decorations;\n private readonly beforeHandleHooks;\n private readonly afterHandleHooks;\n private readonly onErrorHooks;\n private readonly aroundHooks;\n private readonly onRequestHooks;\n private readonly onResponseHooks;\n private readonly onResponseFinalizedHooks;\n private readonly responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\n /** App-declared MCP resources / prompts (via {@link resource} / {@link prompt}), read by `nifra mcp`. */\n private readonly mcpResourceList;\n private readonly mcpPromptList;\n constructor(options?: ServerOptions);\n /** Add a per-request, computed context extension for subsequent routes. */\n derive<D extends object>(fn: (context: Context & Ctx) => MaybePromise<D>): Server<R, Ctx & D>;\n /** Add a static context value for subsequent routes. */\n decorate<const K extends string, V>(key: K, value: V): Server<R, Ctx & Record<K, V>>;\n /**\n * Run before routing on the raw request. Return a `Response` to short-circuit, or a replacement\n * `Request` to continue routing with a rewritten method/URL/headers. Global.\n */\n onRequest(fn: (req: Request) => MaybePromise<OnRequestResult>): this;\n /** Run after validation, before the handler; a non-`undefined` return short-circuits. Order-scoped. */\n beforeHandle(fn: (context: Context & Ctx) => MaybePromise<unknown>): this;\n /**\n * Wrap the matched route lifecycle for subsequent routes. This is intentionally generic over the\n * route output, so wrappers like async context storage do not force Node's direct JSON path through\n * a Web `Response`. The first registered wrapper is outermost.\n */\n around(fn: <T>(context: Context & Ctx, next: () => MaybePromise<T>) => MaybePromise<T>): this;\n /** Transform the handler's result before it is serialized. Order-scoped. */\n afterHandle(fn: (result: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Handle a thrown error; a non-`undefined` return becomes the response (else the default 500). Order-scoped. */\n onError(fn: (error: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Transform every outgoing response — success, error, 404, 405, short-circuit. Global. */\n onResponse(fn: (response: Response, req: Request) => MaybePromise<Response>): this;\n /** Observe the terminal response after all transformations. Observers are ordered and fail-open. */\n onResponseFinalized(fn: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>): this;\n /**\n * Apply a type-**identity** plugin ({@link IdentityPlugin}, from {@link defineIdentityPlugin}) — it\n * registers routes/hooks but doesn't change the types, so this returns `this` with the route registry\n * and context fully intact. This overload exists specifically so a *named* identity plugin (e.g.\n * `@nifrajs/better-auth`) threads the registry: its `& { pluginName }` intersection would otherwise\n * defeat the generic inference of the transforming overload below and collapse the result to `any`.\n */\n use(plugin: IdentityPlugin): this;\n /**\n * Apply a **plugin function** — `(app) => app`, typically built with {@link definePlugin}. It's\n * called with `this` and its result is returned, so an inline plugin's `derive`/`decorate` thread\n * the added context to handlers defined after `use` (the overload is generic over the concrete\n * `this`). A named plugin already applied is skipped (idempotent dedupe).\n */\n use<Out extends AnyServer>(plugin: (app: this) => Out): Out;\n /**\n * Apply a {@link Middleware} bundle — wire each hook it provides to its lifecycle point. Returns\n * `this` (no context-type merging); call it before the routes its `beforeHandle`/`afterHandle`\n * should cover (those are order-scoped; `onRequest`/`onResponse` are global). A named bundle already\n * applied is skipped (idempotent).\n */\n use(mw: Middleware): this;\n get<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n get<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Register a **typed SSE route** — a GET endpoint streaming `text/event-stream` whose event\n * payloads are contracted by `schema.sse`. The handler receives the validated context plus a\n * {@link TypedSSEStream}: `stream.send(event)` is compile-time-checked against the schema and\n * JSON-serialized into the SSE `data:` field. The typed client sees the marker and grows a\n * `.subscribe(onEvent)` for the route with the same payload type — end-to-end typed streaming.\n *\n * const app = server().sse(\"/feed\", { sse: t.object({ id: t.integer(), title: t.string() }) },\n * async (c, stream) => {\n * stream.send({ id: 1, title: \"hello\" }) // typed\n * await waitForDisconnect(stream.signal)\n * },\n * { keepAlive: 15_000 })\n *\n * // client: const off = api.feed.subscribe((post) => console.log(post.title))\n *\n * `init` passes through to the underlying {@link sse} helper (`keepAlive`, extra headers). The\n * connection closes when the handler resolves, `stream.close()` runs, or the client disconnects\n * (`stream.signal`). Query/body schemas validate exactly as on any other route.\n */\n sse<Path extends string, S extends RouteSchema & {\n sse: StandardSchemaV1;\n }>(path: Path, schema: S, run: (context: Context<Path, S> & Ctx, stream: TypedSSEStream<InferOutput<S[\"sse\"]>>) => void | Promise<void>, init?: SSEInit): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, Response>>, Ctx>;\n post<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n post<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n put<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n put<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n patch<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n patch<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n delete<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n delete<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n tool<Name extends string, S extends {\n description: string;\n input: StandardSchemaV1;\n output?: StandardSchemaV1;\n annotations?: ToolAnnotations;\n }, H extends (input: InferOutput<S[\"input\"]>, ctx: Context & Ctx) => MaybePromise<S[\"output\"] extends StandardSchemaV1 ? InferOutput<S[\"output\"]> : unknown>>(name: Name, config: S, handler: H): Server<AddRoute<R, \"POST\", `/_nifra/tool/${Name}`, RouteInfoFor<`/_nifra/tool/${Name}`, S[\"output\"] extends StandardSchemaV1 ? {\n body: S[\"input\"];\n response: S[\"output\"];\n } : {\n body: S[\"input\"];\n }, OutputOf<H>>>, Ctx>;\n /**\n * Declare an MCP **resource** — read-only data an agent can fetch through `nifra mcp` (app config, a\n * generated document, …). `read` runs in the app process, so capture whatever app state it needs in the\n * closure. `uri` is the MCP resource identifier (e.g. `\"myapp://config\"`). The sibling of {@link tool}\n * for the resource half of MCP.\n */\n resource(uri: string, config: {\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n }, read: McpResourceDescriptor[\"read\"]): Server<R, Ctx>;\n /**\n * Declare an MCP **prompt** — a reusable prompt template an agent can fetch through `nifra mcp`.\n * `handler` receives the caller's arguments and returns the rendered messages.\n */\n prompt(name: string, config: {\n readonly description: string;\n readonly arguments?: readonly PromptArgument[];\n }, handler: McpPromptDescriptor[\"handler\"]): Server<R, Ctx>;\n /** The MCP resources declared via {@link resource} — enumerated by `nifra mcp`. */\n mcpResources(): readonly McpResourceDescriptor[];\n /** The MCP prompts declared via {@link prompt} — enumerated by `nifra mcp`. */\n mcpPrompts(): readonly McpPromptDescriptor[];\n /**\n * Register a **WebSocket** route. The connection upgrades on a `GET` to `path` carrying\n * `Upgrade: websocket`; the optional `handler.upgrade(c)` runs in the request context first and may\n * reject (return a `Response`) or seed per-connection `ws.data`. WebSockets are served by the\n * adapter (`listen()`, `@nifrajs/node`, `@nifrajs/deno`, `toFetchHandler`) — not by bare `app.fetch`, which\n * has no socket (a WS path through `app.fetch` is a normal HTTP response).\n *\n * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined>(path: string, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema>): this;\n /**\n * Broadcast `data` to every WebSocket connection subscribed to `topic` (via `ws.subscribe(topic)`).\n * In-process and **single-instance** (see {@link TopicRegistry}) — a multi-instance deploy must bridge\n * an external fan-out (Redis, a Durable Object) to this. A no-op when nobody is subscribed.\n */\n publish(topic: string, data: string | ArrayBufferView | ArrayBuffer): void;\n private route;\n /**\n * Low-level route registration shared by the inline builder and `implement()`.\n * Captures the server's current `derive`/`decorate` chain into the route — this\n * is the \"compiled\", order-scoped per-route chain.\n */\n register(method: Method, path: string, schema: RouteSchema | undefined, handler: (context: never) => unknown): void;\n /**\n * Enumerate the registered routes (method, path, input schemas), in registration\n * order. Powers `toOpenAPI` and other introspection; the router trie itself no\n * longer holds the original patterns.\n */\n routes(): ReadonlyArray<RouteDescriptor>;\n /**\n * Resolve a `Request` to a `Response` — the whole lifecycle, testable without a port. The\n * optional `platform` carries edge inputs (`env`, `waitUntil`); edge adapters pass it, and\n * Bun/Node/Deno omit it (then `c.env` is `undefined` and `c.waitUntil` runs fire-and-forget).\n */\n fetch(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<Response>;\n private fetchSource;\n /**\n * Like {@link fetch}, but renders a plain-data result **without** building a Web `Response` — the\n * `@nifrajs/node` adapter serializes the returned primitives straight to the socket, skipping the undici\n * `Response` build + body drain (the bulk of the Node bridge cost, measured ≈4µs/req). A handler that\n * returns a `Response`, an error/short-circuit, or any registered `onResponse` hook falls back to the\n * full Web path (`{ kind: \"response\" }`), so behavior is identical — only the common JSON-data case is\n * faster. Same lifecycle as {@link fetch} (body cap, validation, hooks all run); only the final\n * render differs.\n */\n resolveNode(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n resolveNodeSource(source: RequestSource, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n /**\n * Resolve a WebSocket upgrade — the seam every serving adapter uses. Returns `pass` (not a WS\n * upgrade for a registered route → handle as normal HTTP), `reject` (a WS route matched but\n * `upgrade()` rejected, or the path was malformed → return `response`), or `upgrade` (perform the\n * runtime upgrade, then dispatch the native socket's events to `handler`, seeding `ws.data` with\n * `data`). Runs the route's `upgrade(c)` guard in a real request context. Synchronous unless\n * `upgrade()` is async; a throw rejects with a flat 500 (no detail leaked).\n */\n resolveWebSocketUpgrade(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<WebSocketUpgradeOutcome>;\n /** Bun `fetch` when WS routes exist: try a WS upgrade first, else run the normal HTTP lifecycle.\n * `undefined` ⇒ Bun owns the upgraded socket; a `Response` ⇒ a normal reply or a rejected upgrade.\n * (The socket dispatch itself lives in `ws-bun.ts`, loaded via `@nifrajs/core/ws`.) */\n private bunFetchWithWebSocket;\n /**\n * The shared lifecycle, generic over how the final value is rendered: `finalize` turns a handler's\n * result + `set` into the output `T` (`toResponse` → a Web `Response`; `toNodeOutcome` → node-direct\n * primitives), `wrapResponse` lifts an early/error `Response` into that same `T`, and `onTimeout`\n * produces the 503. The Web `fetch` and `resolveNode` are thin callers over this one routing +\n * context + lifecycle implementation — no duplication across the trust boundary.\n */\n private dispatch;\n /**\n * onRequest short-circuit path. Synchronous as long as every hook returns synchronously (the\n * common case — e.g. CORS returning `undefined` for a non-preflight request): an `async` version\n * here put EVERY request of any app with one onRequest hook onto the promise machinery, profiled\n * at ~13% of a realistic request. The first hook that returns a Promise hands the REMAINING\n * hooks to the async continuation; behavior is identical.\n */\n private runWithOnRequest;\n /** Async tail of {@link runWithOnRequest}: applies the first awaited hook's outcome, then runs\n * the remaining hooks (awaiting freely — we're already async here). */\n private continueOnRequest;\n private takeResponseRequest;\n /**\n * Route → build context → run. Synchronous through to the handler for a **bare** route\n * ({@link RouteEntry.bare}), so a sync handler produces its result with zero promise allocations;\n * routes with validation/hooks keep the full async {@link runLifecycle}, unchanged.\n */\n private routeAndRun;\n /** The narrowest bare route: a syntactic `() => ...` handler cannot observe the context argument, so\n * successful requests can skip allocating `RequestContext`. Errors still allocate one for logging. */\n private runContextlessBare;\n private contextlessBareError;\n /**\n * The synchronous fast path for a {@link RouteEntry.bare} route: apply static decorations, call the\n * handler, render the result — **no `await`** unless the handler itself returns a promise. It mirrors\n * the bare slice of {@link runLifecycle} (which a bare route would otherwise no-op through) and shares\n * {@link logRequestError}; a bare route has no `onError` hooks, so error handling is fully synchronous\n * (a thrown `Response` is control flow; anything else is a logged flat 500). This is where nifra skips\n * the per-request async-frame tax — the same win codegen routers get, but without `eval`.\n */\n private runBare;\n /** Bare-route error rendering — identical to {@link runLifecycle}'s catch minus the (absent) onError\n * loop: a thrown `Response` is returned as deliberate control flow; anything else is logged + 500. */\n /**\n * Build a route's fused Web lane (see {@link RouteEntry.fusedWeb}). Composition happens once at\n * registration; the returned closure is what every request to the route runs. Behavior is\n * byte-identical to the generic `runBare`/`runContextlessBare` + `toResponse` pair — same\n * decoration order, same error routing (thrown `Response` = control flow; anything else logs and\n * 500s), same respond semantics (the lifecycle parity suite pins it).\n */\n private buildFusedWeb;\n private bareError;\n private runWithAround;\n private runAround;\n private runBodyOnly;\n /** Validate + run the handler for the bodyOnly path — shared by the inline fast path and the\n * streaming fallback. A method (not per-request closures) so the hot path allocates nothing\n * beyond the one `.then` continuation. */\n private finishBodyOnly;\n private executeHandler;\n private handleValidationErrorRecovery;\n private applyBodyValidation;\n private runQueryOnly;\n /** Validate-result → set `ctx.query` → run handler. A method (not a per-request closure), the\n * query analogue of {@link applyBodyValidation}. */\n private applyQueryValidation;\n /**\n * Thread the response through each global `onResponse` hook. Stays SYNCHRONOUS until a hook\n * actually returns a Promise — an `async` version forced a promise + microtask on EVERY response\n * of any app with an onResponse hook (cors/securityHeaders/etag/timing all use onResponse), the\n * same ~13%/req tax the onRequest walk was de-async'd to avoid. The first async hook hands the\n * rest to {@link continueOnResponse}.\n */\n private applyOnResponse;\n private applyOnResponseAndFinalize;\n private completeResponseFinalization;\n private failResponseFinalization;\n /** Notify terminal observers in order while isolating both sync and async failures. */\n private notifyResponseFinalized;\n /** Async tail of {@link applyOnResponse}: runs the remaining hooks once one has gone async. */\n private continueOnResponse;\n /**\n * Bound the response time. On timeout we abort `ctx.signal` (so cancellation-aware\n * handlers can bail) and return 503; the in-flight work keeps running but its\n * result is discarded — JS can't forcibly cancel a promise.\n */\n private withTimeout;\n /**\n * The post-match lifecycle: validate → derive → beforeHandle → handler → afterHandle, with onError.\n * Generic over the render: a success value goes through `finalize(result, set)` (a Web `Response`, or\n * node-direct primitives); an early/error `Response` (validation, thrown, 500) through `wrapResponse`.\n */\n private runLifecycle;\n private handleLifecycleError;\n /** Log an unhandled request error to the (redacting) logger — shared by {@link runLifecycle} and the\n * bare fast path ({@link bareError}) so both record the same fields. Never throws; never leaks. */\n private logRequestError;\n private readAndValidateBody;\n /**\n * Read the body as text, capped at `maxBodyBytes`. Rejects (`null`) on a\n * `Content-Length` over the cap *before* buffering, and aborts mid-stream once the\n * running byte count exceeds it — so a lying or absent length can't force us to\n * buffer an oversized payload.\n *\n * Fast path: when a non-chunked request carries a `Content-Length` within the cap,\n * a native `req.json()` is already bounded — under HTTP/1.1 + HTTP/2 framing the\n * runtime delivers at most `Content-Length` bytes — so we skip the manual stream\n * loop and a separate text decode. It trusts the wire\n * *framing*, not the header value: nifra only ever receives framed Requests from the\n * runtime's HTTP server, never a hand-built one with a mismatched length. Chunked or\n * length-less bodies fall through to the streaming byte-cap guard below.\n */\n private readBoundedJson;\n /**\n * Start a `Bun.serve` instance bound to `port` (use `0` for an ephemeral port).\n *\n * `reusePort` sets `SO_REUSEPORT` so **multiple processes can bind the same port** and the kernel\n * load-balances connections across them — the standard way to use every core (Bun is\n * single-threaded per process). Spawn one process per core, each calling\n * `app.listen(PORT, { reusePort: true })`; see `examples/cluster.ts`. Every process must opt in,\n * and all of them must be the same app. Linux balances ~evenly; macOS accepts the flag but may\n * favor one socket (fine for dev, measure on Linux for production numbers).\n */\n listen(port: number, options?: {\n readonly reusePort?: boolean;\n }): RunningServer;\n /**\n * Gracefully stop: wait for in-flight requests to finish (up to `drainMs`), then\n * issue a single terminal stop — graceful if everything drained, forced if\n * stragglers remain. Safe to call when not listening.\n *\n * The Bun semantics: poll `pendingRequests` (awaiting\n * `stop()`'s promise drops in-flight requests), and decide graceful-vs-forced in\n * ONE call (Bun can't escalate an already-graceful `stop()` to a forced close).\n * New connections may be accepted during the drain window; in a real deploy the\n * load balancer has already stopped routing here, and `drainMs` bounds it.\n */\n stop({ drainMs }?: {\n drainMs?: number;\n }): Promise<void>;\n private installSignalHandlers;\n}",
|
|
7582
|
+
"signature": "export declare class Server<R extends Registry = EmptyRegistry, Ctx = EmptyContext> {\n private readonly router;\n /** WebSocket routes, matched separately at upgrade time (a GET + `Upgrade: websocket`). */\n private readonly wsRouter;\n private wsRouteCount;\n /** In-process pub/sub backing `ws.subscribe(topic)` + `app.publish(topic, data)` (single-instance).\n * Created by the first `app.ws()` via the `@nifrajs/core/ws` runtime — `undefined` until then, so a\n * no-WebSocket app never constructs (or bundles) it. */\n private topics;\n private readonly routeList;\n private readonly maxBodyBytes;\n private readonly wsMaxPayloadBytes;\n private readonly requestTimeoutMs;\n private readonly acceptInboundDeadlines;\n private readonly maxInboundDeadlineMs;\n private readonly deadlineAdmissionOptions;\n private readonly gracefulSignals;\n /** Capacity-admission gate; `undefined` = off (the request path pays nothing). */\n private readonly capacityGate;\n private readonly onCapabilityUse;\n /** Effect-ledger defaults pinned at construction; per-route `ledgered` copies add route identity. */\n private readonly effectLedger;\n /** App-wide idempotency store (explicit option, else a lazily-created in-process default). */\n private readonly configuredIdempotencyStore;\n private lazyIdempotencyStore;\n private readonly logger;\n /** App-wide validation-error fallback; a route's own `schema.onValidationError` takes precedence. */\n private readonly defaultOnValidationError?;\n private bunServer;\n private readonly derives;\n private readonly decorations;\n private readonly beforeHandleHooks;\n private readonly afterHandleHooks;\n private readonly onErrorHooks;\n private readonly aroundHooks;\n private readonly onRequestHooks;\n private readonly onResponseHooks;\n private readonly onResponseFinalizedHooks;\n private readonly responseRequests;\n /** Names of plugins/middleware already applied via `use` — for idempotent dedupe. */\n private readonly appliedPlugins;\n /** Order-scoped evidence captured by routes registered after an assured plugin. */\n private readonly activeAssurance;\n /** App-wide evidence from global hooks; applies retroactively to every route. */\n private readonly globalAssurance;\n /** App-declared MCP resources / prompts (via {@link resource} / {@link prompt}), read by `nifra mcp`. */\n private readonly mcpResourceList;\n private readonly mcpPromptList;\n /**\n * Every registered route's raw router entry + descriptor, in order — the replay source for\n * {@link merge}. The entry already carries the chains captured at registration (derives,\n * decorations, before/after/around/onError), so a merged route behaves exactly as it did on\n * the server that defined it.\n */\n private readonly rawEntries;\n constructor(options?: ServerOptions);\n /** Add a per-request, computed context extension for subsequent routes. */\n derive<D extends object>(fn: (context: Context & Ctx) => MaybePromise<D>): Server<R, Ctx & D>;\n /** Add a static context value for subsequent routes. */\n decorate<const K extends string, V>(key: K, value: V): Server<R, Ctx & Record<K, V>>;\n /**\n * Run before routing on the raw request. Return a `Response` to short-circuit, or a replacement\n * `Request` to continue routing with a rewritten method/URL/headers. Global.\n */\n onRequest(fn: (req: Request, platform?: Platform<EnvOf<Ctx>>) => MaybePromise<OnRequestResult>): this;\n /** Run after validation, before the handler; a non-`undefined` return short-circuits. Order-scoped. */\n beforeHandle(fn: (context: Context & Ctx) => MaybePromise<unknown>): this;\n /**\n * Wrap the matched route lifecycle for subsequent routes. This is intentionally generic over the\n * route output, so wrappers like async context storage do not force Node's direct JSON path through\n * a Web `Response`. The first registered wrapper is outermost.\n */\n around(fn: <T>(context: Context & Ctx, next: () => MaybePromise<T>) => MaybePromise<T>): this;\n /** Transform the handler's result before it is serialized. Order-scoped. */\n afterHandle(fn: (result: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Handle a thrown error; a non-`undefined` return becomes the response (else the default 500). Order-scoped. */\n onError(fn: (error: unknown, context: Context & Ctx) => MaybePromise<unknown>): this;\n /** Transform every outgoing response — success, error, 404, 405, short-circuit. Global. */\n onResponse(fn: (response: Response, req: Request) => MaybePromise<Response>): this;\n /** Observe the terminal response after all transformations. Observers are ordered and fail-open. */\n onResponseFinalized(fn: (outcome: ResponseFinalization, req: Request) => MaybePromise<void>): this;\n /**\n * Apply a type-**identity** plugin ({@link IdentityPlugin}, from {@link defineIdentityPlugin}) — it\n * registers routes/hooks but doesn't change the types, so this returns `this` with the route registry\n * and context fully intact. This overload exists specifically so a *named* identity plugin (e.g.\n * `@nifrajs/better-auth`) threads the registry: its `& { pluginName }` intersection would otherwise\n * defeat the generic inference of the transforming overload below and collapse the result to `any`.\n */\n use(plugin: IdentityPlugin): this;\n /**\n * Apply a **plugin function** — `(app) => app`, typically built with {@link definePlugin}. It's\n * called with `this` and its result is returned, so an inline plugin's `derive`/`decorate` thread\n * the added context to handlers defined after `use` (the overload is generic over the concrete\n * `this`). A named plugin already applied is skipped (idempotent dedupe).\n */\n use<Out extends AnyServer>(plugin: (app: this) => Out): Out;\n /**\n * Apply a {@link Middleware} bundle — wire each hook it provides to its lifecycle point. Returns\n * `this` (no context-type merging); call it before the routes its `beforeHandle`/`afterHandle`\n * should cover (those are order-scoped; `onRequest`/`onResponse` are global). A named bundle already\n * applied is skipped (idempotent).\n */\n use(mw: Middleware): this;\n get<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n get<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n /**\n * Register a **typed SSE route** — a GET endpoint streaming `text/event-stream` whose event\n * payloads are contracted by `schema.sse`. The handler receives the validated context plus a\n * {@link TypedSSEStream}: `stream.send(event)` is compile-time-checked against the schema and\n * JSON-serialized into the SSE `data:` field. The typed client sees the marker and grows a\n * `.subscribe(onEvent)` for the route with the same payload type — end-to-end typed streaming.\n *\n * const app = server().sse(\"/feed\", { sse: t.object({ id: t.integer(), title: t.string() }) },\n * async (c, stream) => {\n * stream.send({ id: 1, title: \"hello\" }) // typed\n * await waitForDisconnect(stream.signal)\n * },\n * { keepAlive: 15_000 })\n *\n * // client: const off = api.feed.subscribe((post) => console.log(post.title))\n *\n * `init` passes through to the underlying {@link sse} helper (`keepAlive`, extra headers). The\n * connection closes when the handler resolves, `stream.close()` runs, or the client disconnects\n * (`stream.signal`). Query/body schemas validate exactly as on any other route.\n */\n sse<Path extends string, S extends RouteSchema & {\n sse: StandardSchemaV1;\n }>(path: Path, schema: S, run: (context: Context<Path, S> & Ctx, stream: TypedSSEStream<InferOutput<S[\"sse\"]>>) => void | Promise<void>, init?: SSEInit): Server<AddRoute<R, \"GET\", Path, RouteInfoFor<Path, S, Response>>, Ctx>;\n post<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n post<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"POST\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n put<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n put<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PUT\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n patch<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n patch<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"PATCH\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n delete<Path extends string, S extends RouteSchema, H extends Handler<Path, S, Ctx>>(path: Path, schema: S, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, S, OutputOf<H>>>, Ctx>;\n delete<Path extends string, H extends Handler<Path, RouteSchema, Ctx>>(path: Path, handler: H): Server<AddRoute<R, \"DELETE\", Path, RouteInfoFor<Path, Record<never, never>, OutputOf<H>>>, Ctx>;\n tool<Name extends string, S extends {\n description: string;\n input: StandardSchemaV1;\n output?: StandardSchemaV1;\n annotations?: ToolAnnotations;\n }, H extends (input: InferOutput<S[\"input\"]>, ctx: Context & Ctx) => MaybePromise<S[\"output\"] extends StandardSchemaV1 ? InferOutput<S[\"output\"]> : unknown>>(name: Name, config: S, handler: H): Server<AddRoute<R, \"POST\", `/_nifra/tool/${Name}`, RouteInfoFor<`/_nifra/tool/${Name}`, S[\"output\"] extends StandardSchemaV1 ? {\n body: S[\"input\"];\n response: S[\"output\"];\n } : {\n body: S[\"input\"];\n }, OutputOf<H>>>, Ctx>;\n /**\n * Declare an MCP **resource** — read-only data an agent can fetch through `nifra mcp` (app config, a\n * generated document, …). `read` runs in the app process, so capture whatever app state it needs in the\n * closure. `uri` is the MCP resource identifier (e.g. `\"myapp://config\"`). The sibling of {@link tool}\n * for the resource half of MCP.\n */\n resource(uri: string, config: {\n readonly name: string;\n readonly description?: string;\n readonly mimeType?: string;\n }, read: McpResourceDescriptor[\"read\"]): Server<R, Ctx>;\n /**\n * Declare an MCP **prompt** — a reusable prompt template an agent can fetch through `nifra mcp`.\n * `handler` receives the caller's arguments and returns the rendered messages.\n */\n prompt(name: string, config: {\n readonly description: string;\n readonly arguments?: readonly PromptArgument[];\n }, handler: McpPromptDescriptor[\"handler\"]): Server<R, Ctx>;\n /** The MCP resources declared via {@link resource} — enumerated by `nifra mcp`. */\n mcpResources(): readonly McpResourceDescriptor[];\n /** The MCP prompts declared via {@link prompt} — enumerated by `nifra mcp`. */\n mcpPrompts(): readonly McpPromptDescriptor[];\n /**\n * Register a **WebSocket** route. The connection upgrades on a `GET` to `path` carrying\n * `Upgrade: websocket`; the optional `handler.upgrade(c)` runs in the request context first and may\n * reject (return a `Response`) or seed per-connection `ws.data`. WebSockets are served by the\n * adapter (`listen()`, `@nifrajs/node`, `@nifrajs/deno`, `toFetchHandler`) — not by bare `app.fetch`, which\n * has no socket (a WS path through `app.fetch` is a normal HTTP response).\n *\n * app.ws(\"/chat\", { open: (ws) => ws.send(\"hi\"), message: (ws, data) => ws.send(data) })\n */\n ws<Data = unknown, Schema extends StandardSchemaV1 | undefined = undefined>(path: string, handler: WebSocketHandler<Data, EnvOf<Ctx>, Schema>): this;\n /**\n * Broadcast `data` to every WebSocket connection subscribed to `topic` (via `ws.subscribe(topic)`).\n * In-process and **single-instance** (see {@link TopicRegistry}) — a multi-instance deploy must bridge\n * an external fan-out (Redis, a Durable Object) to this. A no-op when nobody is subscribed.\n */\n publish(topic: string, data: string | ArrayBufferView | ArrayBuffer): void;\n private route;\n /**\n * Low-level route registration shared by the inline builder and `implement()`.\n * Captures the server's current `derive`/`decorate` chain into the route — this\n * is the \"compiled\", order-scoped per-route chain.\n */\n register(method: Method, path: string, schema: RouteSchema | undefined, handler: (context: never) => unknown): void;\n /** Resolve a route's declared idempotency into a pinned store + defaults, or `undefined` when off. */\n private resolveIdempotency;\n /** The app-wide idempotency store: the configured one, else a lazily-created shared in-process store. */\n private defaultIdempotencyStore;\n /**\n * Merge another server's routes into this one — the composition escape hatch for large apps.\n *\n * WHY: the fluent chain accumulates one type-alias level per route, and TypeScript resolves\n * that stack in one recursion — a single chain hits TS2589 at ~95 routes. Groups keep every\n * chain short: build each domain (`listings`, `agents`, …) as its own `server()` (its registry\n * resolves independently), then `app.merge(listings).merge(agents)` — each merge adds ONE level\n * regardless of group size. 300+ routes stay fully typed (see many-routes.test-d.ts). The\n * other escape hatch is contract-first `implement()`, whose registry is a single object type.\n *\n * Semantics: merged routes keep the chains captured where they were DEFINED — the group's\n * `derive`/`decorate`/`beforeHandle`/`afterHandle`/`onError`/`around` apply to its routes\n * exactly as they did standalone, so a group wires its own plugins. The group's request-level\n * hooks (`onRequest`/`onResponse`/`onResponseFinalized`) are appended to this server's. This\n * server's route-scoped chains do NOT retroactively wrap merged routes (order-scoped, like\n * routes registered before a `derive`). Fail closed: a path+method collision throws\n * `RouteConfigError` at merge time, and a group with WebSocket routes is refused (register\n * those on the parent).\n */\n merge<R2 extends Registry, Ctx2>(other: Server<R2, Ctx2>): Server<R & R2, Ctx>;\n /**\n * Enumerate the registered routes (method, path, input schemas), in registration\n * order. Powers `toOpenAPI` and other introspection; the router trie itself no\n * longer holds the original patterns.\n */\n routes(): ReadonlyArray<RouteDescriptor>;\n /**\n * Resolve a `Request` to a `Response` — the whole lifecycle, testable without a port. The\n * optional `platform` carries edge inputs (`env`, `waitUntil`); edge adapters pass it, and\n * Bun/Node/Deno omit it (then `c.env` is `undefined` and `c.waitUntil` runs fire-and-forget).\n */\n fetch(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<Response>;\n private fetchSource;\n private fetchSourceInner;\n /** Web response path when Bun already matched the route. The lifecycle and response hooks remain\n * exactly the same as {@link fetchSource}; only portable URL scanning + trie lookup are skipped. */\n private fetchMatched;\n private fetchMatchedInner;\n /**\n * Run `produce` under the capacity gate: admit → run → release exactly once when the response is\n * produced (or the run throws). Only reached when {@link capacityGate} is set, so the off path pays\n * nothing. The slot is held for the duration of handler execution, not the streaming of the body —\n * capacity here bounds concurrent *work*, matching how in-flight is counted.\n */\n private admitGated;\n private runAdmitted;\n /**\n * Like {@link fetch}, but renders a plain-data result **without** building a Web `Response` — the\n * `@nifrajs/node` adapter serializes the returned primitives straight to the socket, skipping the undici\n * `Response` build + body drain (the bulk of the Node bridge cost, measured ≈4µs/req). A handler that\n * returns a `Response`, an error/short-circuit, or any registered `onResponse` hook falls back to the\n * full Web path (`{ kind: \"response\" }`), so behavior is identical — only the common JSON-data case is\n * faster. Same lifecycle as {@link fetch} (body cap, validation, hooks all run); only the final\n * render differs.\n */\n resolveNode(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n resolveNodeSource(source: RequestSource, platform?: Platform<EnvOf<Ctx>>): MaybePromise<NodeServeOutcome>;\n /**\n * Resolve a WebSocket upgrade — the seam every serving adapter uses. Returns `pass` (not a WS\n * upgrade for a registered route → handle as normal HTTP), `reject` (a WS route matched but\n * `upgrade()` rejected, or the path was malformed → return `response`), or `upgrade` (perform the\n * runtime upgrade, then dispatch the native socket's events to `handler`, seeding `ws.data` with\n * `data`). Runs the route's `upgrade(c)` guard in a real request context. Synchronous unless\n * `upgrade()` is async; a throw rejects with a flat 500 (no detail leaked).\n */\n resolveWebSocketUpgrade(req: Request, platform?: Platform<EnvOf<Ctx>>): MaybePromise<WebSocketUpgradeOutcome>;\n /** Bun `fetch` when WS routes exist: try a WS upgrade first, else run the normal HTTP lifecycle.\n * `undefined` ⇒ Bun owns the upgraded socket; a `Response` ⇒ a normal reply or a rejected upgrade.\n * (The socket dispatch itself lives in `ws-bun.ts`, loaded via `@nifrajs/core/ws`.) */\n private bunFetchWithWebSocket;\n /**\n * The shared lifecycle, generic over how the final value is rendered: `finalize` turns a handler's\n * result + `set` into the output `T` (`toResponse` → a Web `Response`; `toNodeOutcome` → node-direct\n * primitives), `wrapResponse` lifts an early/error `Response` into that same `T`, and `onTimeout`\n * produces the 503. The Web `fetch` and `resolveNode` are thin callers over this one routing +\n * context + lifecycle implementation — no duplication across the trust boundary.\n */\n private dispatch;\n /**\n * onRequest short-circuit path. Synchronous as long as every hook returns synchronously (the\n * common case — e.g. CORS returning `undefined` for a non-preflight request): an `async` version\n * here put EVERY request of any app with one onRequest hook onto the promise machinery, profiled\n * at ~13% of a realistic request. The first hook that returns a Promise hands the REMAINING\n * hooks to the async continuation; behavior is identical.\n */\n private runWithOnRequest;\n /** Async tail of {@link runWithOnRequest}: applies the first awaited hook's outcome, then runs\n * the remaining hooks (awaiting freely — we're already async here). */\n private continueOnRequest;\n private takeResponseRequest;\n /**\n * Route → build context → run. Synchronous through to the handler for a **bare** route\n * ({@link RouteEntry.bare}), so a sync handler produces its result with zero promise allocations;\n * routes with validation/hooks keep the full async {@link runLifecycle}, unchanged.\n */\n private routeAndRun;\n /** Run a route that has already been matched by the runtime or Nifra's portable router. */\n private runMatched;\n /**\n * Idempotency dedupe lane. Reads the `Idempotency-Key`, fingerprints the request, and consults the\n * store: a fresh key runs the handler (via {@link runMatchedLanes} with the body buffered) and stores\n * the response; a repeat key replays it without re-running; a key reused with a different body or an\n * in-flight duplicate is rejected. Every branch materializes a `Response`, then adapts to `T` via the\n * caller's `wrapResponse`, so it works on the Web fetch path and the Node-native outcome path alike.\n */\n private runIdempotent;\n /** Run a matched route through its selected execution lane (fused/bare/bodyOnly/queryOnly/lifecycle). */\n private runMatchedLanes;\n /**\n * Seal a ledgered request and deliver the sealed ledger to the sink. An empty ledger (declared\n * capabilities, none exercised) is not delivered — there is nothing to audit. This post-effect\n * ledger is observational: transactional/durable audit belongs in\n * the owned effect transaction, so a sink outage must not turn a successful effect into a retryable\n * 500 that can duplicate it.\n */\n private settleEffectLedger;\n /** The narrowest bare route: a syntactic `() => ...` handler cannot observe the context argument, so\n * successful requests can skip allocating `RequestContext`. Errors still allocate one for logging. */\n private runContextlessBare;\n private contextlessBareError;\n /**\n * The synchronous fast path for a {@link RouteEntry.bare} route: apply static decorations, call the\n * handler, render the result — **no `await`** unless the handler itself returns a promise. It mirrors\n * the bare slice of {@link runLifecycle} (which a bare route would otherwise no-op through) and shares\n * {@link logRequestError}; a bare route has no `onError` hooks, so error handling is fully synchronous\n * (a thrown `Response` is control flow; anything else is a logged flat 500). This is where nifra skips\n * the per-request async-frame tax — the same win codegen routers get, but without `eval`.\n */\n private runBare;\n /** Bare-route error rendering — identical to {@link runLifecycle}'s catch minus the (absent) onError\n * loop: a thrown `Response` is returned as deliberate control flow; anything else is logged + 500. */\n /**\n * Build a route's fused Web lane (see {@link RouteEntry.fusedWeb}). Composition happens once at\n * registration; the returned closure is what every request to the route runs. Behavior is\n * byte-identical to the generic `runBare`/`runContextlessBare` + `toResponse` pair — same\n * decoration order, same error routing (thrown `Response` = control flow; anything else logs and\n * 500s), same respond semantics (the lifecycle parity suite pins it).\n */\n private buildFusedWeb;\n private bareError;\n private runWithAround;\n private runAround;\n private runBodyOnly;\n /** Validate + run the handler for the bodyOnly path — shared by the inline fast path and the\n * streaming fallback. A method (not per-request closures) so the hot path allocates nothing\n * beyond the one `.then` continuation. */\n private finishBodyOnly;\n private executeHandler;\n private handleValidationErrorRecovery;\n private applyBodyValidation;\n private runQueryOnly;\n /** Validate-result → set `ctx.query` → run handler. A method (not a per-request closure), the\n * query analogue of {@link applyBodyValidation}. */\n private applyQueryValidation;\n /**\n * Thread the response through each global `onResponse` hook. Stays SYNCHRONOUS until a hook\n * actually returns a Promise — an `async` version forced a promise + microtask on EVERY response\n * of any app with an onResponse hook (cors/securityHeaders/etag/timing all use onResponse), the\n * same ~13%/req tax the onRequest walk was de-async'd to avoid. The first async hook hands the\n * rest to {@link continueOnResponse}.\n */\n private applyOnResponse;\n private applyOnResponseAndFinalize;\n private completeResponseFinalization;\n private failResponseFinalization;\n /** Notify terminal observers in order while isolating both sync and async failures. */\n private notifyResponseFinalized;\n /** Async tail of {@link applyOnResponse}: runs the remaining hooks once one has gone async. */\n private continueOnResponse;\n /**\n * Bound the response time. On timeout we abort `ctx.signal` (so cancellation-aware\n * handlers can bail) and return 503; the in-flight work keeps running but its\n * result is discarded — JS can't forcibly cancel a promise.\n */\n private withTimeout;\n /**\n * The post-match lifecycle: validate → derive → beforeHandle → handler → afterHandle, with onError.\n * Generic over the render: a success value goes through `finalize(result, set)` (a Web `Response`, or\n * node-direct primitives); an early/error `Response` (validation, thrown, 500) through `wrapResponse`.\n */\n private runLifecycle;\n private handleLifecycleError;\n /** Log an unhandled request error to the (redacting) logger — shared by {@link runLifecycle} and the\n * bare fast path ({@link bareError}) so both record the same fields. Never throws; never leaks. */\n private logRequestError;\n private readAndValidateBody;\n /**\n * Read the body as text, capped at `maxBodyBytes`. Rejects (`null`) on a\n * `Content-Length` over the cap *before* buffering, and aborts mid-stream once the\n * running byte count exceeds it — so a lying or absent length can't force us to\n * buffer an oversized payload.\n *\n * Fast path: when a non-chunked request carries a `Content-Length` within the cap,\n * a native `req.json()` is already bounded — under HTTP/1.1 + HTTP/2 framing the\n * runtime delivers at most `Content-Length` bytes — so we skip the manual stream\n * loop and a separate text decode. It trusts the wire\n * *framing*, not the header value: nifra only ever receives framed Requests from the\n * runtime's HTTP server, never a hand-built one with a mismatched length. Chunked or\n * length-less bodies fall through to the streaming byte-cap guard below.\n */\n private readBoundedJson;\n /** Compile portable route registrations into Bun's native route table. Apps with request-rewrite\n * hooks or WebSockets retain the single portable dispatcher because those features must run before\n * route selection/upgrade. Named wildcards also stay on the fallback until Bun exposes their raw\n * capture semantics; static and `:param` routes take the native lane. */\n private buildBunNativeRoutes;\n /**\n * Start a `Bun.serve` instance bound to `port` (use `0` for an ephemeral port).\n *\n * `reusePort` sets `SO_REUSEPORT` so **multiple processes can bind the same port** and the kernel\n * load-balances connections across them — the standard way to use every core (Bun is\n * single-threaded per process). Spawn one process per core, each calling\n * `app.listen(PORT, { reusePort: true })`; see `examples/cluster.ts`. Every process must opt in,\n * and all of them must be the same app. Linux balances ~evenly; macOS accepts the flag but may\n * favor one socket (fine for dev, measure on Linux for production numbers).\n */\n listen(port: number, options?: {\n readonly reusePort?: boolean;\n }): RunningServer;\n /**\n * Gracefully stop: wait for in-flight requests to finish (up to `drainMs`), then\n * issue a single terminal stop — graceful if everything drained, forced if\n * stragglers remain. Safe to call when not listening.\n *\n * The Bun semantics: poll `pendingRequests` (awaiting\n * `stop()`'s promise drops in-flight requests), and decide graceful-vs-forced in\n * ONE call (Bun can't escalate an already-graceful `stop()` to a forced close).\n * New connections may be accepted during the drain window; in a real deploy the\n * load balancer has already stopped routing here, and `drainMs` bounds it.\n */\n stop({ drainMs }?: {\n drainMs?: number;\n }): Promise<void>;\n private installSignalHandlers;\n}",
|
|
5928
7583
|
"doc": "/**\n * The inline server. Routes are chainable and fully type-inferred. `derive`/\n * `decorate` extend the handler context (`Ctx`) for routes defined *after* them,\n * with full types; `Ctx` is server-only and never touches the client registry.\n *\n * app.decorate(\"db\", db).derive((c) => ({ user: auth(c) }))\n * .get(\"/me\", (c) => c.user) // c.user + c.db are typed\n */"
|
|
5929
7584
|
},
|
|
5930
7585
|
{
|
|
@@ -5972,7 +7627,7 @@
|
|
|
5972
7627
|
"name": "ServerOptions",
|
|
5973
7628
|
"kind": "interface",
|
|
5974
7629
|
"package": "@nifrajs/core",
|
|
5975
|
-
"signature": "export interface ServerOptions {\n /**\n * Max request body size (bytes), enforced **only when a route declares a body schema** — the cap\n * lives in the schema-validated read path. Default 1_000_000.\n *\n * A route WITHOUT a body schema (raw body, file upload, BYO-validation) that reads `c.req` directly\n * is not auto-bounded — use **`c.boundedBody(maxBytes?)`** / **`c.boundedJson(maxBytes?)`**, which\n * apply this same cap (override per route by passing `maxBytes` — larger for an upload endpoint,\n * smaller to tighten one).\n */\n readonly maxBodyBytes?: number;\n /** Max inbound WebSocket message size (bytes) when `listen()`ing on Bun — frames over this are rejected\n * by the runtime before reaching your handler (so a huge frame can't be JSON-parsed into memory).\n * Default: `maxBodyBytes` (1 MB). */\n readonly wsMaxPayloadBytes?: number;\n /** Per-request timeout (ms): a slower request gets a 503 and `ctx.signal` aborts. 0 disables (default). */\n readonly requestTimeoutMs?: number;\n /** When `listen()`ing, install SIGTERM/SIGINT handlers that gracefully `stop()`. Default false. */\n readonly gracefulSignals?: boolean;\n /** Structured logger for framework events (redacts secrets). Default: JSON to stderr. */\n readonly logger?: Logger;\n /**\n * App-wide fallback fired when a route **without its own `onValidationError`** fails body/query\n * validation. Same contract as the per-route hook (`(issues, ctx, kind) => Response | repaired-value |\n * undefined`): a route's own hook takes precedence, and a route can fall through to the plain `422` by\n * returning `undefined`. Use it for one app-wide error envelope (like tRPC's `errorFormatter` /\n * Fastify's `setErrorHandler`) instead of repeating a formatter per route.\n */\n readonly onValidationError?: RouteSchema[\"onValidationError\"];\n}"
|
|
7630
|
+
"signature": "export interface ServerOptions {\n /**\n * Max request body size (bytes), enforced **only when a route declares a body schema** — the cap\n * lives in the schema-validated read path. Default 1_000_000.\n *\n * A route WITHOUT a body schema (raw body, file upload, BYO-validation) that reads `c.req` directly\n * is not auto-bounded — use **`c.boundedBody(maxBytes?)`** / **`c.boundedJson(maxBytes?)`**, which\n * apply this same cap (override per route by passing `maxBytes` — larger for an upload endpoint,\n * smaller to tighten one).\n */\n readonly maxBodyBytes?: number;\n /** Max inbound WebSocket message size (bytes) when `listen()`ing on Bun — frames over this are rejected\n * by the runtime before reaching your handler (so a huge frame can't be JSON-parsed into memory).\n * Default: `maxBodyBytes` (1 MB). */\n readonly wsMaxPayloadBytes?: number;\n /** Per-request timeout (ms): a slower request gets a 503 and `ctx.signal` aborts. 0 disables (default). */\n readonly requestTimeoutMs?: number;\n /**\n * Admit the public `x-nifra-deadline` header and let it shorten local work. Disabled by default:\n * services that participate in trusted cross-service deadline propagation opt in explicitly,\n * while ordinary/public HTTP routes pay no header-admission tax and ignore hostile client values.\n */\n readonly acceptInboundDeadlines?: boolean;\n /**\n * Maximum time accepted from an inbound `x-nifra-deadline`, in milliseconds. An incoming absolute\n * deadline may shorten this cap (and `requestTimeoutMs`, when configured), never extend it.\n * Default 30_000; applies only when `acceptInboundDeadlines` is enabled and the header is present.\n */\n readonly maxInboundDeadlineMs?: number;\n /** When `listen()`ing, install SIGTERM/SIGINT handlers that gracefully `stop()`. Default false. */\n readonly gracefulSignals?: boolean;\n /**\n * Capacity-admission gate (see {@link AdmissionController}). Bounds concurrent in-flight work so a\n * healthy instance sheds load (`429` + `Retry-After`) instead of accepting more than it can finish.\n * Off by default. Enabling it disables the fused native-route fast path (requests route through the\n * shared matched lane where the gate runs); when unset, the request path pays nothing.\n */\n readonly admission?: AdmissionController;\n /**\n * Optional token-only observation hook called by `useCapability(c, id)`. It receives no request,\n * parameters, body, tenant, or values. Routes without capability declarations keep the old hot path.\n */\n readonly onCapabilityUse?: (event: CapabilityUseEvent) => void;\n /**\n * Enable the per-request effect ledger. Each route that declares `schema.capabilities` gets a\n * bounded, token-only ledger; `useCapability(c, id, …)` appends one entry per effect, and the sink\n * receives the sealed ledger when the response settles (only when it recorded entries). Token-only\n * by construction — capability ids, phases, counters, digests; never payloads, values, or the\n * concrete URL (the route *pattern* is recorded). Enabling it moves capability-declaring routes off\n * the fused fast path (they need a per-request context + a settle step); all other routes are\n * unaffected, and when unset the request path pays nothing.\n */\n readonly effectLedger?: EffectLedgerOptions;\n /**\n * Default store backing routes that declare `schema.idempotency` without their own `store`. Defaults\n * to a shared in-process {@link MemoryIdempotencyStore} (created lazily on first idempotent route).\n * Inject a durable store here to make request-scoped dedupe survive restarts app-wide.\n */\n readonly idempotencyStore?: IdempotencyStore;\n /** Structured logger for framework events (redacts secrets). Default: JSON to stderr. */\n readonly logger?: Logger;\n /**\n * App-wide fallback fired when a route **without its own `onValidationError`** fails body/query\n * validation. Same contract as the per-route hook (`(issues, ctx, kind) => Response | repaired-value |\n * undefined`): a route's own hook takes precedence, and a route can fall through to the plain `422` by\n * returning `undefined`. Use it for one app-wide error envelope (like tRPC's `errorFormatter` /\n * Fastify's `setErrorHandler`) instead of repeating a formatter per route.\n */\n readonly onValidationError?: RouteSchema[\"onValidationError\"];\n}"
|
|
5976
7631
|
},
|
|
5977
7632
|
{
|
|
5978
7633
|
"name": "ServeStaticOptions",
|
|
@@ -6035,6 +7690,13 @@
|
|
|
6035
7690
|
"signature": "export interface SessionStore {\n /** The record for `id`, or `undefined` on a miss. */\n get(id: string): Promise<SessionRecord | undefined>;\n /** Store (or overwrite) the record for `id`. */\n set(id: string, record: SessionRecord): Promise<void>;\n /** Drop `id` (logout / regeneration). A no-op if absent. */\n delete(id: string): Promise<void>;\n}",
|
|
6036
7691
|
"doc": "/**\n * Pluggable session backend (store mode). Async so a network store (KV/Redis) fits the same shape.\n * **Production needs a shared/durable store** so sessions hold across instances — {@link MemorySessionStore}\n * prod-guards against the per-instance footgun.\n */"
|
|
6037
7692
|
},
|
|
7693
|
+
{
|
|
7694
|
+
"name": "setBrowserNavigate",
|
|
7695
|
+
"kind": "function",
|
|
7696
|
+
"package": "@nifrajs/web",
|
|
7697
|
+
"signature": "export declare function setBrowserNavigate(navigate: BrowserNavigate | undefined): void;",
|
|
7698
|
+
"doc": "/** Register (or clear, with `undefined`) the browser navigate — called by `installHistory`. Not for\n * app use. */"
|
|
7699
|
+
},
|
|
6038
7700
|
{
|
|
6039
7701
|
"name": "setMountedRouter",
|
|
6040
7702
|
"kind": "function",
|
|
@@ -6076,6 +7738,13 @@
|
|
|
6076
7738
|
"package": "@nifrajs/cache",
|
|
6077
7739
|
"signature": "export interface SetOptions {\n /** Time-to-live (ms) before the value goes stale. Default: the cache's `defaultTtlMs`. */\n readonly ttlMs?: number;\n /** Extra ms past TTL during which the stale value is served while a background refresh runs. Default 0. */\n readonly swrMs?: number;\n /** Tags for group invalidation via `invalidateTag`. */\n readonly tags?: readonly string[];\n}"
|
|
6078
7740
|
},
|
|
7741
|
+
{
|
|
7742
|
+
"name": "SetSearchParams",
|
|
7743
|
+
"kind": "type",
|
|
7744
|
+
"package": "@nifrajs/web-react",
|
|
7745
|
+
"signature": "export type SetSearchParams = (next: SearchParamsInit | ((prev: URLSearchParams) => SearchParamsInit), options?: NavigateOptions) => void;",
|
|
7746
|
+
"doc": "/** Set the query string. Accepts a `URLSearchParams`, a record, a raw string, or an updater of the\n * current params; navigates to the same pathname with the new query (push, or replace via options). */"
|
|
7747
|
+
},
|
|
6079
7748
|
{
|
|
6080
7749
|
"name": "setWsRuntime",
|
|
6081
7750
|
"kind": "function",
|
|
@@ -6089,6 +7758,13 @@
|
|
|
6089
7758
|
"package": "@nifrajs/middleware",
|
|
6090
7759
|
"signature": "export declare function sha256(input: string | Uint8Array): Promise<Uint8Array<ArrayBuffer>>;"
|
|
6091
7760
|
},
|
|
7761
|
+
{
|
|
7762
|
+
"name": "shapeOf",
|
|
7763
|
+
"kind": "function",
|
|
7764
|
+
"package": "@nifrajs/testing",
|
|
7765
|
+
"signature": "export declare function shapeOf(value: unknown): unknown;",
|
|
7766
|
+
"doc": "/** A stable structural fingerprint: keys + value *types*, not values. Used for the optional shape check. */"
|
|
7767
|
+
},
|
|
6092
7768
|
{
|
|
6093
7769
|
"name": "sharpImageBackend",
|
|
6094
7770
|
"kind": "function",
|
|
@@ -6103,6 +7779,13 @@
|
|
|
6103
7779
|
"signature": "export type SharpLike = (input: Uint8Array) => SharpInstance;",
|
|
6104
7780
|
"doc": "/** The slice of a [sharp](https://sharp.pixelplumbing.com) instance this backend uses. Declared\n * structurally so `@nifrajs/image` has no dependency on sharp — pass your own `sharp` import. */"
|
|
6105
7781
|
},
|
|
7782
|
+
{
|
|
7783
|
+
"name": "ShedReason",
|
|
7784
|
+
"kind": "type",
|
|
7785
|
+
"package": "@nifrajs/middleware",
|
|
7786
|
+
"signature": "export type ShedReason = \"inflight\" | \"loop-lag\" | \"queue-timeout\" | \"policy\" | \"cancelled\";",
|
|
7787
|
+
"doc": "/**\n * Adaptive capacity admission. Rate limiting bounds request *frequency* and `@nifrajs/budget` bounds\n * request *duration*; neither stops a healthy instance from accepting more *concurrent* work than it\n * can finish. This gate admits on live capacity evidence — in-flight count + event-loop lag — briefly\n * queues at the edge, and sheds the rest with `429` + `Retry-After`, so p99 stays bounded under load\n * instead of collapsing.\n *\n * Public mechanics (in-flight + loop lag) know nothing about tenants. An application-supplied {@link AdmissionPolicy}\n * hook layers tenant priority and reserved capacity on top without leaking\n * those concerns into the OSS core.\n *\n * Wire it as the server's `admission` option (NOT an `onRequest` hook — a hook disables the native\n * route table). Off by default: when unset, the request path is untouched.\n */"
|
|
7788
|
+
},
|
|
6106
7789
|
{
|
|
6107
7790
|
"name": "signal",
|
|
6108
7791
|
"kind": "function",
|
|
@@ -6164,6 +7847,13 @@
|
|
|
6164
7847
|
"package": "@nifrajs/image",
|
|
6165
7848
|
"signature": "export interface SignImageUrlOptions {\n /** HMAC secret — must match the handler's `signing.secret`. */\n readonly secret: string;\n /** Seconds until the URL expires (adds `&exp=`). Omit for a stable, cacheable-forever signed URL. */\n readonly expiresIn?: number;\n}"
|
|
6166
7849
|
},
|
|
7850
|
+
{
|
|
7851
|
+
"name": "signNifraManifest",
|
|
7852
|
+
"kind": "function",
|
|
7853
|
+
"package": "@nifrajs/core",
|
|
7854
|
+
"signature": "export declare function signNifraManifest(manifest: NifraManifest, signer: NifraManifestSigner): Promise<NifraManifestSignature>;",
|
|
7855
|
+
"doc": "/** Sign without handling private keys: the operator-supplied signer may call KMS/HSM/local WebCrypto. */"
|
|
7856
|
+
},
|
|
6167
7857
|
{
|
|
6168
7858
|
"name": "signValue",
|
|
6169
7859
|
"kind": "function",
|
|
@@ -6211,6 +7901,19 @@
|
|
|
6211
7901
|
"signature": "export interface SizeReport {\n /** Per-chunk sizes, sorted biggest gzip first (the regression you want to see at the top). */\n readonly chunks: readonly ChunkSize[];\n /** Sum of every chunk's raw bytes. */\n readonly totalBytes: number;\n /** Sum of every chunk's gzip bytes. */\n readonly totalGzip: number;\n}",
|
|
6212
7902
|
"doc": "/** A whole build's size report — every chunk (largest first) + the totals. */"
|
|
6213
7903
|
},
|
|
7904
|
+
{
|
|
7905
|
+
"name": "SkippedRoute",
|
|
7906
|
+
"kind": "interface",
|
|
7907
|
+
"package": "@nifrajs/core",
|
|
7908
|
+
"signature": "export interface SkippedRoute {\n readonly method: string;\n readonly path: string;\n readonly reason: string;\n}"
|
|
7909
|
+
},
|
|
7910
|
+
{
|
|
7911
|
+
"name": "snapshotCapabilities",
|
|
7912
|
+
"kind": "function",
|
|
7913
|
+
"package": "@nifrajs/core",
|
|
7914
|
+
"signature": "export declare function snapshotCapabilities(report: CapabilityAssuranceReport): CapabilitySnapshot;",
|
|
7915
|
+
"doc": "/** Deterministic, PII-free lockfile material. */"
|
|
7916
|
+
},
|
|
6214
7917
|
{
|
|
6215
7918
|
"name": "SnapshotFile",
|
|
6216
7919
|
"kind": "interface",
|
|
@@ -6527,6 +8230,13 @@
|
|
|
6527
8230
|
"signature": "export interface StoredJob {\n readonly id: string;\n readonly name: string;\n readonly payload: unknown;\n readonly attempt: number;\n readonly maxAttempts: number;\n}",
|
|
6528
8231
|
"doc": "/** A job as handed back by {@link JobStore.lease}. `attempt` is the count of PRIOR attempts (0 the first time). */"
|
|
6529
8232
|
},
|
|
8233
|
+
{
|
|
8234
|
+
"name": "StoredResponse",
|
|
8235
|
+
"kind": "interface",
|
|
8236
|
+
"package": "@nifrajs/core",
|
|
8237
|
+
"signature": "export interface StoredResponse {\n readonly status: number;\n readonly headers: readonly (readonly [string, string])[];\n /** Base64-encoded response body; `\"\"` when the response had no body. */\n readonly body: string;\n}",
|
|
8238
|
+
"doc": "/** A serialized response held by a store. `body` is base64 so binary payloads round-trip intact. */"
|
|
8239
|
+
},
|
|
6530
8240
|
{
|
|
6531
8241
|
"name": "string",
|
|
6532
8242
|
"kind": "function",
|
|
@@ -6924,6 +8634,13 @@
|
|
|
6924
8634
|
"signature": "export declare function uiResourceMeta(uri: string): Record<string, unknown>;",
|
|
6925
8635
|
"doc": "/** The MCP Apps `_meta.ui.resourceUri` link, emitted nested (current spec) AND flat (the deprecated\n * `ui/resourceUri`, still read by some hosts) so a tool renders across the transition. */"
|
|
6926
8636
|
},
|
|
8637
|
+
{
|
|
8638
|
+
"name": "UNBOUNDED_DEADLINE",
|
|
8639
|
+
"kind": "const",
|
|
8640
|
+
"package": "@nifrajs/core",
|
|
8641
|
+
"signature": "export declare const UNBOUNDED_DEADLINE: number;",
|
|
8642
|
+
"doc": "/** Sentinel used only for an unbounded local budget. It is never written to the wire. */"
|
|
8643
|
+
},
|
|
6927
8644
|
{
|
|
6928
8645
|
"name": "unsignValue",
|
|
6929
8646
|
"kind": "function",
|
|
@@ -6938,6 +8655,24 @@
|
|
|
6938
8655
|
"signature": "export declare class UnsupportedMockSchemaError extends Error {\n readonly keyword: string;\n constructor(keyword: string, message: string);\n}",
|
|
6939
8656
|
"doc": "/**\n * `@nifrajs/mock` — contract-based mock server.\n *\n * Reads a Nifra app's registered routes and their Standard Schema / JSON Schema\n * response definitions, then generates fake responses from supported JSON Schema keywords. Use it\n * for frontend-first development, agent testing, or CI smoke tests.\n */"
|
|
6940
8657
|
},
|
|
8658
|
+
{
|
|
8659
|
+
"name": "UpgradeOptions",
|
|
8660
|
+
"kind": "interface",
|
|
8661
|
+
"package": "@nifrajs/cli",
|
|
8662
|
+
"signature": "export interface UpgradeOptions {\n /** Target version, e.g. \"1.8.0\". Required unless `list` is set. */\n readonly version?: string;\n /** Apply the edits. Without it, the run is a dry-run that only prints the plan. */\n readonly write?: boolean;\n /** Emit a machine-readable plan/result instead of the human report. */\n readonly json?: boolean;\n /** Print the available target versions and return. */\n readonly list?: boolean;\n /** After `--write`, run `nifra check` and fail the command if it fails. Default true. */\n readonly verify?: boolean;\n}"
|
|
8663
|
+
},
|
|
8664
|
+
{
|
|
8665
|
+
"name": "UpgradePlan",
|
|
8666
|
+
"kind": "interface",
|
|
8667
|
+
"package": "@nifrajs/cli",
|
|
8668
|
+
"signature": "export interface UpgradePlan {\n readonly version: string;\n readonly pins: readonly PinChange[];\n readonly importMoves: readonly ImportChange[];\n readonly notes: readonly string[];\n}"
|
|
8669
|
+
},
|
|
8670
|
+
{
|
|
8671
|
+
"name": "UpgradeRecipe",
|
|
8672
|
+
"kind": "interface",
|
|
8673
|
+
"package": "@nifrajs/cli",
|
|
8674
|
+
"signature": "export interface UpgradeRecipe {\n readonly version: string;\n readonly pins: readonly PinRule[];\n readonly importMoves: readonly ImportMove[];\n /** Human notes printed after the plan — e.g. structural changes the runner deliberately can't do. */\n readonly notes?: readonly string[];\n}"
|
|
8675
|
+
},
|
|
6941
8676
|
{
|
|
6942
8677
|
"name": "UploadResult",
|
|
6943
8678
|
"kind": "type",
|
|
@@ -6958,6 +8693,20 @@
|
|
|
6958
8693
|
"package": "@nifrajs/core",
|
|
6959
8694
|
"signature": "export declare function urlPartsOf(url: string): UrlParts;"
|
|
6960
8695
|
},
|
|
8696
|
+
{
|
|
8697
|
+
"name": "useCapability",
|
|
8698
|
+
"kind": "function",
|
|
8699
|
+
"package": "@nifrajs/core",
|
|
8700
|
+
"signature": "export declare function useCapability(context: object, capability: string, options?: UseCapabilityOptions): void;",
|
|
8701
|
+
"doc": "/**\n * Runtime effect beacon for owned adapters. It fails closed when the route omitted the capability or\n * when no route guard is present. Static provenance is still required: code can bypass a beacon.\n * When the server enabled the effect ledger, each beacon call also appends one token-only entry.\n */"
|
|
8702
|
+
},
|
|
8703
|
+
{
|
|
8704
|
+
"name": "UseCapabilityOptions",
|
|
8705
|
+
"kind": "interface",
|
|
8706
|
+
"package": "@nifrajs/core",
|
|
8707
|
+
"signature": "export interface UseCapabilityOptions {\n /** Adapter/resource token recorded on the ledger entry (`repo:orders`). */\n readonly target?: string;\n /** Dimensionless resource counters recorded on the ledger entry. */\n readonly cost?: EffectCost;\n /** Keyed payload digest (see `computeEffectDigest`). */\n readonly digest?: string;\n}",
|
|
8708
|
+
"doc": "/**\n * Optional effect-ledger fields for one `useCapability` beacon. Token-only by design: an adapter\n * names *what* it touched and *how much resource* it used — never the value it read or wrote.\n */"
|
|
8709
|
+
},
|
|
6961
8710
|
{
|
|
6962
8711
|
"name": "useFetcher",
|
|
6963
8712
|
"kind": "function",
|
|
@@ -7021,6 +8770,34 @@
|
|
|
7021
8770
|
"signature": "export declare function useFetchers(): Readonly<ShallowRef<readonly Fetcher[]>>;",
|
|
7022
8771
|
"doc": "/**\n * Subscribe to the whole live fetcher collection — for a global busy view (e.g. \"3 saving…\"). Read\n * each entry's `.snapshot()` for its state. The ref updates whenever any fetcher transitions or a new\n * one is created.\n */"
|
|
7023
8772
|
},
|
|
8773
|
+
{
|
|
8774
|
+
"name": "useInfiniteQuery",
|
|
8775
|
+
"kind": "function",
|
|
8776
|
+
"package": "@nifrajs/web-react",
|
|
8777
|
+
"signature": "export declare function useInfiniteQuery<T, P>(key: unknown, fn: (pageParam: P) => Promise<T>, options: UseInfiniteQueryOptions<T, P>): UseInfiniteQueryResult<T, P>;",
|
|
8778
|
+
"doc": "/**\n * Subscribe to a paged (infinite-scroll) query. Returns the accumulated `data.pages` plus\n * `fetchNextPage`/`fetchPreviousPage`/`hasNextPage`/`hasPreviousPage`. Fetches the first page on mount.\n * SSR-idle unless a `QueryClientProvider` supplies a hydrated client.\n */"
|
|
8779
|
+
},
|
|
8780
|
+
{
|
|
8781
|
+
"name": "UseInfiniteQueryOptions",
|
|
8782
|
+
"kind": "interface",
|
|
8783
|
+
"package": "@nifrajs/web-react",
|
|
8784
|
+
"signature": "export interface UseInfiniteQueryOptions<T, P> extends InfiniteQueryOptions<T, P> {\n readonly enabled?: boolean;\n}",
|
|
8785
|
+
"doc": "/** Options for {@link useInfiniteQuery} — the engine's {@link InfiniteQueryOptions} plus `enabled`. */"
|
|
8786
|
+
},
|
|
8787
|
+
{
|
|
8788
|
+
"name": "UseInfiniteQueryResult",
|
|
8789
|
+
"kind": "interface",
|
|
8790
|
+
"package": "@nifrajs/web-react",
|
|
8791
|
+
"signature": "export interface UseInfiniteQueryResult<T, P> extends QueryState<InfiniteData<T, P>> {\n readonly isPending: boolean;\n readonly isError: boolean;\n readonly isSuccess: boolean;\n readonly fetchNextPage: () => Promise<InfiniteData<T, P>>;\n readonly fetchPreviousPage: () => Promise<InfiniteData<T, P>>;\n readonly hasNextPage: boolean;\n readonly hasPreviousPage: boolean;\n readonly refetch: () => Promise<InfiniteData<T, P>>;\n}",
|
|
8792
|
+
"doc": "/** An infinite query's reactive state + paging controls. */"
|
|
8793
|
+
},
|
|
8794
|
+
{
|
|
8795
|
+
"name": "useLocation",
|
|
8796
|
+
"kind": "function",
|
|
8797
|
+
"package": "@nifrajs/web-react",
|
|
8798
|
+
"signature": "export declare function useLocation(): Location;",
|
|
8799
|
+
"doc": "/** The current {@link Location} (`pathname`/`search`/`hash`), derived from the router context. */"
|
|
8800
|
+
},
|
|
7024
8801
|
{
|
|
7025
8802
|
"name": "useMDXComponents",
|
|
7026
8803
|
"kind": "function",
|
|
@@ -7028,6 +8805,34 @@
|
|
|
7028
8805
|
"signature": "export declare function useMDXComponents(): Record<string, (props: Record<string, unknown>) => unknown>;",
|
|
7029
8806
|
"doc": "/** Returns the intrinsic-element → Solid-component map MDX content uses. Merge in your own overrides by\n * passing `components` to the MDX content component (they take precedence). */"
|
|
7030
8807
|
},
|
|
8808
|
+
{
|
|
8809
|
+
"name": "useMutation",
|
|
8810
|
+
"kind": "function",
|
|
8811
|
+
"package": "@nifrajs/web-react",
|
|
8812
|
+
"signature": "export declare function useMutation<TData, TVariables = void>(fn: (variables: TVariables) => Promise<TData>, callbacks?: MutationCallbacks<TData, TVariables>): UseMutationResult<TData, TVariables>;",
|
|
8813
|
+
"doc": "/**\n * A mutation hook (create/update/delete). Returns `{ mutate, mutateAsync, data, error, variables, isIdle,\n * isPending, isError, isSuccess, reset }`. Invalidate affected queries from `onSuccess` via\n * `useQueryClient().invalidateQueries(...)`. The handle is stable across renders; the latest `fn`/\n * callbacks re-bind each render.\n */"
|
|
8814
|
+
},
|
|
8815
|
+
{
|
|
8816
|
+
"name": "UseMutationResult",
|
|
8817
|
+
"kind": "interface",
|
|
8818
|
+
"package": "@nifrajs/web-react",
|
|
8819
|
+
"signature": "export interface UseMutationResult<TData, TVariables> extends MutationState<TData, TVariables> {\n readonly isIdle: boolean;\n readonly isPending: boolean;\n readonly isError: boolean;\n readonly isSuccess: boolean;\n /** Fire-and-forget: runs the mutation and swallows rejection (read `error`/`isError` for failures). */\n readonly mutate: (variables: TVariables) => void;\n /** Run the mutation and return the promise (rejects on failure) — for `await`. */\n readonly mutateAsync: (variables: TVariables) => Promise<TData>;\n /** Reset back to idle. */\n readonly reset: () => void;\n}",
|
|
8820
|
+
"doc": "/** A mutation's reactive state + imperative controls (the TanStack `useMutation` shape). */"
|
|
8821
|
+
},
|
|
8822
|
+
{
|
|
8823
|
+
"name": "useNavigate",
|
|
8824
|
+
"kind": "function",
|
|
8825
|
+
"package": "@nifrajs/web-react",
|
|
8826
|
+
"signature": "export declare function useNavigate(): NavigateFunction;",
|
|
8827
|
+
"doc": "/** Get the {@link NavigateFunction}. Stable across renders; resolves the browser navigate at call time\n * (so it works as soon as `installHistory` has run, and no-ops before then / on the server). */"
|
|
8828
|
+
},
|
|
8829
|
+
{
|
|
8830
|
+
"name": "useParams",
|
|
8831
|
+
"kind": "function",
|
|
8832
|
+
"package": "@nifrajs/web-react",
|
|
8833
|
+
"signature": "export declare function useParams<T extends Record<string, string | undefined> = Record<string, string>>(): Readonly<T>;",
|
|
8834
|
+
"doc": "/**\n * The matched route's decoded path params — `/users/:id` on `/users/7` → `{ id: \"7\" }`. SSR-correct:\n * `compose` provides the same value server-side (from the request match) and client-side (from router\n * state), so a param rendered into markup doesn't flash on hydration.\n */"
|
|
8835
|
+
},
|
|
7031
8836
|
{
|
|
7032
8837
|
"name": "useQuery",
|
|
7033
8838
|
"kind": "function",
|
|
@@ -7039,8 +8844,8 @@
|
|
|
7039
8844
|
"name": "useQuery",
|
|
7040
8845
|
"kind": "function",
|
|
7041
8846
|
"package": "@nifrajs/web-react",
|
|
7042
|
-
"signature": "export declare function useQuery<T>(key: unknown, fn: () => Promise<T
|
|
7043
|
-
"doc": "/**\n * Subscribe to the keyed query for `key`, fetched via `fn`. Returns `{ status, data, error, isFetching,\n * updatedAt, isPending, refetch }`. Concurrent `useQuery`s with the same key share one cache entry
|
|
8847
|
+
"signature": "export declare function useQuery<T>(key: unknown, fn: () => Promise<T>, options?: UseQueryOptions): UseQueryResult<T>;",
|
|
8848
|
+
"doc": "/**\n * Subscribe to the keyed query for `key`, fetched via `fn`. Returns `{ status, data, error, isFetching,\n * updatedAt, isPending, isError, isSuccess, refetch }`. Concurrent `useQuery`s with the same key share\n * one cache entry + one in-flight fetch (dedup). Fetches on mount and when the key changes; `enabled:\n * false` keeps it idle (dependent queries). SSR-idle unless a `QueryClientProvider` supplies a hydrated\n * client.\n */"
|
|
7044
8849
|
},
|
|
7045
8850
|
{
|
|
7046
8851
|
"name": "useQuery",
|
|
@@ -7067,8 +8872,8 @@
|
|
|
7067
8872
|
"name": "useQueryClient",
|
|
7068
8873
|
"kind": "function",
|
|
7069
8874
|
"package": "@nifrajs/web-react",
|
|
7070
|
-
"signature": "export declare function useQueryClient():
|
|
7071
|
-
"doc": "/**
|
|
8875
|
+
"signature": "export declare function useQueryClient(): QueryClient;",
|
|
8876
|
+
"doc": "/** The active {@link QueryClient}: a `QueryClientProvider`'s client, else the client-side singleton,\n * else a no-op (server / pre-hydration). Use it to `invalidateQueries`/`setQueryData`/`prefetchQuery`. */"
|
|
7072
8877
|
},
|
|
7073
8878
|
{
|
|
7074
8879
|
"name": "useQueryClient",
|
|
@@ -7091,6 +8896,13 @@
|
|
|
7091
8896
|
"signature": "export declare function useQueryClient(): Pick<QueryClient, \"invalidateQueries\">;",
|
|
7092
8897
|
"doc": "/** Access the query client to imperatively `invalidateQueries(keyOrPrefix)` (e.g. after a mutation). */"
|
|
7093
8898
|
},
|
|
8899
|
+
{
|
|
8900
|
+
"name": "UseQueryOptions",
|
|
8901
|
+
"kind": "interface",
|
|
8902
|
+
"package": "@nifrajs/web-react",
|
|
8903
|
+
"signature": "export interface UseQueryOptions extends QueryOptions {\n /** When `false`, don't fetch (the query stays idle) — for dependent queries. Default `true`. */\n readonly enabled?: boolean;\n}",
|
|
8904
|
+
"doc": "/** Options for {@link useQuery}. */"
|
|
8905
|
+
},
|
|
7094
8906
|
{
|
|
7095
8907
|
"name": "UseQueryResult",
|
|
7096
8908
|
"kind": "interface",
|
|
@@ -7102,7 +8914,7 @@
|
|
|
7102
8914
|
"name": "UseQueryResult",
|
|
7103
8915
|
"kind": "interface",
|
|
7104
8916
|
"package": "@nifrajs/web-react",
|
|
7105
|
-
"signature": "export interface UseQueryResult<T> extends QueryState<T> {\n /** `status === \"pending\"` — no data yet (initial load). */\n readonly isPending: boolean;\n /** Force a refetch (ignores `staleTime`). */\n readonly refetch: () => Promise<T>;\n}",
|
|
8917
|
+
"signature": "export interface UseQueryResult<T> extends QueryState<T> {\n /** `status === \"pending\"` — no data yet (initial load). */\n readonly isPending: boolean;\n /** `status === \"error\"`. */\n readonly isError: boolean;\n /** `status === \"success\"`. */\n readonly isSuccess: boolean;\n /** Force a refetch (ignores `staleTime`). */\n readonly refetch: () => Promise<T>;\n}",
|
|
7106
8918
|
"doc": "/** A query's reactive {@link QueryState} plus `isPending` + `refetch`. */"
|
|
7107
8919
|
},
|
|
7108
8920
|
{
|
|
@@ -7112,6 +8924,13 @@
|
|
|
7112
8924
|
"signature": "export interface UseQueryResult<T> {\n readonly state: Readonly<ShallowRef<QueryState<T>>>;\n /** Force a refetch (ignores `staleTime`). */\n readonly refetch: () => Promise<T>;\n}",
|
|
7113
8925
|
"doc": "/** A query's reactive {@link QueryState} (read `.value`) plus `refetch`. */"
|
|
7114
8926
|
},
|
|
8927
|
+
{
|
|
8928
|
+
"name": "useSearchParams",
|
|
8929
|
+
"kind": "function",
|
|
8930
|
+
"package": "@nifrajs/web-react",
|
|
8931
|
+
"signature": "export declare function useSearchParams(): readonly [URLSearchParams, SetSearchParams];",
|
|
8932
|
+
"doc": "/**\n * The current query as a `URLSearchParams` (SSR-correct via the router context) plus a setter that\n * navigates to the new query. Mirrors react-router's `useSearchParams` tuple.\n */"
|
|
8933
|
+
},
|
|
7115
8934
|
{
|
|
7116
8935
|
"name": "useT",
|
|
7117
8936
|
"kind": "function",
|
|
@@ -7179,6 +8998,44 @@
|
|
|
7179
8998
|
"package": "@nifrajs/core",
|
|
7180
8999
|
"signature": "export type ValidationOutcome<Output> = {\n readonly ok: true;\n readonly value: Output;\n} | {\n readonly ok: false;\n readonly issues: ReadonlyArray<StandardIssue>;\n};"
|
|
7181
9000
|
},
|
|
9001
|
+
{
|
|
9002
|
+
"name": "validCapabilityId",
|
|
9003
|
+
"kind": "function",
|
|
9004
|
+
"package": "@nifrajs/core",
|
|
9005
|
+
"signature": "export declare function validCapabilityId(value: string): boolean;"
|
|
9006
|
+
},
|
|
9007
|
+
{
|
|
9008
|
+
"name": "validEvidence",
|
|
9009
|
+
"kind": "function",
|
|
9010
|
+
"package": "@nifrajs/core",
|
|
9011
|
+
"signature": "export declare function validEvidence(value: unknown): value is AssuranceEvidence;"
|
|
9012
|
+
},
|
|
9013
|
+
{
|
|
9014
|
+
"name": "validEvidenceId",
|
|
9015
|
+
"kind": "function",
|
|
9016
|
+
"package": "@nifrajs/core",
|
|
9017
|
+
"signature": "export declare function validEvidenceId(value: string): boolean;"
|
|
9018
|
+
},
|
|
9019
|
+
{
|
|
9020
|
+
"name": "validIdempotencyKey",
|
|
9021
|
+
"kind": "function",
|
|
9022
|
+
"package": "@nifrajs/core",
|
|
9023
|
+
"signature": "export declare function validIdempotencyKey(key: string): boolean;",
|
|
9024
|
+
"doc": "/** A key must be a non-empty, bounded, control-char-free token. Fail closed on anything else. */"
|
|
9025
|
+
},
|
|
9026
|
+
{
|
|
9027
|
+
"name": "validIdempotencyNamespace",
|
|
9028
|
+
"kind": "function",
|
|
9029
|
+
"package": "@nifrajs/core",
|
|
9030
|
+
"signature": "export declare function validIdempotencyNamespace(namespace: string): boolean;",
|
|
9031
|
+
"doc": "/** Namespace values are server-resolved, bounded opaque tokens (normally a tenant/subject hash). */"
|
|
9032
|
+
},
|
|
9033
|
+
{
|
|
9034
|
+
"name": "validMethod",
|
|
9035
|
+
"kind": "function",
|
|
9036
|
+
"package": "@nifrajs/core",
|
|
9037
|
+
"signature": "export declare function validMethod(value: string): value is Method;"
|
|
9038
|
+
},
|
|
7182
9039
|
{
|
|
7183
9040
|
"name": "vanillaAdapter",
|
|
7184
9041
|
"kind": "const",
|
|
@@ -7200,6 +9057,19 @@
|
|
|
7200
9057
|
"signature": "export type Verdict = \"ok\" | \"caveat\" | \"unsupported\";",
|
|
7201
9058
|
"doc": "/** A target's verdict for one feature: fully fine, works-with-a-caveat, or won't work at all. */"
|
|
7202
9059
|
},
|
|
9060
|
+
{
|
|
9061
|
+
"name": "VerificationLevelsResult",
|
|
9062
|
+
"kind": "interface",
|
|
9063
|
+
"package": "@nifrajs/cli",
|
|
9064
|
+
"signature": "export interface VerificationLevelsResult {\n /** Highest level whose whole ladder holds; -1 when even L0 fails. */\n readonly achieved: number;\n readonly levels: readonly VerificationLevelStatus[];\n}"
|
|
9065
|
+
},
|
|
9066
|
+
{
|
|
9067
|
+
"name": "VerificationLevelStatus",
|
|
9068
|
+
"kind": "interface",
|
|
9069
|
+
"package": "@nifrajs/cli",
|
|
9070
|
+
"signature": "export interface VerificationLevelStatus {\n readonly level: number;\n readonly name: string;\n readonly ok: boolean;\n /** Why the level does not hold — a gate failure or a missing prerequisite. Empty when ok. */\n readonly reasons: readonly string[];\n}",
|
|
9071
|
+
"doc": "/**\n * `nifra levels` — the verification ladder, computed from gates that already exist:\n *\n * L0 typed contract — `nifra check` passes (compiler-enforced frontend↔backend contract)\n * L1 route assurance — `nifra.assurance.ts` present and every route satisfies its policy\n * L2 capability lockfile — capability/effect assurance passes and the lockfile is in sync\n * L3 route manifest — the emitted manifest hash-verifies and matches the current app\n * L4 invariant-tested — every route passes through an explicitly isolated executor\n *\n * A level counts only when every level below it holds — the ladder is cumulative, so \"L3\" is one\n * honest word for a whole posture. Levels are computed, never self-declared.\n */"
|
|
9072
|
+
},
|
|
7203
9073
|
{
|
|
7204
9074
|
"name": "VerifiedJwt",
|
|
7205
9075
|
"kind": "interface",
|
|
@@ -7250,6 +9120,13 @@
|
|
|
7250
9120
|
"package": "@nifrajs/middleware",
|
|
7251
9121
|
"signature": "export type VerifyJwtResult<C extends JwtClaims = JwtClaims> = {\n readonly ok: true;\n readonly data: VerifiedJwt<C>;\n} | {\n readonly ok: false;\n readonly error: Error;\n};"
|
|
7252
9122
|
},
|
|
9123
|
+
{
|
|
9124
|
+
"name": "verifyNifraManifestSignature",
|
|
9125
|
+
"kind": "function",
|
|
9126
|
+
"package": "@nifrajs/core",
|
|
9127
|
+
"signature": "export declare function verifyNifraManifestSignature(manifest: NifraManifest, signature: NifraManifestSignature, publicKey: CryptoKey): Promise<boolean>;",
|
|
9128
|
+
"doc": "/** Verify the hash first, then the detached Ed25519 signature. Malformed/tampered input returns false. */"
|
|
9129
|
+
},
|
|
7253
9130
|
{
|
|
7254
9131
|
"name": "verifyWebhook",
|
|
7255
9132
|
"kind": "function",
|
|
@@ -7273,7 +9150,7 @@
|
|
|
7273
9150
|
"name": "VERSION",
|
|
7274
9151
|
"kind": "const",
|
|
7275
9152
|
"package": "@nifrajs/core",
|
|
7276
|
-
"signature": "export declare const VERSION: \"1.
|
|
9153
|
+
"signature": "export declare const VERSION: \"1.11.0\";",
|
|
7277
9154
|
"doc": "/**\n * Current package version. A hardcoded literal on purpose — core runs on the edge (no fs), so it can't\n * read its own package.json at runtime. `scripts/version.ts` rewrites it on every release bump and\n * `check:publish` asserts it equals `@nifrajs/core`'s package version, so the literal can't go stale\n * (it shipped at \"0.0.0\" through 1.0.0 before those guards existed). Kept narrow (`as const`) so\n * consumers can pin it at the type level — see `test/version.test-d.ts`.\n */"
|
|
7278
9155
|
},
|
|
7279
9156
|
{
|
|
@@ -7396,6 +9273,13 @@
|
|
|
7396
9273
|
"signature": "export declare function widgetDocument(opts: DefineMcpWidgetOptions): string;",
|
|
7397
9274
|
"doc": "/** Assemble the full self-contained widget document (bridge inlined in `<head>` so body scripts can use\n * `mcpApp` immediately). */"
|
|
7398
9275
|
},
|
|
9276
|
+
{
|
|
9277
|
+
"name": "withDeadlineHeader",
|
|
9278
|
+
"kind": "function",
|
|
9279
|
+
"package": "@nifrajs/core",
|
|
9280
|
+
"signature": "export declare function withDeadlineHeader(input: DeadlineHeadersInit, budget: RequestBudget, reserveMs?: number): Headers;",
|
|
9281
|
+
"doc": "/** Add this budget's absolute deadline to an outbound request. */"
|
|
9282
|
+
},
|
|
7399
9283
|
{
|
|
7400
9284
|
"name": "withHeaders",
|
|
7401
9285
|
"kind": "function",
|
|
@@ -7410,6 +9294,13 @@
|
|
|
7410
9294
|
"signature": "export declare function withISR(app: ISRApp, options: ISROptions): (req: Request, platform?: ISRPlatform) => Promise<Response>;",
|
|
7411
9295
|
"doc": "/**\n * Wrap a nifra app with **Incremental Static Regeneration**: a cacheable page is served from\n * {@link CacheStore} when fresh, served **stale while a fresh copy regenerates in the background**\n * (`platform.waitUntil` on edge), or rendered + stored on a miss. Framework-agnostic (it caches the\n * rendered bytes). Returns a `fetch(req, platform?)` handler — hand it to `Bun.serve`/the Workers\n * `export default`, etc. Regeneration is single-flight per key (no stampede on a hot stale page).\n *\n * Each route's freshness comes from the `revalidate` header the app sets (per-route\n * `export const revalidate`), falling back to `options.revalidate`. Only full-document `text/html`\n * GET 200s are cached; everything else (assets, data-mode GETs, redirects, errors) passes through.\n */"
|
|
7412
9296
|
},
|
|
9297
|
+
{
|
|
9298
|
+
"name": "withRouteAssurance",
|
|
9299
|
+
"kind": "function",
|
|
9300
|
+
"package": "@nifrajs/core",
|
|
9301
|
+
"signature": "export declare function withRouteAssurance<T extends object>(target: T, declaration: AssuranceDeclaration | readonly AssuranceDeclaration[]): T;",
|
|
9302
|
+
"doc": "/** Attach enforcement evidence to the middleware/plugin that installs it. */"
|
|
9303
|
+
},
|
|
7413
9304
|
{
|
|
7414
9305
|
"name": "Worker",
|
|
7415
9306
|
"kind": "interface",
|