@nifrajs/cli 1.6.0 → 1.12.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.
Files changed (62) hide show
  1. package/README.md +33 -1
  2. package/dist/assure.d.ts +11 -0
  3. package/dist/assure.d.ts.map +1 -0
  4. package/dist/assure.js +67 -0
  5. package/dist/assure.js.map +1 -0
  6. package/dist/capabilities-tool.d.ts +33 -0
  7. package/dist/capabilities-tool.d.ts.map +1 -0
  8. package/dist/capabilities-tool.js +320 -0
  9. package/dist/capabilities-tool.js.map +1 -0
  10. package/dist/check.d.ts +1 -1
  11. package/dist/check.d.ts.map +1 -1
  12. package/dist/check.js +136 -11
  13. package/dist/check.js.map +1 -1
  14. package/dist/cli.d.ts.map +1 -1
  15. package/dist/cli.js +199 -12
  16. package/dist/cli.js.map +1 -1
  17. package/dist/doctor.d.ts +17 -0
  18. package/dist/doctor.d.ts.map +1 -1
  19. package/dist/doctor.js +146 -10
  20. package/dist/doctor.js.map +1 -1
  21. package/dist/levels-tool.d.ts +37 -0
  22. package/dist/levels-tool.d.ts.map +1 -0
  23. package/dist/levels-tool.js +183 -0
  24. package/dist/levels-tool.js.map +1 -0
  25. package/dist/manifest-tool.d.ts +15 -0
  26. package/dist/manifest-tool.d.ts.map +1 -0
  27. package/dist/manifest-tool.js +67 -0
  28. package/dist/manifest-tool.js.map +1 -0
  29. package/dist/mcp-http.js +1 -1
  30. package/dist/mcp-http.js.map +1 -1
  31. package/dist/mcp.d.ts +1 -0
  32. package/dist/mcp.d.ts.map +1 -1
  33. package/dist/mcp.js +31 -0
  34. package/dist/mcp.js.map +1 -1
  35. package/dist/recipes/1.8.0.d.ts +12 -0
  36. package/dist/recipes/1.8.0.d.ts.map +1 -0
  37. package/dist/recipes/1.8.0.js +20 -0
  38. package/dist/recipes/1.8.0.js.map +1 -0
  39. package/dist/recipes/index.d.ts +28 -0
  40. package/dist/recipes/index.d.ts.map +1 -0
  41. package/dist/recipes/index.js +27 -0
  42. package/dist/recipes/index.js.map +1 -0
  43. package/dist/upgrade.d.ts +82 -0
  44. package/dist/upgrade.d.ts.map +1 -0
  45. package/dist/upgrade.js +220 -0
  46. package/dist/upgrade.js.map +1 -0
  47. package/docs/examples.json +12 -0
  48. package/docs/llms-full.txt +524 -15
  49. package/docs/types.json +2409 -50
  50. package/package.json +9 -8
  51. package/src/assure.ts +88 -0
  52. package/src/capabilities-tool.ts +406 -0
  53. package/src/check.ts +155 -12
  54. package/src/cli.ts +206 -17
  55. package/src/doctor.ts +179 -11
  56. package/src/levels-tool.ts +232 -0
  57. package/src/manifest-tool.ts +103 -0
  58. package/src/mcp-http.ts +1 -1
  59. package/src/mcp.ts +37 -0
  60. package/src/recipes/1.8.0.ts +21 -0
  61. package/src/recipes/index.ts +52 -0
  62. package/src/upgrade.ts +269 -0
package/docs/types.json CHANGED
@@ -33,12 +33,107 @@
33
33
  "package": "@nifrajs/otel",
34
34
  "signature": "export interface ActiveObservation {\n readonly span: NifraSpan;\n readonly context: ObservationContext;\n /** Adds a sink to this in-flight span. Re-adding the same adapter is idempotent. */\n addAdapter(adapter: ObservationAdapter): void;\n /** Starts a child that inherits this span's trace identity and sampling decision. */\n startChild(input: Omit<StartObservation, \"parent\" | \"traceparent\">, additionalAdapters?: readonly ObservationAdapter[]): ActiveObservation;\n /**\n * Merge attributes onto the in-flight span — the seam for plugins that learn something mid-request\n * (an authenticated principal, a feature-flag bucket, a cache verdict) after the span opened.\n * Silently ignored once the observation has ended (the exported span is immutable).\n */\n setAttributes(attributes: Readonly<Record<string, AttributeValue>>): void;\n /** Records failure evidence without deciding the final status until the response is known. */\n recordError(error: unknown): void;\n /** Ends and exports once. Repeated calls return the same completed span without notifying again. */\n end(input?: EndObservation): NifraSpan;\n}"
35
35
  },
36
+ {
37
+ "name": "AdapterCertificationError",
38
+ "kind": "class",
39
+ "package": "@nifrajs/testing",
40
+ "signature": "export declare class AdapterCertificationError extends Error {\n readonly report: AdapterCertificationReport;\n constructor(report: AdapterCertificationReport);\n}"
41
+ },
42
+ {
43
+ "name": "AdapterCertificationProfile",
44
+ "kind": "interface",
45
+ "package": "@nifrajs/testing",
46
+ "signature": "export interface AdapterCertificationProfile<Adapter> {\n readonly id: string;\n readonly version: number;\n readonly capabilities: readonly string[];\n readonly checks: readonly CertificationCheck<Adapter>[];\n}"
47
+ },
48
+ {
49
+ "name": "AdapterCertificationReport",
50
+ "kind": "interface",
51
+ "package": "@nifrajs/testing",
52
+ "signature": "export interface AdapterCertificationReport {\n readonly schemaVersion: 1;\n readonly ok: boolean;\n readonly profile: {\n readonly id: string;\n readonly version: number;\n };\n readonly adapterId: string;\n readonly checks: readonly CertificationCheckEvidence[];\n readonly capabilities: readonly CertificationCapabilityEvidence[];\n readonly evidenceHash: string;\n}"
53
+ },
36
54
  {
37
55
  "name": "AddRoute",
38
56
  "kind": "type",
39
57
  "package": "@nifrajs/core",
40
58
  "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": "/** Merge a new route into the registry, combining methods that share a path. */"
59
+ "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 */"
60
+ },
61
+ {
62
+ "name": "AdmissionController",
63
+ "kind": "interface",
64
+ "package": "@nifrajs/core",
65
+ "signature": "export interface AdmissionController {\n admit(req: Request): AdmissionDecision | Promise<AdmissionDecision>;\n}",
66
+ "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 */"
67
+ },
68
+ {
69
+ "name": "AdmissionControllerHandle",
70
+ "kind": "interface",
71
+ "package": "@nifrajs/middleware",
72
+ "signature": "export interface AdmissionControllerHandle extends AdmissionController {\n /** Point-in-time counters for observability (otel gauges/counters). */\n snapshot(): AdmissionSnapshot;\n}"
73
+ },
74
+ {
75
+ "name": "AdmissionDecision",
76
+ "kind": "type",
77
+ "package": "@nifrajs/core",
78
+ "signature": "export type AdmissionDecision = {\n readonly admitted: true;\n release(): void;\n} | {\n readonly admitted: false;\n readonly response: Response;\n};",
79
+ "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 */"
80
+ },
81
+ {
82
+ "name": "AdmissionEvidence",
83
+ "kind": "interface",
84
+ "package": "@nifrajs/middleware",
85
+ "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}",
86
+ "doc": "/** Pure capacity evidence handed to the policy hook. The mechanics never invent tenant concepts. */"
87
+ },
88
+ {
89
+ "name": "AdmissionOptions",
90
+ "kind": "interface",
91
+ "package": "@nifrajs/middleware",
92
+ "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}"
93
+ },
94
+ {
95
+ "name": "AdmissionPolicy",
96
+ "kind": "type",
97
+ "package": "@nifrajs/middleware",
98
+ "signature": "export type AdmissionPolicy = (req: Request, evidence: AdmissionEvidence) => {\n decision: \"admit\" | \"shed\";\n retryAfterSec?: number;\n} | undefined;",
99
+ "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 */"
100
+ },
101
+ {
102
+ "name": "AdmissionSnapshot",
103
+ "kind": "interface",
104
+ "package": "@nifrajs/middleware",
105
+ "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}"
106
+ },
107
+ {
108
+ "name": "admitDeadline",
109
+ "kind": "function",
110
+ "package": "@nifrajs/core",
111
+ "signature": "export declare function admitDeadline(headers: Headers, options?: DeadlineAdmissionOptions): DeadlineAdmission;",
112
+ "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 */"
113
+ },
114
+ {
115
+ "name": "AdversarialContractError",
116
+ "kind": "class",
117
+ "package": "@nifrajs/testing",
118
+ "signature": "export declare class AdversarialContractError extends Error {\n readonly report: AdversarialContractReport;\n constructor(report: AdversarialContractReport);\n}"
119
+ },
120
+ {
121
+ "name": "AdversarialContractOptions",
122
+ "kind": "interface",
123
+ "package": "@nifrajs/testing",
124
+ "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}"
125
+ },
126
+ {
127
+ "name": "AdversarialContractReport",
128
+ "kind": "interface",
129
+ "package": "@nifrajs/testing",
130
+ "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}"
131
+ },
132
+ {
133
+ "name": "AdversarialContractResult",
134
+ "kind": "interface",
135
+ "package": "@nifrajs/testing",
136
+ "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
137
  },
43
138
  {
44
139
  "name": "AgentFileSpec",
@@ -202,6 +297,13 @@
202
297
  "signature": "export declare function applyHead(head: Meta): void;",
203
298
  "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
299
  },
300
+ {
301
+ "name": "applyImportMoves",
302
+ "kind": "function",
303
+ "package": "@nifrajs/cli",
304
+ "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};",
305
+ "doc": "/** Rewrite exact import/export/require/dynamic-import specifiers in one source file's text. */"
306
+ },
205
307
  {
206
308
  "name": "applyResponseHeaders",
207
309
  "kind": "function",
@@ -209,6 +311,19 @@
209
311
  "signature": "export declare function applyResponseHeaders(headers: Headers, res: NodeHeaderSink): void;",
210
312
  "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
313
  },
314
+ {
315
+ "name": "assertAdapterCertification",
316
+ "kind": "function",
317
+ "package": "@nifrajs/testing",
318
+ "signature": "export declare function assertAdapterCertification(report: AdapterCertificationReport): void;"
319
+ },
320
+ {
321
+ "name": "assertAdversarialContract",
322
+ "kind": "function",
323
+ "package": "@nifrajs/testing",
324
+ "signature": "export declare function assertAdversarialContract(app: ContractTestApp, options?: AdversarialContractOptions): Promise<AdversarialContractReport>;",
325
+ "doc": "/** Run the contract laboratory and throw an {@link AdversarialContractError} unless it is fully green. */"
326
+ },
212
327
  {
213
328
  "name": "assertAuthableDb",
214
329
  "kind": "function",
@@ -216,6 +331,20 @@
216
331
  "signature": "export declare function assertAuthableDb(db: DbChoice): void;",
217
332
  "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
333
  },
334
+ {
335
+ "name": "assertBudgetRemaining",
336
+ "kind": "function",
337
+ "package": "@nifrajs/core",
338
+ "signature": "export declare function assertBudgetRemaining(budget: RequestBudget, requiredMs?: number): void;",
339
+ "doc": "/** Fail before starting work that cannot fit inside the remaining time. */"
340
+ },
341
+ {
342
+ "name": "assertIncidentReplays",
343
+ "kind": "function",
344
+ "package": "@nifrajs/testing",
345
+ "signature": "export declare function assertIncidentReplays(app: AppLike, capsule: IncidentCapsule, options?: ReplayIncidentOptions): Promise<void>;",
346
+ "doc": "/** Assert a captured incident still reproduces against the current app. Throws {@link IncidentReplayError}. */"
347
+ },
219
348
  {
220
349
  "name": "assertRenderAdapterConformance",
221
350
  "kind": "function",
@@ -237,6 +366,100 @@
237
366
  "signature": "export declare function assertStorageAdapterConformance(options: StorageAdapterConformanceOptions): Promise<void>;",
238
367
  "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
368
  },
369
+ {
370
+ "name": "AssuranceConfig",
371
+ "kind": "interface",
372
+ "package": "@nifrajs/core",
373
+ "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}"
374
+ },
375
+ {
376
+ "name": "AssuranceDeclaration",
377
+ "kind": "interface",
378
+ "package": "@nifrajs/core",
379
+ "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}",
380
+ "doc": "/** Metadata installed on a middleware/plugin by {@link withRouteAssurance}. */"
381
+ },
382
+ {
383
+ "name": "assuranceDeclarationsOf",
384
+ "kind": "function",
385
+ "package": "@nifrajs/core",
386
+ "signature": "export declare function assuranceDeclarationsOf(value: object): readonly AssuranceDeclaration[];"
387
+ },
388
+ {
389
+ "name": "AssuranceEvidence",
390
+ "kind": "interface",
391
+ "package": "@nifrajs/core",
392
+ "signature": "export interface AssuranceEvidence {\n readonly id: string;\n readonly source: string;\n}",
393
+ "doc": "/** Reflection-safe proof that a named enforcement module covered a route. */"
394
+ },
395
+ {
396
+ "name": "assuranceEvidenceFor",
397
+ "kind": "function",
398
+ "package": "@nifrajs/core",
399
+ "signature": "export declare function assuranceEvidenceFor(declarationsToApply: readonly AssuranceDeclaration[], method: string, path: string): readonly AssuranceEvidence[];"
400
+ },
401
+ {
402
+ "name": "AssuranceFinding",
403
+ "kind": "interface",
404
+ "package": "@nifrajs/core",
405
+ "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}"
406
+ },
407
+ {
408
+ "name": "AssuranceFindingCode",
409
+ "kind": "type",
410
+ "package": "@nifrajs/core",
411
+ "signature": "export type AssuranceFindingCode = \"no-routes\" | \"unclassified-route\" | \"missing-evidence\" | \"forbidden-evidence\";"
412
+ },
413
+ {
414
+ "name": "AssurancePolicy",
415
+ "kind": "interface",
416
+ "package": "@nifrajs/core",
417
+ "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}"
418
+ },
419
+ {
420
+ "name": "AssuranceReport",
421
+ "kind": "interface",
422
+ "package": "@nifrajs/core",
423
+ "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}"
424
+ },
425
+ {
426
+ "name": "AssuranceRouteSelector",
427
+ "kind": "interface",
428
+ "package": "@nifrajs/core",
429
+ "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}"
430
+ },
431
+ {
432
+ "name": "AssuranceRule",
433
+ "kind": "interface",
434
+ "package": "@nifrajs/core",
435
+ "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}"
436
+ },
437
+ {
438
+ "name": "AssuranceScope",
439
+ "kind": "type",
440
+ "package": "@nifrajs/core",
441
+ "signature": "export type AssuranceScope = \"global\" | \"subsequent\" | \"plugin\";",
442
+ "doc": "/** Where enforcement evidence follows Nifra's route-registration semantics. */"
443
+ },
444
+ {
445
+ "name": "AssuredCapabilityRoute",
446
+ "kind": "interface",
447
+ "package": "@nifrajs/core",
448
+ "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}"
449
+ },
450
+ {
451
+ "name": "AssuredRoute",
452
+ "kind": "interface",
453
+ "package": "@nifrajs/core",
454
+ "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}"
455
+ },
456
+ {
457
+ "name": "attachEffectLedger",
458
+ "kind": "function",
459
+ "package": "@nifrajs/core",
460
+ "signature": "export declare function attachEffectLedger(context: object, ledger: RequestLedger): void;",
461
+ "doc": "/** Framework wiring: attach a per-request ledger to a handler context. Not for application code. */"
462
+ },
240
463
  {
241
464
  "name": "attachWebSocket",
242
465
  "kind": "function",
@@ -334,6 +557,20 @@
334
557
  "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
558
  "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
559
  },
560
+ {
561
+ "name": "BackendMount",
562
+ "kind": "interface",
563
+ "package": "@nifrajs/core",
564
+ "signature": "export interface BackendMount<Env = unknown> {\n readonly [NIFRA_BACKEND_MOUNT]: BackendMountHandler<Env>;\n}",
565
+ "doc": "/** Structural mount capability exposed by an in-process typed client. */"
566
+ },
567
+ {
568
+ "name": "BackendMountHandler",
569
+ "kind": "type",
570
+ "package": "@nifrajs/core",
571
+ "signature": "export type BackendMountHandler<Env = unknown> = (request: Request, platform?: Platform<Env>) => Response | Promise<Response>;",
572
+ "doc": "/** Dispatch one already-materialized request into a backend with its outer runtime platform context. */"
573
+ },
337
574
  {
338
575
  "name": "backendRoutes",
339
576
  "kind": "function",
@@ -472,6 +709,20 @@
472
709
  "signature": "export declare function bridgeScript(): string;",
473
710
  "doc": "/** The bridge source, as a string for inlining in a `<script>`. Self-contained, no imports. */"
474
711
  },
712
+ {
713
+ "name": "BrowserNavigate",
714
+ "kind": "type",
715
+ "package": "@nifrajs/web",
716
+ "signature": "export type BrowserNavigate = (to: string | number, options?: NavigateOptions) => void;",
717
+ "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 */"
718
+ },
719
+ {
720
+ "name": "BudgetClock",
721
+ "kind": "interface",
722
+ "package": "@nifrajs/core",
723
+ "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}",
724
+ "doc": "/** The only clocks deadline mechanics need. Inject both for deterministic tests. */"
725
+ },
475
726
  {
476
727
  "name": "BUILD_TARGETS",
477
728
  "kind": "const",
@@ -506,6 +757,19 @@
506
757
  "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
758
  "doc": "/** The built asset map — the server reads `entry` for the client script + serves `assets`. */"
508
759
  },
760
+ {
761
+ "name": "buildNifraManifest",
762
+ "kind": "function",
763
+ "package": "@nifrajs/core",
764
+ "signature": "export declare function buildNifraManifest(input: BuildNifraManifestInput): Promise<NifraManifest>;",
765
+ "doc": "/** Build one fail-closed, deterministic manifest from already-evaluated assurance reports. */"
766
+ },
767
+ {
768
+ "name": "BuildNifraManifestInput",
769
+ "kind": "interface",
770
+ "package": "@nifrajs/core",
771
+ "signature": "export interface BuildNifraManifestInput {\n readonly source: unknown;\n readonly assurance?: AssuranceReport;\n readonly capabilities?: CapabilityAssuranceReport;\n}"
772
+ },
509
773
  {
510
774
  "name": "buildOpenApiDocument",
511
775
  "kind": "function",
@@ -550,7 +814,7 @@
550
814
  "name": "BuildTargetOptions",
551
815
  "kind": "interface",
552
816
  "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 /** A pre-built app instance for `static` prerendering (a `createWebApp` result). Required for\n * `target: \"static\"` (SSG drives `app.fetch`); ignored otherwise. */\n readonly prerenderApp?: 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}"
817
+ "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
818
  },
555
819
  {
556
820
  "name": "BuildTargetResult",
@@ -640,43 +904,472 @@
640
904
  "doc": "/** A cached SSR response — the bytes + metadata a {@link CacheStore} persists. */"
641
905
  },
642
906
  {
643
- "name": "CacheOptions",
907
+ "name": "CacheOptions",
908
+ "kind": "interface",
909
+ "package": "@nifrajs/cache",
910
+ "signature": "export interface CacheOptions {\n /** Storage adapter. Default: a fresh {@link MemoryCache}. */\n readonly store?: CacheStore;\n /** Default TTL (ms) for `set`/`wrap` when none is given. Default 60_000. */\n readonly defaultTtlMs?: number;\n /** Injectable clock (tests). Default `() => Date.now()`. */\n readonly now?: () => number;\n /** Called when a background SWR revalidation throws. Default: `console.error`. */\n readonly onError?: (error: unknown, key: string) => void;\n}"
911
+ },
912
+ {
913
+ "name": "CacheOptions",
914
+ "kind": "interface",
915
+ "package": "@nifrajs/middleware",
916
+ "signature": "export interface CacheOptions {\n readonly store: ResponseCacheStore;\n /** Time to live in milliseconds. */\n readonly ttlMs: number;\n /** Methods cached. Default `[\"GET\", \"HEAD\"]`. */\n readonly methods?: readonly string[];\n /** Status predicate. Default: `200` only. */\n readonly status?: (status: number) => boolean;\n /** Header names included in the cache key and emitted in `Vary`. */\n readonly vary?: readonly string[];\n /** Custom cache key. Receives the normalized `vary` headers through the request itself. */\n readonly key?: (request: Request) => string;\n /** Maximum response bytes to store. Default `1_000_000`. Larger responses pass through. */\n readonly maxBytes?: number;\n /** Respect request `Cache-Control: no-cache/no-store`. Default `true`. */\n readonly respectRequestCacheControl?: boolean;\n /** Respect response `Cache-Control: private/no-store`. Default `true`. */\n readonly respectResponseCacheControl?: boolean;\n /** Cache responses with `Set-Cookie`. Default `false`. */\n readonly cacheSetCookie?: boolean;\n /** Cache responses to requests bearing `Authorization` or `Cookie` even when the response is not\n * explicitly `Cache-Control: public` (or `s-maxage`). Default `false`: a shared cache must not store a\n * personalized response (RFC 9111 §3.5), or it would be replayed to other users. Leave this off unless\n * the cached route is genuinely the same for every caller. */\n readonly cacheAuthenticated?: boolean;\n /** Response header for cache status. Default `\"x-nifra-cache\"`; set `false` to disable. */\n readonly cacheStatusHeader?: string | false;\n}"
917
+ },
918
+ {
919
+ "name": "CacheStore",
920
+ "kind": "interface",
921
+ "package": "@nifrajs/cache",
922
+ "signature": "export interface CacheStore {\n /** The live entry for `key`, or `undefined` if missing or hard-expired (`now >= expiresAt`). */\n get(key: string): StoredEntry | undefined | Promise<StoredEntry | undefined>;\n /** Store `entry` under `key`, indexed by `tags` for {@link CacheStore.invalidateTag}. */\n set(key: string, entry: StoredEntry, tags: readonly string[]): void | Promise<void>;\n delete(key: string): void | Promise<void>;\n /** Drop every entry carrying `tag`. */\n invalidateTag(tag: string): void | Promise<void>;\n clear(): void | Promise<void>;\n}",
923
+ "doc": "/**\n * Raw key→entry storage. The default {@link MemoryCache} is in-process; implement this over CF KV /\n * Redis / etc. for a cache shared across instances. All methods may be sync or async — the cache awaits them.\n */"
924
+ },
925
+ {
926
+ "name": "CacheStore",
927
+ "kind": "interface",
928
+ "package": "@nifrajs/web",
929
+ "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}",
930
+ "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 */"
931
+ },
932
+ {
933
+ "name": "cacheStoreCertificationProfile",
934
+ "kind": "function",
935
+ "package": "@nifrajs/testing",
936
+ "signature": "export declare function cacheStoreCertificationProfile(): AdapterCertificationProfile<CertifiableCacheStore>;"
937
+ },
938
+ {
939
+ "name": "canAttempt",
940
+ "kind": "function",
941
+ "package": "@nifrajs/core",
942
+ "signature": "export declare function canAttempt(budget: RequestBudget, estimatedAttemptMs: number, reserveMs?: number): boolean;",
943
+ "doc": "/** True only when a new attempt plus a caller-owned reserve can still fit. */"
944
+ },
945
+ {
946
+ "name": "canonical",
947
+ "kind": "function",
948
+ "package": "@nifrajs/web",
949
+ "signature": "export declare function canonical(href: string): LinkDescriptor;",
950
+ "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 */"
951
+ },
952
+ {
953
+ "name": "canonicalizeIdempotencyBody",
954
+ "kind": "function",
955
+ "package": "@nifrajs/core",
956
+ "signature": "export declare function canonicalizeIdempotencyBody(body: Uint8Array, contentType: string | null): Uint8Array;",
957
+ "doc": "/** Canonicalize JSON bodies so whitespace/property-order retries bind to the same semantic request. */"
958
+ },
959
+ {
960
+ "name": "canonicalManifest",
961
+ "kind": "function",
962
+ "package": "@nifrajs/core",
963
+ "signature": "export declare function canonicalManifest(manifest: Pick<NifraManifest, \"manifestVersion\" | \"routes\">): string;",
964
+ "doc": "/** Canonical bytes are stable across runtime, object-key order, and route registration order. */"
965
+ },
966
+ {
967
+ "name": "CAPABILITY_GUARD",
968
+ "kind": "const",
969
+ "package": "@nifrajs/core",
970
+ "signature": "export declare const CAPABILITY_GUARD: unique symbol;"
971
+ },
972
+ {
973
+ "name": "CapabilityAccess",
974
+ "kind": "type",
975
+ "package": "@nifrajs/core",
976
+ "signature": "export type CapabilityAccess = \"read\" | \"write\";"
977
+ },
978
+ {
979
+ "name": "CapabilityAssuranceReport",
980
+ "kind": "interface",
981
+ "package": "@nifrajs/core",
982
+ "signature": "export interface CapabilityAssuranceReport {\n readonly ok: boolean;\n readonly routes: readonly AssuredCapabilityRoute[];\n readonly findings: readonly CapabilityFinding[];\n}"
983
+ },
984
+ {
985
+ "name": "CapabilityDefinition",
986
+ "kind": "interface",
987
+ "package": "@nifrajs/core",
988
+ "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}"
989
+ },
990
+ {
991
+ "name": "CapabilityEvidence",
992
+ "kind": "interface",
993
+ "package": "@nifrajs/core",
994
+ "signature": "export interface CapabilityEvidence {\n readonly id: string;\n readonly kind: CapabilityEvidenceKind;\n readonly source: string;\n}",
995
+ "doc": "/** Token-only effect evidence. `source` is an adapter/module id, never request or business data. */"
996
+ },
997
+ {
998
+ "name": "CapabilityEvidenceKind",
999
+ "kind": "type",
1000
+ "package": "@nifrajs/core",
1001
+ "signature": "export type CapabilityEvidenceKind = \"static\" | \"runtime\";"
1002
+ },
1003
+ {
1004
+ "name": "CapabilityEvidenceSet",
1005
+ "kind": "interface",
1006
+ "package": "@nifrajs/core",
1007
+ "signature": "export interface CapabilityEvidenceSet {\n readonly routes: readonly RouteCapabilityEvidence[];\n}"
1008
+ },
1009
+ {
1010
+ "name": "CapabilityFinding",
1011
+ "kind": "interface",
1012
+ "package": "@nifrajs/core",
1013
+ "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}"
1014
+ },
1015
+ {
1016
+ "name": "CapabilityFindingCode",
1017
+ "kind": "type",
1018
+ "package": "@nifrajs/core",
1019
+ "signature": "export type CapabilityFindingCode = \"unknown-capability\" | \"provenance-uncovered\" | \"undeclared-capability-evidence\" | \"safe-method-domain-write\" | \"missing-request-idempotency\" | \"missing-durable-idempotency\" | \"forbidden-effect-import\";"
1020
+ },
1021
+ {
1022
+ "name": "CapabilityGuard",
1023
+ "kind": "interface",
1024
+ "package": "@nifrajs/core",
1025
+ "signature": "export interface CapabilityGuard {\n readonly allowed: readonly string[];\n readonly method: string;\n readonly path: string;\n readonly onUse?: (event: CapabilityUseEvent) => void;\n}"
1026
+ },
1027
+ {
1028
+ "name": "CapabilityIdempotency",
1029
+ "kind": "type",
1030
+ "package": "@nifrajs/core",
1031
+ "signature": "export type CapabilityIdempotency = \"none\" | \"request\" | \"durable\";"
1032
+ },
1033
+ {
1034
+ "name": "CapabilityImportRule",
1035
+ "kind": "interface",
1036
+ "package": "@nifrajs/core",
1037
+ "signature": "export interface CapabilityImportRule {\n /** Exact module specifier, or a trailing `/*` prefix rule. */\n readonly specifier: string;\n readonly capabilities: readonly string[];\n}"
1038
+ },
1039
+ {
1040
+ "name": "CapabilityImportViolation",
1041
+ "kind": "interface",
1042
+ "package": "@nifrajs/cli",
1043
+ "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}"
1044
+ },
1045
+ {
1046
+ "name": "CapabilityOutcomeOptions",
1047
+ "kind": "interface",
1048
+ "package": "@nifrajs/core",
1049
+ "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}"
1050
+ },
1051
+ {
1052
+ "name": "CapabilityPolicy",
1053
+ "kind": "interface",
1054
+ "package": "@nifrajs/core",
1055
+ "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}"
1056
+ },
1057
+ {
1058
+ "name": "CapabilityProjectReport",
1059
+ "kind": "interface",
1060
+ "package": "@nifrajs/cli",
1061
+ "signature": "export interface CapabilityProjectReport {\n readonly report: CapabilityAssuranceReport;\n readonly violations: readonly CapabilityImportViolation[];\n}"
1062
+ },
1063
+ {
1064
+ "name": "CapabilityProvenancePolicy",
1065
+ "kind": "interface",
1066
+ "package": "@nifrajs/core",
1067
+ "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}"
1068
+ },
1069
+ {
1070
+ "name": "CapabilityRouteModule",
1071
+ "kind": "interface",
1072
+ "package": "@nifrajs/core",
1073
+ "signature": "export interface CapabilityRouteModule {\n readonly match: CapabilityRouteSelector;\n /** Project-relative modules that implement the selected routes. */\n readonly modules: readonly string[];\n}"
1074
+ },
1075
+ {
1076
+ "name": "CapabilityRouteSelector",
1077
+ "kind": "interface",
1078
+ "package": "@nifrajs/core",
1079
+ "signature": "export interface CapabilityRouteSelector {\n readonly methods?: readonly string[];\n readonly paths?: readonly string[];\n}"
1080
+ },
1081
+ {
1082
+ "name": "CapabilitySnapshot",
1083
+ "kind": "interface",
1084
+ "package": "@nifrajs/core",
1085
+ "signature": "export interface CapabilitySnapshot {\n readonly nifraCapabilities: 1;\n readonly routes: readonly CapabilitySnapshotRoute[];\n}"
1086
+ },
1087
+ {
1088
+ "name": "CapabilitySnapshotRoute",
1089
+ "kind": "interface",
1090
+ "package": "@nifrajs/core",
1091
+ "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}"
1092
+ },
1093
+ {
1094
+ "name": "CapabilityUseEvent",
1095
+ "kind": "interface",
1096
+ "package": "@nifrajs/core",
1097
+ "signature": "export interface CapabilityUseEvent {\n readonly capability: string;\n readonly method: string;\n readonly path: string;\n}"
1098
+ },
1099
+ {
1100
+ "name": "CapabilityZone",
1101
+ "kind": "type",
1102
+ "package": "@nifrajs/core",
1103
+ "signature": "export type CapabilityZone = \"domain\" | \"operational\";"
1104
+ },
1105
+ {
1106
+ "name": "CapturedRequest",
1107
+ "kind": "interface",
1108
+ "package": "@nifrajs/testing",
1109
+ "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}"
1110
+ },
1111
+ {
1112
+ "name": "CapturedRequestInput",
1113
+ "kind": "interface",
1114
+ "package": "@nifrajs/testing",
1115
+ "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}"
1116
+ },
1117
+ {
1118
+ "name": "captureIncident",
1119
+ "kind": "function",
1120
+ "package": "@nifrajs/testing",
1121
+ "signature": "export declare function captureIncident(request: Request | CapturedRequestInput, response: Response | {\n status: number;\n body?: unknown;\n}, options?: CaptureIncidentOptions): Promise<IncidentCapsule>;",
1122
+ "doc": "/** Build a capsule from a real `Request`+`Response`, or from plain captured fields. */"
1123
+ },
1124
+ {
1125
+ "name": "CaptureIncidentOptions",
1126
+ "kind": "interface",
1127
+ "package": "@nifrajs/testing",
1128
+ "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}"
1129
+ },
1130
+ {
1131
+ "name": "CAUSALITY_EXECUTION_HEADER",
1132
+ "kind": "const",
1133
+ "package": "@nifrajs/core",
1134
+ "signature": "export declare const CAUSALITY_EXECUTION_HEADER = \"x-nifra-execution-id\";"
1135
+ },
1136
+ {
1137
+ "name": "CAUSALITY_KIND_HEADER",
1138
+ "kind": "const",
1139
+ "package": "@nifrajs/core",
1140
+ "signature": "export declare const CAUSALITY_KIND_HEADER = \"x-nifra-causality-kind\";"
1141
+ },
1142
+ {
1143
+ "name": "CAUSALITY_NODE_HEADER",
1144
+ "kind": "const",
1145
+ "package": "@nifrajs/core",
1146
+ "signature": "export declare const CAUSALITY_NODE_HEADER = \"x-nifra-causality-id\";"
1147
+ },
1148
+ {
1149
+ "name": "CAUSALITY_TRACE_HEADER",
1150
+ "kind": "const",
1151
+ "package": "@nifrajs/core",
1152
+ "signature": "export declare const CAUSALITY_TRACE_HEADER = \"x-nifra-causality-trace\";"
1153
+ },
1154
+ {
1155
+ "name": "CausalityCapacityError",
1156
+ "kind": "class",
1157
+ "package": "@nifrajs/core",
1158
+ "signature": "export declare class CausalityCapacityError extends Error {\n readonly maxRecords: number;\n constructor(maxRecords: number);\n}"
1159
+ },
1160
+ {
1161
+ "name": "CausalityConflictError",
1162
+ "kind": "class",
1163
+ "package": "@nifrajs/core",
1164
+ "signature": "export declare class CausalityConflictError extends Error {\n readonly executionId: string;\n readonly node: CausalityRef;\n constructor(executionId: string, node: CausalityRef);\n}"
1165
+ },
1166
+ {
1167
+ "name": "CausalityContext",
1168
+ "kind": "interface",
1169
+ "package": "@nifrajs/core",
1170
+ "signature": "export interface CausalityContext {\n readonly executionId: string;\n readonly current: CausalityRef;\n /** Nearest observed ancestor; downstream observations can attach a real OTel span link to it. */\n readonly trace?: CausalityTrace;\n}",
1171
+ "doc": "/** The propagation shape carried across commands/events/jobs. */"
1172
+ },
1173
+ {
1174
+ "name": "CausalityGraphStore",
1175
+ "kind": "type",
1176
+ "package": "@nifrajs/core",
1177
+ "signature": "export type CausalityGraphStore<Tx = unknown> = CausalityRecorder<Tx> & CausalityReader;"
1178
+ },
1179
+ {
1180
+ "name": "causalityHeaders",
1181
+ "kind": "function",
1182
+ "package": "@nifrajs/core",
1183
+ "signature": "export declare function causalityHeaders(context: CausalityContext): Readonly<Record<string, string>>;",
1184
+ "doc": "/** Serialize the propagation context into bounded HTTP headers. */"
1185
+ },
1186
+ {
1187
+ "name": "CausalityKind",
1188
+ "kind": "type",
1189
+ "package": "@nifrajs/core",
1190
+ "signature": "export type CausalityKind = string;",
1191
+ "doc": "/** A node category such as `request`, `command`, `event`, `workflow`, `projection`, or `repair`. */"
1192
+ },
1193
+ {
1194
+ "name": "CausalityParent",
1195
+ "kind": "interface",
1196
+ "package": "@nifrajs/core",
1197
+ "signature": "export interface CausalityParent extends CausalityRef {\n readonly relation: string;\n}",
1198
+ "doc": "/** One immediate parent edge. Relation is a bounded token (`caused`, `emitted`, `projected`, …). */"
1199
+ },
1200
+ {
1201
+ "name": "CausalityParseResult",
1202
+ "kind": "type",
1203
+ "package": "@nifrajs/core",
1204
+ "signature": "export type CausalityParseResult = {\n readonly success: true;\n readonly context: CausalityContext;\n} | {\n readonly success: false;\n readonly reason: \"missing\" | \"incomplete\" | \"invalid\" | \"unknown-field\";\n};"
1205
+ },
1206
+ {
1207
+ "name": "CausalityReader",
1208
+ "kind": "interface",
1209
+ "package": "@nifrajs/core",
1210
+ "signature": "export interface CausalityReader {\n timeline(executionId: string, options?: {\n readonly after?: string;\n readonly limit?: number;\n }): Promise<CausalityTimelinePage>;\n}"
1211
+ },
1212
+ {
1213
+ "name": "CausalityRecord",
1214
+ "kind": "interface",
1215
+ "package": "@nifrajs/core",
1216
+ "signature": "export interface CausalityRecord {\n readonly executionId: string;\n readonly node: CausalityRef & {\n readonly at: number;\n /** Present only when this node itself opened an observation. */\n readonly trace?: CausalityTrace;\n };\n readonly parents: readonly CausalityParent[];\n}",
1217
+ "doc": "/** One append-only graph record. It intentionally has no payload or metadata field. */"
1218
+ },
1219
+ {
1220
+ "name": "CausalityRecorder",
1221
+ "kind": "interface",
1222
+ "package": "@nifrajs/core",
1223
+ "signature": "export interface CausalityRecorder<Tx = unknown> {\n /** Idempotently append one node and its immediate incoming edges. */\n record(record: CausalityRecord, tx?: Tx): Promise<\"inserted\" | \"duplicate\">;\n}"
1224
+ },
1225
+ {
1226
+ "name": "CausalityRecordParseResult",
1227
+ "kind": "type",
1228
+ "package": "@nifrajs/core",
1229
+ "signature": "export type CausalityRecordParseResult = {\n readonly success: true;\n readonly record: CausalityRecord;\n} | {\n readonly success: false;\n readonly reason: \"incomplete\" | \"invalid\" | \"unknown-field\";\n};"
1230
+ },
1231
+ {
1232
+ "name": "CausalityRef",
1233
+ "kind": "interface",
1234
+ "package": "@nifrajs/core",
1235
+ "signature": "export interface CausalityRef {\n readonly kind: CausalityKind;\n readonly id: string;\n}",
1236
+ "doc": "/** A bounded identity within one execution graph. */"
1237
+ },
1238
+ {
1239
+ "name": "causalitySpanLink",
1240
+ "kind": "function",
1241
+ "package": "@nifrajs/otel",
1242
+ "signature": "export declare function causalitySpanLink(context: CausalityContext): ObservationLink | undefined;",
1243
+ "doc": "/**\n * Convert the nearest observed causal ancestor into an OTel span link. Returns `undefined` instead\n * of inventing a trace identity when the durable context has no observation anchor.\n */"
1244
+ },
1245
+ {
1246
+ "name": "CausalityStep",
1247
+ "kind": "interface",
1248
+ "package": "@nifrajs/core",
1249
+ "signature": "export interface CausalityStep {\n readonly context: CausalityContext;\n readonly record: CausalityRecord;\n}",
1250
+ "doc": "/** A propagation context plus the graph record a durable adapter should append. */"
1251
+ },
1252
+ {
1253
+ "name": "CausalityTimelineItem",
1254
+ "kind": "interface",
1255
+ "package": "@nifrajs/core",
1256
+ "signature": "export interface CausalityTimelineItem {\n readonly cursor: string;\n readonly record: CausalityRecord;\n}"
1257
+ },
1258
+ {
1259
+ "name": "CausalityTimelinePage",
1260
+ "kind": "interface",
1261
+ "package": "@nifrajs/core",
1262
+ "signature": "export interface CausalityTimelinePage {\n readonly items: readonly CausalityTimelineItem[];\n readonly nextCursor?: string;\n}"
1263
+ },
1264
+ {
1265
+ "name": "CausalityTrace",
1266
+ "kind": "interface",
1267
+ "package": "@nifrajs/core",
1268
+ "signature": "export interface CausalityTrace {\n readonly traceId: string;\n readonly spanId: string;\n}",
1269
+ "doc": "/** Optional OpenTelemetry anchor for the nearest observed ancestor. */"
1270
+ },
1271
+ {
1272
+ "name": "CertifiableCacheEntry",
1273
+ "kind": "interface",
1274
+ "package": "@nifrajs/testing",
1275
+ "signature": "export interface CertifiableCacheEntry {\n readonly value: unknown;\n readonly staleAt: number;\n readonly expiresAt: number;\n}"
1276
+ },
1277
+ {
1278
+ "name": "CertifiableCacheStore",
1279
+ "kind": "interface",
1280
+ "package": "@nifrajs/testing",
1281
+ "signature": "export interface CertifiableCacheStore {\n get(key: string): CertifiableCacheEntry | undefined | Promise<CertifiableCacheEntry | undefined>;\n set(key: string, entry: CertifiableCacheEntry, tags: readonly string[]): void | Promise<void>;\n delete(key: string): void | Promise<void>;\n invalidateTag(tag: string): void | Promise<void>;\n clear(): void | Promise<void>;\n}"
1282
+ },
1283
+ {
1284
+ "name": "CertifiableDomainEvent",
1285
+ "kind": "interface",
1286
+ "package": "@nifrajs/testing",
1287
+ "signature": "export interface CertifiableDomainEvent {\n readonly id: string;\n readonly type: string;\n readonly version?: number;\n readonly aggregateId: string;\n readonly payload: unknown;\n readonly timestamp: string;\n}"
1288
+ },
1289
+ {
1290
+ "name": "CertifiableEventDeliveryAdapter",
1291
+ "kind": "interface",
1292
+ "package": "@nifrajs/testing",
1293
+ "signature": "export interface CertifiableEventDeliveryAdapter {\n append(event: CertifiableDomainEvent): Promise<void>;\n claimPending(limit: number, now: string): Promise<CertifiableEventRecord[]>;\n markDelivered(id: string, claimId: string, at: string): Promise<boolean>;\n readPage(options?: {\n readonly after?: string;\n readonly limit?: number;\n }): Promise<{\n readonly records: readonly CertifiableEventRecord[];\n readonly nextPosition: string | null;\n readonly hasMore: boolean;\n }>;\n}"
1294
+ },
1295
+ {
1296
+ "name": "CertifiableEventRecord",
1297
+ "kind": "interface",
1298
+ "package": "@nifrajs/testing",
1299
+ "signature": "export interface CertifiableEventRecord {\n readonly position: string;\n readonly event: CertifiableDomainEvent;\n readonly claimId: string | null;\n}"
1300
+ },
1301
+ {
1302
+ "name": "CertifiableJobStore",
1303
+ "kind": "interface",
1304
+ "package": "@nifrajs/testing",
1305
+ "signature": "export interface CertifiableJobStore {\n enqueue(job: {\n name: string;\n payload: unknown;\n runAt: number;\n maxAttempts: number;\n }): string | Promise<string>;\n lease(now: number, limit: number, leaseMs: number): CertifiableStoredJob[] | Promise<CertifiableStoredJob[]>;\n complete(id: string): void | Promise<void>;\n retry(id: string, runAt: number): void | Promise<void>;\n deadLetter(id: string, error: string): void | Promise<void>;\n counts(): {\n pending: number;\n active: number;\n dead: number;\n } | Promise<{\n pending: number;\n active: number;\n dead: number;\n }>;\n}"
1306
+ },
1307
+ {
1308
+ "name": "CertifiableRuntimeAdapter",
1309
+ "kind": "interface",
1310
+ "package": "@nifrajs/testing",
1311
+ "signature": "export interface CertifiableRuntimeAdapter {\n start(app: {\n fetch(request: Request): Response | Promise<Response>;\n }): CertifiableRuntimeServer | Promise<CertifiableRuntimeServer>;\n}"
1312
+ },
1313
+ {
1314
+ "name": "CertifiableRuntimeServer",
1315
+ "kind": "interface",
1316
+ "package": "@nifrajs/testing",
1317
+ "signature": "export interface CertifiableRuntimeServer {\n readonly origin: string;\n stop(): void | Promise<void>;\n}"
1318
+ },
1319
+ {
1320
+ "name": "CertifiableStorageAdapter",
1321
+ "kind": "interface",
1322
+ "package": "@nifrajs/testing",
1323
+ "signature": "export interface CertifiableStorageAdapter {\n put(key: string, data: Uint8Array | ArrayBuffer | string, options?: {\n readonly contentType?: string;\n readonly metadata?: Readonly<Record<string, string>>;\n }): Promise<void>;\n get(key: string): Promise<CertifiableStorageObject | null>;\n delete(key: string): Promise<void>;\n exists(key: string): Promise<boolean>;\n list(options?: {\n readonly prefix?: string;\n readonly limit?: number;\n }): Promise<string[]>;\n listPage?(options?: {\n readonly prefix?: string;\n readonly limit?: number;\n readonly cursor?: string;\n }): Promise<{\n readonly keys: readonly string[];\n readonly cursor?: string;\n }>;\n presign?(key: string, operation: \"get\" | \"put\", options?: {\n readonly expiresInSeconds?: number;\n readonly contentType?: string;\n readonly contentLength?: number;\n }): Promise<{\n readonly url: string;\n readonly expiresAt?: Date;\n }>;\n copy?(sourceKey: string, destinationKey: string): Promise<void>;\n move?(sourceKey: string, destinationKey: string): Promise<void>;\n}"
1324
+ },
1325
+ {
1326
+ "name": "CertifiableStorageObject",
1327
+ "kind": "interface",
1328
+ "package": "@nifrajs/testing",
1329
+ "signature": "export interface CertifiableStorageObject {\n readonly body: Uint8Array;\n readonly size: number;\n readonly contentType?: string;\n readonly metadata?: Readonly<Record<string, string>>;\n}"
1330
+ },
1331
+ {
1332
+ "name": "CertifiableStoredJob",
1333
+ "kind": "interface",
1334
+ "package": "@nifrajs/testing",
1335
+ "signature": "export interface CertifiableStoredJob {\n readonly id: string;\n readonly name: string;\n readonly payload: unknown;\n readonly attempt: number;\n readonly maxAttempts: number;\n}"
1336
+ },
1337
+ {
1338
+ "name": "CertificationCapabilityEvidence",
644
1339
  "kind": "interface",
645
- "package": "@nifrajs/cache",
646
- "signature": "export interface CacheOptions {\n /** Storage adapter. Default: a fresh {@link MemoryCache}. */\n readonly store?: CacheStore;\n /** Default TTL (ms) for `set`/`wrap` when none is given. Default 60_000. */\n readonly defaultTtlMs?: number;\n /** Injectable clock (tests). Default `() => Date.now()`. */\n readonly now?: () => number;\n /** Called when a background SWR revalidation throws. Default: `console.error`. */\n readonly onError?: (error: unknown, key: string) => void;\n}"
1340
+ "package": "@nifrajs/testing",
1341
+ "signature": "export interface CertificationCapabilityEvidence {\n readonly capability: string;\n readonly status: \"passed\" | \"failed\";\n readonly checks: readonly string[];\n}"
647
1342
  },
648
1343
  {
649
- "name": "CacheOptions",
1344
+ "name": "CertificationCheck",
650
1345
  "kind": "interface",
651
- "package": "@nifrajs/middleware",
652
- "signature": "export interface CacheOptions {\n readonly store: ResponseCacheStore;\n /** Time to live in milliseconds. */\n readonly ttlMs: number;\n /** Methods cached. Default `[\"GET\", \"HEAD\"]`. */\n readonly methods?: readonly string[];\n /** Status predicate. Default: `200` only. */\n readonly status?: (status: number) => boolean;\n /** Header names included in the cache key and emitted in `Vary`. */\n readonly vary?: readonly string[];\n /** Custom cache key. Receives the normalized `vary` headers through the request itself. */\n readonly key?: (request: Request) => string;\n /** Maximum response bytes to store. Default `1_000_000`. Larger responses pass through. */\n readonly maxBytes?: number;\n /** Respect request `Cache-Control: no-cache/no-store`. Default `true`. */\n readonly respectRequestCacheControl?: boolean;\n /** Respect response `Cache-Control: private/no-store`. Default `true`. */\n readonly respectResponseCacheControl?: boolean;\n /** Cache responses with `Set-Cookie`. Default `false`. */\n readonly cacheSetCookie?: boolean;\n /** Cache responses to requests bearing `Authorization` or `Cookie` even when the response is not\n * explicitly `Cache-Control: public` (or `s-maxage`). Default `false`: a shared cache must not store a\n * personalized response (RFC 9111 §3.5), or it would be replayed to other users. Leave this off unless\n * the cached route is genuinely the same for every caller. */\n readonly cacheAuthenticated?: boolean;\n /** Response header for cache status. Default `\"x-nifra-cache\"`; set `false` to disable. */\n readonly cacheStatusHeader?: string | false;\n}"
1346
+ "package": "@nifrajs/testing",
1347
+ "signature": "export interface CertificationCheck<Adapter> {\n readonly id: string;\n readonly capability: string;\n readonly run: (adapter: Adapter, context: CertificationContext) => void | Promise<void>;\n}"
653
1348
  },
654
1349
  {
655
- "name": "CacheStore",
1350
+ "name": "CertificationCheckEvidence",
656
1351
  "kind": "interface",
657
- "package": "@nifrajs/cache",
658
- "signature": "export interface CacheStore {\n /** The live entry for `key`, or `undefined` if missing or hard-expired (`now >= expiresAt`). */\n get(key: string): StoredEntry | undefined | Promise<StoredEntry | undefined>;\n /** Store `entry` under `key`, indexed by `tags` for {@link CacheStore.invalidateTag}. */\n set(key: string, entry: StoredEntry, tags: readonly string[]): void | Promise<void>;\n delete(key: string): void | Promise<void>;\n /** Drop every entry carrying `tag`. */\n invalidateTag(tag: string): void | Promise<void>;\n clear(): void | Promise<void>;\n}",
659
- "doc": "/**\n * Raw key→entry storage. The default {@link MemoryCache} is in-process; implement this over CF KV /\n * Redis / etc. for a cache shared across instances. All methods may be sync or async — the cache awaits them.\n */"
1352
+ "package": "@nifrajs/testing",
1353
+ "signature": "export interface CertificationCheckEvidence {\n readonly id: string;\n readonly capability: string;\n readonly ok: boolean;\n /** Error class only. Messages may contain credentials/provider payloads and are never evidence. */\n readonly errorName?: string;\n}"
660
1354
  },
661
1355
  {
662
- "name": "CacheStore",
1356
+ "name": "CertificationContext",
663
1357
  "kind": "interface",
664
- "package": "@nifrajs/web",
665
- "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
- "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 */"
1358
+ "package": "@nifrajs/testing",
1359
+ "signature": "export interface CertificationContext {\n /** Deterministic per-check key safe for shared test backends and stable re-runs. */\n readonly key: (suffix: string) => string;\n}",
1360
+ "doc": "/**\n * Profile-based adapter certification. Profiles are structural and dependency-free: an adapter package\n * uses this only in its test/CI surface, while the resulting capability matrix is portable JSON evidence.\n */"
667
1361
  },
668
1362
  {
669
- "name": "canonical",
1363
+ "name": "certifyAdapter",
670
1364
  "kind": "function",
671
- "package": "@nifrajs/web",
672
- "signature": "export declare function canonical(href: string): LinkDescriptor;",
673
- "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 */"
1365
+ "package": "@nifrajs/testing",
1366
+ "signature": "export declare function certifyAdapter<Adapter>(options: {\n readonly profile: AdapterCertificationProfile<Adapter>;\n readonly adapterId: string;\n /** A fresh adapter per check prevents one failed check from contaminating the next. */\n readonly createAdapter: () => Adapter | Promise<Adapter>;\n readonly cleanup?: (adapter: Adapter) => void | Promise<void>;\n}): Promise<AdapterCertificationReport>;"
674
1367
  },
675
1368
  {
676
1369
  "name": "CheckDiagnostic",
677
1370
  "kind": "interface",
678
1371
  "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}",
1372
+ "signature": "export interface CheckDiagnostic {\n readonly rule: \"typecheck\" | \"typed-client\" | \"untyped-client\" | \"server-only-import\" | \"response-route\" | \"undeclared-dependency\" | \"duplicate-install\" | \"server-manifest-drift\" | \"manifest-drift\" | \"capability-assurance\" | \"capability-config\";\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
1373
  "doc": "/** A single machine-readable check failure — the unit an agent (or CI) acts on. */"
681
1374
  },
682
1375
  {
@@ -699,6 +1392,26 @@
699
1392
  "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
1393
  "doc": "/** One emitted chunk's measured size, in raw bytes + gzipped bytes (over-the-wire weight). */"
701
1394
  },
1395
+ {
1396
+ "name": "classificationAtLeast",
1397
+ "kind": "function",
1398
+ "package": "@nifrajs/core",
1399
+ "signature": "export declare function classificationAtLeast(value: DataClassification, floor: DataClassification): boolean;",
1400
+ "doc": "/** True when `value` is at least as sensitive as `floor` (e.g. `classificationAtLeast(x, \"pii\")`). */"
1401
+ },
1402
+ {
1403
+ "name": "classified",
1404
+ "kind": "function",
1405
+ "package": "@nifrajs/core",
1406
+ "signature": "export declare function classified<S extends object>(schema: S, classification: DataClassification): ClassifiedSchema<S>;",
1407
+ "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 */"
1408
+ },
1409
+ {
1410
+ "name": "ClassifiedSchema",
1411
+ "kind": "type",
1412
+ "package": "@nifrajs/core",
1413
+ "signature": "export type ClassifiedSchema<S extends object> = S & {\n readonly [CLASSIFICATION]: DataClassification;\n};"
1414
+ },
702
1415
  {
703
1416
  "name": "CLAUDE_MD_PATH",
704
1417
  "kind": "const",
@@ -778,6 +1491,19 @@
778
1491
  "package": "@nifrajs/web",
779
1492
  "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
1493
  },
1494
+ {
1495
+ "name": "collectAssuranceReport",
1496
+ "kind": "function",
1497
+ "package": "@nifrajs/cli",
1498
+ "signature": "export declare function collectAssuranceReport(cwd: string, configPath?: string): Promise<AssuranceReport>;"
1499
+ },
1500
+ {
1501
+ "name": "collectCapabilityProjectReport",
1502
+ "kind": "function",
1503
+ "package": "@nifrajs/cli",
1504
+ "signature": "export declare function collectCapabilityProjectReport(cwd: string, source: unknown, policyInput: CapabilityPolicy): Promise<CapabilityProjectReport>;",
1505
+ "doc": "/** Build coverage-qualified static evidence for every reflected route. */"
1506
+ },
781
1507
  {
782
1508
  "name": "collectCheckResult",
783
1509
  "kind": "function",
@@ -792,6 +1518,19 @@
792
1518
  "signature": "export declare function collectDoctorResult(cwd: string): Promise<DoctorResult>;",
793
1519
  "doc": "/** Run doctor against the project at `cwd`: diff source imports vs declared deps. */"
794
1520
  },
1521
+ {
1522
+ "name": "collectDuplicateInstalls",
1523
+ "kind": "function",
1524
+ "package": "@nifrajs/cli",
1525
+ "signature": "export declare function collectDuplicateInstalls(cwd: string, rootPackage: Record<string, unknown>): Promise<DuplicateInstallFinding[]>;",
1526
+ "doc": "/** Find identity-sensitive dependencies that resolve to multiple physical directories. Two copies at\n * the same version still fail: module identity (React hooks, Nifra symbols/registries) is path-based. */"
1527
+ },
1528
+ {
1529
+ "name": "CollectLevelsOptions",
1530
+ "kind": "interface",
1531
+ "package": "@nifrajs/cli",
1532
+ "signature": "export interface CollectLevelsOptions {\n readonly config?: string;\n /** Deterministic seed for the L4 invariant run. Default 1. */\n readonly seed?: number;\n}"
1533
+ },
795
1534
  {
796
1535
  "name": "collectPortResult",
797
1536
  "kind": "function",
@@ -806,6 +1545,13 @@
806
1545
  "signature": "export declare function collectTestResult(cwd: string, args?: TestToolArgs, opts?: {\n readonly signal?: AbortSignal;\n}): Promise<TestToolResult>;",
807
1546
  "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
1547
  },
1548
+ {
1549
+ "name": "collectVerificationLevels",
1550
+ "kind": "function",
1551
+ "package": "@nifrajs/cli",
1552
+ "signature": "export declare function collectVerificationLevels(cwd: string, options?: CollectLevelsOptions): Promise<VerificationLevelsResult>;",
1553
+ "doc": "/** Compute the ladder. Each level is evaluated independently, then gated on the levels below. */"
1554
+ },
809
1555
  {
810
1556
  "name": "combine",
811
1557
  "kind": "function",
@@ -859,7 +1605,7 @@
859
1605
  "kind": "function",
860
1606
  "package": "@nifrajs/web-react",
861
1607
  "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 */"
1608
+ "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
1609
  },
864
1610
  {
865
1611
  "name": "compose",
@@ -902,6 +1648,27 @@
902
1648
  "signature": "export declare function computed<T>(fn: () => T): () => T;",
903
1649
  "doc": "/** Derived value, cached into a signal — recomputes when its tracked inputs change. */"
904
1650
  },
1651
+ {
1652
+ "name": "computeEffectDigest",
1653
+ "kind": "function",
1654
+ "package": "@nifrajs/core",
1655
+ "signature": "export declare function computeEffectDigest(key: Uint8Array | CryptoKey, payload: Uint8Array): Promise<string>;",
1656
+ "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 */"
1657
+ },
1658
+ {
1659
+ "name": "computeIdempotencyFingerprint",
1660
+ "kind": "function",
1661
+ "package": "@nifrajs/core",
1662
+ "signature": "export declare function computeIdempotencyFingerprint(method: string, path: string, body: Uint8Array, contentType?: string): Promise<string>;",
1663
+ "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 */"
1664
+ },
1665
+ {
1666
+ "name": "computeUpgrade",
1667
+ "kind": "function",
1668
+ "package": "@nifrajs/cli",
1669
+ "signature": "export declare function computeUpgrade(cwd: string, recipe: UpgradeRecipe, write: boolean): UpgradePlan;",
1670
+ "doc": "/** Compute the plan (and, when `write`, apply it) for a target recipe against `cwd`. */"
1671
+ },
905
1672
  {
906
1673
  "name": "consoleAgentExporter",
907
1674
  "kind": "function",
@@ -979,7 +1746,7 @@
979
1746
  "name": "Context",
980
1747
  "kind": "interface",
981
1748
  "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}",
1749
+ "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
1750
  "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
1751
  },
985
1752
  {
@@ -1003,6 +1770,57 @@
1003
1770
  "signature": "export declare function contextStorage(): Middleware;",
1004
1771
  "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
1772
  },
1773
+ {
1774
+ "name": "continueCausality",
1775
+ "kind": "function",
1776
+ "package": "@nifrajs/core",
1777
+ "signature": "export declare function continueCausality(parent: CausalityContext, nodeKind: CausalityKind, id: string, options?: ContinueCausalityOptions): CausalityStep;",
1778
+ "doc": "/** Continue one execution from a single immediate parent. */"
1779
+ },
1780
+ {
1781
+ "name": "ContinueCausalityOptions",
1782
+ "kind": "interface",
1783
+ "package": "@nifrajs/core",
1784
+ "signature": "export interface ContinueCausalityOptions {\n /** Edge relation. Default `caused`. */\n readonly relation?: string;\n /** Epoch milliseconds. Injectable for deterministic tests. Default `Date.now()`. */\n readonly at?: number;\n /** A new observation opened for this exact node; otherwise the nearest anchor is propagated. */\n readonly trace?: CausalityTrace;\n}"
1785
+ },
1786
+ {
1787
+ "name": "ContractCaseContext",
1788
+ "kind": "interface",
1789
+ "package": "@nifrajs/testing",
1790
+ "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}",
1791
+ "doc": "/** Stable context passed to request/rejection hooks. It contains no request payloads or secrets. */"
1792
+ },
1793
+ {
1794
+ "name": "ContractCaseKind",
1795
+ "kind": "type",
1796
+ "package": "@nifrajs/testing",
1797
+ "signature": "export type ContractCaseKind = \"input-rejection\" | \"response-conformance\";"
1798
+ },
1799
+ {
1800
+ "name": "ContractCoverageGap",
1801
+ "kind": "interface",
1802
+ "package": "@nifrajs/testing",
1803
+ "signature": "export interface ContractCoverageGap {\n readonly route?: string;\n readonly target?: ContractTarget;\n readonly code: ContractCoverageGapCode;\n readonly message: string;\n}"
1804
+ },
1805
+ {
1806
+ "name": "ContractCoverageGapCode",
1807
+ "kind": "type",
1808
+ "package": "@nifrajs/testing",
1809
+ "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\";"
1810
+ },
1811
+ {
1812
+ "name": "ContractReplay",
1813
+ "kind": "interface",
1814
+ "package": "@nifrajs/testing",
1815
+ "signature": "export interface ContractReplay {\n readonly seed: number;\n readonly caseId: string;\n readonly runtime: string;\n}"
1816
+ },
1817
+ {
1818
+ "name": "ContractRuntime",
1819
+ "kind": "interface",
1820
+ "package": "@nifrajs/testing",
1821
+ "signature": "export interface ContractRuntime {\n readonly name: string;\n fetch(request: Request): Response | Promise<Response>;\n}",
1822
+ "doc": "/** A runtime target for the same generated contract cases (for example Bun, Node, and Workers). */"
1823
+ },
1006
1824
  {
1007
1825
  "name": "ContractShape",
1008
1826
  "kind": "type",
@@ -1010,6 +1828,26 @@
1010
1828
  "signature": "export type ContractShape = Record<string, OperationDef>;",
1011
1829
  "doc": "/** A contract: named operations. Names are the handler keys and OpenAPI operationIds. */"
1012
1830
  },
1831
+ {
1832
+ "name": "ContractTarget",
1833
+ "kind": "type",
1834
+ "package": "@nifrajs/testing",
1835
+ "signature": "export type ContractTarget = \"body\" | \"query\" | \"response\";"
1836
+ },
1837
+ {
1838
+ "name": "ContractTestApp",
1839
+ "kind": "interface",
1840
+ "package": "@nifrajs/testing",
1841
+ "signature": "export interface ContractTestApp {\n routes(): readonly unknown[];\n fetch(request: Request): Response | Promise<Response>;\n}",
1842
+ "doc": "/** Anything that exposes reflected routes and a Web-standard in-process fetch handler. */"
1843
+ },
1844
+ {
1845
+ "name": "ContractWitness",
1846
+ "kind": "interface",
1847
+ "package": "@nifrajs/testing",
1848
+ "signature": "export interface ContractWitness {\n readonly params?: Readonly<Record<string, string>>;\n readonly query?: unknown;\n readonly body?: unknown;\n readonly headers?: HeaderSource;\n}",
1849
+ "doc": "/** A known-good request. Missing body/query values are synthesized from inspectable JSON Schema. */"
1850
+ },
1013
1851
  {
1014
1852
  "name": "cookieJar",
1015
1853
  "kind": "function",
@@ -1050,6 +1888,13 @@
1050
1888
  "package": "@nifrajs/cli",
1051
1889
  "signature": "export declare function countBodyHits(lowerBody: string, group: SearchTermGroup, maxHits: number): number;"
1052
1890
  },
1891
+ {
1892
+ "name": "createAdmissionController",
1893
+ "kind": "function",
1894
+ "package": "@nifrajs/middleware",
1895
+ "signature": "export declare function createAdmissionController(options: AdmissionOptions): AdmissionControllerHandle;",
1896
+ "doc": "/**\n * Build a capacity-admission controller. Pass the returned handle as the server's `admission` option.\n */"
1897
+ },
1053
1898
  {
1054
1899
  "name": "createBunWsHandlers",
1055
1900
  "kind": "function",
@@ -1071,6 +1916,12 @@
1071
1916
  "signature": "export declare function createCachedAppLoader(cwd: string, options?: CachedAppLoaderOptions): (outDirName?: string) => Promise<LoadedApp>;",
1072
1917
  "doc": "/** Cache LoadedApp inside one MCP server process, invalidating when config/backend mtimes change. */"
1073
1918
  },
1919
+ {
1920
+ "name": "createCapabilityGuard",
1921
+ "kind": "function",
1922
+ "package": "@nifrajs/core",
1923
+ "signature": "export declare function createCapabilityGuard(allowed: readonly string[], method: string, path: string, onUse: ((event: CapabilityUseEvent) => void) | undefined): CapabilityGuard;"
1924
+ },
1074
1925
  {
1075
1926
  "name": "createClientRouter",
1076
1927
  "kind": "function",
@@ -1091,6 +1942,27 @@
1091
1942
  "signature": "export declare function createDevServer(options: DevServerOptions): Promise<DevServer>;",
1092
1943
  "doc": "/** Start the dev server: build → serve → watch → rebuild + reload on change. */"
1093
1944
  },
1945
+ {
1946
+ "name": "createEventLoopLagSampler",
1947
+ "kind": "function",
1948
+ "package": "@nifrajs/middleware",
1949
+ "signature": "export declare function createEventLoopLagSampler(resolutionMs?: number, monitor?: LoopDelayMonitor): () => number;",
1950
+ "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 */"
1951
+ },
1952
+ {
1953
+ "name": "createEventRegistry",
1954
+ "kind": "function",
1955
+ "package": "@nifrajs/events",
1956
+ "signature": "export declare function createEventRegistry(contracts: readonly EventContract[]): EventRegistry;",
1957
+ "doc": "/** Build a registry from a set of contracts. Throws on a duplicate `type@version`. */"
1958
+ },
1959
+ {
1960
+ "name": "createFailureLab",
1961
+ "kind": "function",
1962
+ "package": "@nifrajs/testing",
1963
+ "signature": "export declare function createFailureLab(options: FailureLabOptions): FailureLab;",
1964
+ "doc": "/** Build one isolated deterministic controller. Construct a fresh lab for every replay. */"
1965
+ },
1094
1966
  {
1095
1967
  "name": "createFetcher",
1096
1968
  "kind": "function",
@@ -1137,6 +2009,27 @@
1137
2009
  "package": "@nifrajs/mcp",
1138
2010
  "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
2011
  },
2012
+ {
2013
+ "name": "createMemoryCausalityStore",
2014
+ "kind": "function",
2015
+ "package": "@nifrajs/core",
2016
+ "signature": "export declare function createMemoryCausalityStore(options?: MemoryCausalityStoreOptions): CausalityGraphStore;",
2017
+ "doc": "/** Bounded dev/test graph store. Production callers should provide a durable adapter. */"
2018
+ },
2019
+ {
2020
+ "name": "createMemoryIdempotencyStore",
2021
+ "kind": "function",
2022
+ "package": "@nifrajs/core",
2023
+ "signature": "export declare function createMemoryIdempotencyStore(options?: MemoryIdempotencyStoreOptions): MemoryIdempotencyStore;",
2024
+ "doc": "/** Convenience factory mirroring the other core primitives' `create*` style. */"
2025
+ },
2026
+ {
2027
+ "name": "createMemoryLedgerSink",
2028
+ "kind": "function",
2029
+ "package": "@nifrajs/core",
2030
+ "signature": "export declare function createMemoryLedgerSink(options?: MemoryLedgerSinkOptions): MemoryLedgerSink;",
2031
+ "doc": "/** Bounded in-memory sink for tests and local development. Token-only, like every sink. */"
2032
+ },
1140
2033
  {
1141
2034
  "name": "createMockServer",
1142
2035
  "kind": "function",
@@ -1144,6 +2037,13 @@
1144
2037
  "signature": "export declare function createMockServer(app: MockableApp, options?: MockServerOptions | undefined): MockServer;",
1145
2038
  "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
2039
  },
2040
+ {
2041
+ "name": "createMutation",
2042
+ "kind": "function",
2043
+ "package": "@nifrajs/web",
2044
+ "signature": "export declare function createMutation<TData, TVariables>(fn: (variables: TVariables) => Promise<TData>, callbacks?: MutationCallbacks<TData, TVariables>): MutationHandle<TData, TVariables>;",
2045
+ "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 */"
2046
+ },
1147
2047
  {
1148
2048
  "name": "createObservationLifecycle",
1149
2049
  "kind": "function",
@@ -1178,6 +2078,32 @@
1178
2078
  "signature": "export declare function createQueue(options?: QueueOptions): Queue;",
1179
2079
  "doc": "/** Create a job queue. Define jobs, enqueue payloads, and `start()` a worker (or `drain()` once). */"
1180
2080
  },
2081
+ {
2082
+ "name": "createRequestBudget",
2083
+ "kind": "function",
2084
+ "package": "@nifrajs/core",
2085
+ "signature": "export declare function createRequestBudget(options: CreateRequestBudgetOptions): RequestBudget;",
2086
+ "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 */"
2087
+ },
2088
+ {
2089
+ "name": "CreateRequestBudgetOptions",
2090
+ "kind": "interface",
2091
+ "package": "@nifrajs/core",
2092
+ "signature": "export interface CreateRequestBudgetOptions {\n /** Absolute Unix epoch deadline. */\n readonly deadline: number;\n readonly signal: AbortSignal;\n readonly clock?: BudgetClock;\n}"
2093
+ },
2094
+ {
2095
+ "name": "createRequestLedger",
2096
+ "kind": "function",
2097
+ "package": "@nifrajs/core",
2098
+ "signature": "export declare function createRequestLedger(options: CreateRequestLedgerOptions): RequestLedger;",
2099
+ "doc": "/** Create a bounded per-request ledger. The server wires one per capability-declaring route. */"
2100
+ },
2101
+ {
2102
+ "name": "CreateRequestLedgerOptions",
2103
+ "kind": "interface",
2104
+ "package": "@nifrajs/core",
2105
+ "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}"
2106
+ },
1181
2107
  {
1182
2108
  "name": "createScheduler",
1183
2109
  "kind": "function",
@@ -1185,6 +2111,13 @@
1185
2111
  "signature": "export declare function createScheduler(options?: SchedulerOptions): Scheduler;",
1186
2112
  "doc": "/** Create an in-process cron scheduler. */"
1187
2113
  },
2114
+ {
2115
+ "name": "createSeededRandom",
2116
+ "kind": "function",
2117
+ "package": "@nifrajs/core",
2118
+ "signature": "export declare function createSeededRandom(seed: number): () => number;",
2119
+ "doc": "/** Deterministic PRNG (mulberry32). Ambient randomness would make failures unreproducible. */"
2120
+ },
1188
2121
  {
1189
2122
  "name": "createSessions",
1190
2123
  "kind": "function",
@@ -1198,6 +2131,13 @@
1198
2131
  "signature": "export declare function createStylesheetEmitter(build: PluginBuilder, namespace: string): StylesheetEmitter;",
1199
2132
  "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
2133
  },
2134
+ {
2135
+ "name": "createUnboundedRequestBudget",
2136
+ "kind": "function",
2137
+ "package": "@nifrajs/core",
2138
+ "signature": "export declare function createUnboundedRequestBudget(signal: AbortSignal): RequestBudget;",
2139
+ "doc": "/** Create a local no-deadline view. Outbound header propagation deliberately omits it. */"
2140
+ },
1201
2141
  {
1202
2142
  "name": "createViteDevServer",
1203
2143
  "kind": "function",
@@ -1216,7 +2156,7 @@
1216
2156
  "name": "CreateWebAppOptions",
1217
2157
  "kind": "interface",
1218
2158
  "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.** When `api` exposes a callable `.fetch(url, init)` (every `inProcessClient(backend)`\n * does — see {@link isMountableApi}), `createWebApp` also serves that backend over HTTP at\n * {@link apiPrefix} (default `/api`): a request whose pathname starts with the prefix is dispatched\n * straight to `api.fetch(req.url, req)` before page routing, and the backend's `Response` is returned\n * untouched. This closes the reported gap where `POST /api/sync` / `/api/auth/*` 404/405'd against the\n * page router until the app author hand-wrote an `if (pathname.startsWith(\"/api/\")) …` branch in\n * `server-bun.ts`. The mount runs in `nifra dev` too (the Vite dev server dispatches every request\n * through this same app). Pass `apiPrefix: \"\"` to disable it (pages-only). */\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 no callable `.fetch` (e.g. a plain object passed as `ctx.api`). */\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}"
2159
+ "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
2160
  },
1221
2161
  {
1222
2162
  "name": "CronError",
@@ -1284,6 +2224,13 @@
1284
2224
  "package": "create-nifra",
1285
2225
  "signature": "export declare const CURSOR_MCP_JSON_PATH = \".cursor/mcp.json\";"
1286
2226
  },
2227
+ {
2228
+ "name": "DATA_CLASSIFICATION_RANK",
2229
+ "kind": "const",
2230
+ "package": "@nifrajs/core",
2231
+ "signature": "export declare const DATA_CLASSIFICATION_RANK: Readonly<Record<DataClassification, number>>;",
2232
+ "doc": "/** Total order over classifications; higher = more sensitive. */"
2233
+ },
1287
2234
  {
1288
2235
  "name": "DATA_GLOBAL",
1289
2236
  "kind": "const",
@@ -1298,6 +2245,13 @@
1298
2245
  "signature": "export declare const DATA_HEADER = \"x-nifra-data\";",
1299
2246
  "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
2247
  },
2248
+ {
2249
+ "name": "DataClassification",
2250
+ "kind": "type",
2251
+ "package": "@nifrajs/core",
2252
+ "signature": "export type DataClassification = \"public\" | \"pii\" | \"secret\";",
2253
+ "doc": "/** Sensitivity of the data a response carries. Ordered `public` < `pii` < `secret`. */"
2254
+ },
1301
2255
  {
1302
2256
  "name": "dataFileFor",
1303
2257
  "kind": "function",
@@ -1330,6 +2284,50 @@
1330
2284
  "package": "create-nifra",
1331
2285
  "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
2286
  },
2287
+ {
2288
+ "name": "DeadlineAdmission",
2289
+ "kind": "type",
2290
+ "package": "@nifrajs/core",
2291
+ "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};"
2292
+ },
2293
+ {
2294
+ "name": "DeadlineAdmissionOptions",
2295
+ "kind": "interface",
2296
+ "package": "@nifrajs/core",
2297
+ "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}"
2298
+ },
2299
+ {
2300
+ "name": "DeadlineExceededError",
2301
+ "kind": "class",
2302
+ "package": "@nifrajs/core",
2303
+ "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}"
2304
+ },
2305
+ {
2306
+ "name": "DeadlineHeaderResult",
2307
+ "kind": "type",
2308
+ "package": "@nifrajs/core",
2309
+ "signature": "export type DeadlineHeaderResult = {\n readonly ok: true;\n readonly deadline: number;\n} | {\n readonly ok: false;\n readonly reason: \"missing\" | \"malformed\";\n};"
2310
+ },
2311
+ {
2312
+ "name": "DeadlineHeadersInit",
2313
+ "kind": "type",
2314
+ "package": "@nifrajs/core",
2315
+ "signature": "export type DeadlineHeadersInit = Headers | Readonly<Record<string, string>> | [string, string][] | undefined;",
2316
+ "doc": "/** DOM-lib-independent subset accepted by the Web `Headers` constructor. */"
2317
+ },
2318
+ {
2319
+ "name": "declarationApplies",
2320
+ "kind": "function",
2321
+ "package": "@nifrajs/core",
2322
+ "signature": "export declare function declarationApplies(declaration: AssuranceDeclaration, method: string, path: string): boolean;"
2323
+ },
2324
+ {
2325
+ "name": "declaredCapabilities",
2326
+ "kind": "function",
2327
+ "package": "@nifrajs/core",
2328
+ "signature": "export declare function declaredCapabilities(context: object): readonly string[];",
2329
+ "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 */"
2330
+ },
1333
2331
  {
1334
2332
  "name": "decodeBase64",
1335
2333
  "kind": "function",
@@ -1350,6 +2348,12 @@
1350
2348
  "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
2349
  "doc": "/** A decoded image: RGBA pixels + dimensions — the lingua franca of WASM codecs (jSquash, Photon, …). */"
1352
2350
  },
2351
+ {
2352
+ "name": "DEFAULT_ASSURANCE_CONFIG",
2353
+ "kind": "const",
2354
+ "package": "@nifrajs/cli",
2355
+ "signature": "export declare const DEFAULT_ASSURANCE_CONFIG = \"nifra.assurance.ts\";"
2356
+ },
1353
2357
  {
1354
2358
  "name": "DEFAULT_DEV_PORT",
1355
2359
  "kind": "const",
@@ -1357,6 +2361,33 @@
1357
2361
  "signature": "export declare const DEFAULT_DEV_PORT = 4321;",
1358
2362
  "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
2363
  },
2364
+ {
2365
+ "name": "DEFAULT_IDEMPOTENCY_HEADER",
2366
+ "kind": "const",
2367
+ "package": "@nifrajs/core",
2368
+ "signature": "export declare const DEFAULT_IDEMPOTENCY_HEADER = \"idempotency-key\";",
2369
+ "doc": "/** Canonical request header carrying the client-chosen idempotency key. */"
2370
+ },
2371
+ {
2372
+ "name": "DEFAULT_IDEMPOTENCY_TTL_MS",
2373
+ "kind": "const",
2374
+ "package": "@nifrajs/core",
2375
+ "signature": "export declare const DEFAULT_IDEMPOTENCY_TTL_MS = 86400000;",
2376
+ "doc": "/** Default retention for a stored idempotent response: 24 hours. */"
2377
+ },
2378
+ {
2379
+ "name": "DEFAULT_MANIFEST_FILE",
2380
+ "kind": "const",
2381
+ "package": "@nifrajs/cli",
2382
+ "signature": "export declare const DEFAULT_MANIFEST_FILE = \"nifra.manifest.json\";"
2383
+ },
2384
+ {
2385
+ "name": "DEFAULT_MAX_ENTRIES",
2386
+ "kind": "const",
2387
+ "package": "@nifrajs/core",
2388
+ "signature": "export declare const DEFAULT_MAX_ENTRIES = 1000;",
2389
+ "doc": "/** Per-request entry bound. Generous for real handlers, small enough to stop a runaway loop. */"
2390
+ },
1360
2391
  {
1361
2392
  "name": "DEFAULT_SNAPSHOT_FILE",
1362
2393
  "kind": "const",
@@ -1391,6 +2422,34 @@
1391
2422
  "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
2423
  "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
2424
  },
2425
+ {
2426
+ "name": "defineAssuranceConfig",
2427
+ "kind": "function",
2428
+ "package": "@nifrajs/core",
2429
+ "signature": "export declare function defineAssuranceConfig(config: AssuranceConfig): AssuranceConfig;",
2430
+ "doc": "/** Identity helper for a `nifra.assurance.ts` default export. */"
2431
+ },
2432
+ {
2433
+ "name": "defineAssurancePolicy",
2434
+ "kind": "function",
2435
+ "package": "@nifrajs/core",
2436
+ "signature": "export declare function defineAssurancePolicy(policy: AssurancePolicy): AssurancePolicy;",
2437
+ "doc": "/** Validate and freeze an ordered assurance policy. */"
2438
+ },
2439
+ {
2440
+ "name": "defineCapabilityPolicy",
2441
+ "kind": "function",
2442
+ "package": "@nifrajs/core",
2443
+ "signature": "export declare function defineCapabilityPolicy(policy: CapabilityPolicy): CapabilityPolicy;",
2444
+ "doc": "/** Validate and freeze a capability/provenance policy. */"
2445
+ },
2446
+ {
2447
+ "name": "defineCertificationProfile",
2448
+ "kind": "function",
2449
+ "package": "@nifrajs/testing",
2450
+ "signature": "export declare function defineCertificationProfile<Adapter>(profile: AdapterCertificationProfile<Adapter>): AdapterCertificationProfile<Adapter>;",
2451
+ "doc": "/** Define and validate a custom domain/provider profile at module initialization. */"
2452
+ },
1394
2453
  {
1395
2454
  "name": "defineContract",
1396
2455
  "kind": "function",
@@ -1411,6 +2470,13 @@
1411
2470
  "package": "@nifrajs/env",
1412
2471
  "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
2472
  },
2473
+ {
2474
+ "name": "defineEventContract",
2475
+ "kind": "function",
2476
+ "package": "@nifrajs/events",
2477
+ "signature": "export declare function defineEventContract<Schema extends StandardSchemaV1>(spec: {\n type: string;\n version: number;\n payload: Schema;\n}): EventContract<Schema>;",
2478
+ "doc": "/** Define a portable, versioned event contract. */"
2479
+ },
1414
2480
  {
1415
2481
  "name": "defineIdentityPlugin",
1416
2482
  "kind": "function",
@@ -1428,7 +2494,7 @@
1428
2494
  "name": "DefineMcpToolOptions",
1429
2495
  "kind": "interface",
1430
2496
  "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 like ShipNow). */\n readonly intent?: McpUiIntent;\n readonly handler: (args: Record<string, unknown>, context: McpToolContext) => McpToolHandlerResult | Promise<McpToolHandlerResult>;\n}"
2497
+ "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
2498
  },
1433
2499
  {
1434
2500
  "name": "defineMcpWidget",
@@ -1456,6 +2522,13 @@
1456
2522
  "signature": "export declare const defineRouterPlugin: typeof defineIdentityPlugin;",
1457
2523
  "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
2524
  },
2525
+ {
2526
+ "name": "DehydratedState",
2527
+ "kind": "interface",
2528
+ "package": "@nifrajs/web",
2529
+ "signature": "export interface DehydratedState {\n readonly queries: ReadonlyArray<{\n readonly key: unknown;\n readonly data: unknown;\n readonly updatedAt: number;\n }>;\n}",
2530
+ "doc": "/** A serializable snapshot of the cache's successful queries — the SSR→client bridge payload. */"
2531
+ },
1459
2532
  {
1460
2533
  "name": "describeProject",
1461
2534
  "kind": "function",
@@ -1557,6 +2630,13 @@
1557
2630
  "package": "@nifrajs/devtools",
1558
2631
  "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
2632
  },
2633
+ {
2634
+ "name": "diffCapabilitySnapshots",
2635
+ "kind": "function",
2636
+ "package": "@nifrajs/cli",
2637
+ "signature": "export declare function diffCapabilitySnapshots(before: CapabilitySnapshot, after: CapabilitySnapshot): readonly string[];",
2638
+ "doc": "/** Exact lockfile drift. Human approval is supplied by reviewing the checked-in lockfile change. */"
2639
+ },
1560
2640
  {
1561
2641
  "name": "diffManifestRoutes",
1562
2642
  "kind": "function",
@@ -1564,6 +2644,13 @@
1564
2644
  "signature": "export declare function diffManifestRoutes(manifestFiles: readonly string[], discoveredFiles: readonly string[]): ManifestDrift;",
1565
2645
  "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
2646
  },
2647
+ {
2648
+ "name": "diffNifraManifests",
2649
+ "kind": "function",
2650
+ "package": "@nifrajs/core",
2651
+ "signature": "export declare function diffNifraManifests(before: NifraManifest, after: NifraManifest): NifraManifestDiff;",
2652
+ "doc": "/** Contract changes reuse the route-diff engine; governance changes fail closed on expanded risk. */"
2653
+ },
1567
2654
  {
1568
2655
  "name": "diffRouteSnapshots",
1569
2656
  "kind": "function",
@@ -1635,7 +2722,7 @@
1635
2722
  "name": "DoctorResult",
1636
2723
  "kind": "interface",
1637
2724
  "package": "@nifrajs/cli",
1638
- "signature": "export interface DoctorResult {\n readonly ok: boolean;\n /** `false` when no `package.json` was found at cwd — doctor can't run (reported, not a crash). */\n readonly ran: boolean;\n readonly findings: readonly DoctorFinding[];\n /** Dependencies written by `--auto-fix` / MCP `autoFix:true`. */\n readonly fixed?: readonly DoctorAppliedFix[];\n /** Findings that were safe to report but not safe to write automatically. */\n readonly skippedFixes?: readonly DoctorSkippedFix[];\n}"
2725
+ "signature": "export interface DoctorResult {\n readonly ok: boolean;\n /** `false` when no `package.json` was found at cwd — doctor can't run (reported, not a crash). */\n readonly ran: boolean;\n readonly findings: readonly DoctorFinding[];\n /** Packages that resolve to more than one physical install across this workspace. */\n readonly duplicateInstalls: readonly DuplicateInstallFinding[];\n /** Dependencies written by `--auto-fix` / MCP `autoFix:true`. */\n readonly fixed?: readonly DoctorAppliedFix[];\n /** Findings that were safe to report but not safe to write automatically. */\n readonly skippedFixes?: readonly DoctorSkippedFix[];\n}"
1639
2726
  },
1640
2727
  {
1641
2728
  "name": "DoctorSkippedFix",
@@ -1664,6 +2751,18 @@
1664
2751
  "signature": "export declare function drainCapped(body: ReadableStream<Uint8Array>, maxBytes: number): Promise<{\n ok: true;\n bytes: Uint8Array;\n} | {\n ok: false;\n status: 413;\n}>;",
1665
2752
  "doc": "/** The shared streaming byte-cap loop: read until done, or cancel + 413 once over `maxBytes`.\n * A single-chunk body (the common case for small chunked payloads) returns the runtime's own\n * chunk directly — no chunk array, no copy-merge. */"
1666
2753
  },
2754
+ {
2755
+ "name": "DuplicateInstallCopy",
2756
+ "kind": "interface",
2757
+ "package": "@nifrajs/cli",
2758
+ "signature": "export interface DuplicateInstallCopy {\n /** Installed version, or `unknown` when package metadata is incomplete. */\n readonly version: string;\n /** Physical package directory, relative to the doctor root when possible. */\n readonly path: string;\n /** Workspace package roots whose normal Node/Bun resolution selects this copy. */\n readonly importers: readonly string[];\n}"
2759
+ },
2760
+ {
2761
+ "name": "DuplicateInstallFinding",
2762
+ "kind": "interface",
2763
+ "package": "@nifrajs/cli",
2764
+ "signature": "export interface DuplicateInstallFinding {\n readonly package: string;\n readonly copies: readonly DuplicateInstallCopy[];\n}"
2765
+ },
1667
2766
  {
1668
2767
  "name": "DurableObjectNamespaceLike",
1669
2768
  "kind": "interface",
@@ -1678,6 +2777,69 @@
1678
2777
  "signature": "export declare function effect(fn: () => void): () => void;",
1679
2778
  "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
2779
  },
2780
+ {
2781
+ "name": "EffectChain",
2782
+ "kind": "interface",
2783
+ "package": "@nifrajs/core",
2784
+ "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}",
2785
+ "doc": "/** Tamper-evidence over the route identity, declarations, and sealed entries. */"
2786
+ },
2787
+ {
2788
+ "name": "EffectCost",
2789
+ "kind": "type",
2790
+ "package": "@nifrajs/core",
2791
+ "signature": "export type EffectCost = Readonly<Record<string, number>>;",
2792
+ "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 */"
2793
+ },
2794
+ {
2795
+ "name": "EffectEntry",
2796
+ "kind": "interface",
2797
+ "package": "@nifrajs/core",
2798
+ "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}",
2799
+ "doc": "/** One recorded effect. Frozen; token-only by construction (no payload field exists). */"
2800
+ },
2801
+ {
2802
+ "name": "EffectEntryInput",
2803
+ "kind": "interface",
2804
+ "package": "@nifrajs/core",
2805
+ "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}",
2806
+ "doc": "/** Caller-supplied fields for one entry. Everything else (`seq`, `at`) is assigned by the ledger. */"
2807
+ },
2808
+ {
2809
+ "name": "effectLedgerOf",
2810
+ "kind": "function",
2811
+ "package": "@nifrajs/core",
2812
+ "signature": "export declare function effectLedgerOf(context: object): RequestLedger | undefined;",
2813
+ "doc": "/** The request's effect ledger, when the server enabled one for this route. Read-only access. */"
2814
+ },
2815
+ {
2816
+ "name": "EffectLedgerOptions",
2817
+ "kind": "interface",
2818
+ "package": "@nifrajs/core",
2819
+ "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}",
2820
+ "doc": "/** Server-level effect ledger configuration (see `server({ effectLedger })`). */"
2821
+ },
2822
+ {
2823
+ "name": "EffectLedgerOverflowError",
2824
+ "kind": "class",
2825
+ "package": "@nifrajs/core",
2826
+ "signature": "export declare class EffectLedgerOverflowError extends Error {\n readonly maxEntries: number;\n constructor(maxEntries: number);\n}",
2827
+ "doc": "/** Thrown by `append` when the per-request entry bound is exceeded. Fails the request closed. */"
2828
+ },
2829
+ {
2830
+ "name": "EffectLedgerSealedError",
2831
+ "kind": "class",
2832
+ "package": "@nifrajs/core",
2833
+ "signature": "export declare class EffectLedgerSealedError extends Error {\n constructor();\n}",
2834
+ "doc": "/** Thrown by `append` after `seal()` — e.g. an effect attempted while streaming a response body. */"
2835
+ },
2836
+ {
2837
+ "name": "EffectPhase",
2838
+ "kind": "type",
2839
+ "package": "@nifrajs/core",
2840
+ "signature": "export type EffectPhase = \"intent\" | \"committed\" | \"failed\" | \"compensated\";",
2841
+ "doc": "/** Lifecycle phase of one effect. `intent` precedes execution; the rest describe its outcome. */"
2842
+ },
1681
2843
  {
1682
2844
  "name": "EMPTY_PARAMS",
1683
2845
  "kind": "const",
@@ -1827,6 +2989,58 @@
1827
2989
  "package": "@nifrajs/middleware",
1828
2990
  "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
2991
  },
2992
+ {
2993
+ "name": "evaluateCapabilityAssurance",
2994
+ "kind": "function",
2995
+ "package": "@nifrajs/core",
2996
+ "signature": "export declare function evaluateCapabilityAssurance(source: unknown, policyInput: CapabilityPolicy, evidenceSet: CapabilityEvidenceSet): CapabilityAssuranceReport;",
2997
+ "doc": "/** Compare declared route capabilities against coverage-qualified static/runtime evidence. */"
2998
+ },
2999
+ {
3000
+ "name": "evaluateRouteAssurance",
3001
+ "kind": "function",
3002
+ "package": "@nifrajs/core",
3003
+ "signature": "export declare function evaluateRouteAssurance(source: unknown, policyInput: AssurancePolicy): AssuranceReport;",
3004
+ "doc": "/** Evaluate reflected route evidence against the first matching policy rule. */"
3005
+ },
3006
+ {
3007
+ "name": "EventContract",
3008
+ "kind": "interface",
3009
+ "package": "@nifrajs/events",
3010
+ "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 causality?: CausalityContext;\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}"
3011
+ },
3012
+ {
3013
+ "name": "EventContractError",
3014
+ "kind": "class",
3015
+ "package": "@nifrajs/events",
3016
+ "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}",
3017
+ "doc": "/** Thrown by {@link EventContract.create} when the payload fails the contract schema. */"
3018
+ },
3019
+ {
3020
+ "name": "eventDeliveryCertificationProfile",
3021
+ "kind": "function",
3022
+ "package": "@nifrajs/testing",
3023
+ "signature": "export declare function eventDeliveryCertificationProfile(): AdapterCertificationProfile<CertifiableEventDeliveryAdapter>;"
3024
+ },
3025
+ {
3026
+ "name": "EventEnvelope",
3027
+ "kind": "interface",
3028
+ "package": "@nifrajs/events",
3029
+ "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 /** Optional durable lineage. Its current node must be this exact event id. */\n readonly causality?: CausalityContext;\n readonly payload: Payload;\n}",
3030
+ "doc": "/** The portable wire shape: identity + versioned type + timestamp + validated payload. */"
3031
+ },
3032
+ {
3033
+ "name": "EventParseResult",
3034
+ "kind": "type",
3035
+ "package": "@nifrajs/events",
3036
+ "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};"
3037
+ },
3038
+ {
3039
+ "name": "EventRegistry",
3040
+ "kind": "interface",
3041
+ "package": "@nifrajs/events",
3042
+ "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}"
3043
+ },
1830
3044
  {
1831
3045
  "name": "Evidence",
1832
3046
  "kind": "interface",
@@ -1882,6 +3096,61 @@
1882
3096
  "signature": "export declare function extractBackendTools(backend: unknown): McpTool[];",
1883
3097
  "doc": "/** Extract tools registered via .tool() routes on the Nifra backend. Exported for the test that proves a\n * `server().tool()` route surfaces in `tools/list` and executes through `tools/call`. */"
1884
3098
  },
3099
+ {
3100
+ "name": "FailureDirective",
3101
+ "kind": "type",
3102
+ "package": "@nifrajs/testing",
3103
+ "signature": "export type FailureDirective = (FailureDirectiveBase & {\n readonly kind: \"crash\";\n}) | (FailureDirectiveBase & {\n readonly kind: \"duplicate-delivery\";\n /** Total copies of every delivery, including the original. Default 2, maximum 10. */\n readonly copies?: number;\n}) | (FailureDirectiveBase & {\n readonly kind: \"reorder-events\";\n}) | (FailureDirectiveBase & {\n readonly kind: \"delay\";\n readonly delayMs: number;\n}) | (FailureDirectiveBase & {\n readonly kind: \"expire-budget\";\n}) | (FailureDirectiveBase & {\n readonly kind: \"lose-provider-reply\";\n}) | (FailureDirectiveBase & {\n readonly kind: \"contend-checkpoint\";\n});"
3104
+ },
3105
+ {
3106
+ "name": "FailureEvidence",
3107
+ "kind": "interface",
3108
+ "package": "@nifrajs/testing",
3109
+ "signature": "export interface FailureEvidence {\n readonly sequence: number;\n readonly kind: FailureKind;\n readonly point: string;\n readonly occurrence: number;\n readonly virtualTimeMs: number;\n}"
3110
+ },
3111
+ {
3112
+ "name": "FailureInjectedError",
3113
+ "kind": "class",
3114
+ "package": "@nifrajs/testing",
3115
+ "signature": "export declare class FailureInjectedError extends Error {\n readonly kind: \"crash\" | \"lose-provider-reply\";\n readonly point: string;\n readonly occurrence: number;\n readonly name = \"FailureInjectedError\";\n constructor(kind: \"crash\" | \"lose-provider-reply\", point: string, occurrence: number);\n}"
3116
+ },
3117
+ {
3118
+ "name": "FailureKind",
3119
+ "kind": "type",
3120
+ "package": "@nifrajs/testing",
3121
+ "signature": "export type FailureKind = \"crash\" | \"duplicate-delivery\" | \"reorder-events\" | \"delay\" | \"expire-budget\" | \"lose-provider-reply\" | \"contend-checkpoint\";",
3122
+ "doc": "/**\n * Deterministic durable-failure laboratory.\n *\n * The controller is an off-hot-path port: tests place named checkpoints around real adapters and a\n * replayable schedule injects crashes, duplicate/reordered delivery, virtual delay, deadline expiry,\n * lost provider replies, or checkpoint contention. Evidence contains tokens only - never payloads,\n * provider results, exception messages, or stacks.\n */"
3123
+ },
3124
+ {
3125
+ "name": "FailureLab",
3126
+ "kind": "interface",
3127
+ "package": "@nifrajs/testing",
3128
+ "signature": "export interface FailureLab {\n /** Apply virtual delay and/or crash directives at a named durability seam. */\n checkpoint(point: string): void;\n /** Apply duplicate/reorder directives to a delivery batch without inspecting its values. */\n deliveries<T>(point: string, values: readonly T[]): readonly T[];\n /** Run the provider operation, then optionally lose only its reply. */\n provider<T>(point: string, operation: () => T | Promise<T>): Promise<T>;\n /** Return zero when this budget seam is scheduled to expire; otherwise clamp the supplied value. */\n remaining(point: string, remainingMs: number): number;\n /** True only for a scheduled checkpoint conflict occurrence. */\n checkpointContended(point: string): boolean;\n /** Current virtual time. */\n now(): number;\n /** Immutable, token-only injection evidence. */\n evidence(): readonly FailureEvidence[];\n /** Exact normalized replay inputs. */\n replay(): FailureReplay;\n}"
3129
+ },
3130
+ {
3131
+ "name": "FailureLabOptions",
3132
+ "kind": "interface",
3133
+ "package": "@nifrajs/testing",
3134
+ "signature": "export interface FailureLabOptions {\n /** Replayable unsigned seed. Default is stable. */\n readonly seed?: number;\n readonly schedule: readonly FailureDirective[];\n /** Virtual epoch/monotonic start. No real sleep is ever performed. Default 0. */\n readonly startTimeMs?: number;\n}"
3135
+ },
3136
+ {
3137
+ "name": "FailureReplay",
3138
+ "kind": "interface",
3139
+ "package": "@nifrajs/testing",
3140
+ "signature": "export interface FailureReplay {\n readonly seed: number;\n readonly schedule: readonly NormalizedFailureDirective[];\n}"
3141
+ },
3142
+ {
3143
+ "name": "FailureScenario",
3144
+ "kind": "interface",
3145
+ "package": "@nifrajs/testing",
3146
+ "signature": "export interface FailureScenario<Output> {\n readonly name: string;\n execute(lab: FailureLab): Output | Promise<Output>;\n /** The scenario passes only when this post-failure invariant returns true. */\n verify(context: {\n readonly lab: FailureLab;\n readonly result?: Output;\n readonly error?: unknown;\n }): boolean | Promise<boolean>;\n}"
3147
+ },
3148
+ {
3149
+ "name": "FailureScenarioReport",
3150
+ "kind": "interface",
3151
+ "package": "@nifrajs/testing",
3152
+ "signature": "export interface FailureScenarioReport {\n readonly name: string;\n readonly ok: boolean;\n readonly replay: FailureReplay;\n readonly evidence: readonly FailureEvidence[];\n /** Sanitized failure identity. Messages and stacks are deliberately excluded. */\n readonly error?: {\n readonly name: string;\n readonly kind?: FailureInjectedError[\"kind\"];\n };\n}"
3153
+ },
1885
3154
  {
1886
3155
  "name": "FEATURE_IDS",
1887
3156
  "kind": "const",
@@ -2086,6 +3355,18 @@
2086
3355
  "package": "@nifrajs/web",
2087
3356
  "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
3357
  },
3358
+ {
3359
+ "name": "ForbiddenCapabilityImport",
3360
+ "kind": "interface",
3361
+ "package": "@nifrajs/core",
3362
+ "signature": "export interface ForbiddenCapabilityImport {\n /** Exact module specifier, or a trailing `/*` prefix rule. */\n readonly specifier: string;\n readonly reason: string;\n}"
3363
+ },
3364
+ {
3365
+ "name": "formatAssuranceReport",
3366
+ "kind": "function",
3367
+ "package": "@nifrajs/cli",
3368
+ "signature": "export declare function formatAssuranceReport(report: AssuranceReport): string;"
3369
+ },
2089
3370
  {
2090
3371
  "name": "formatBytes",
2091
3372
  "kind": "function",
@@ -2100,6 +3381,12 @@
2100
3381
  "signature": "export declare function formatDiff(diff: RoutesDiff): string;",
2101
3382
  "doc": "/** Render a diff for terminals: breaking first, then info, then compatible. */"
2102
3383
  },
3384
+ {
3385
+ "name": "formatManifestDiff",
3386
+ "kind": "function",
3387
+ "package": "@nifrajs/cli",
3388
+ "signature": "export declare function formatManifestDiff(diff: NifraManifestDiff): string;"
3389
+ },
2103
3390
  {
2104
3391
  "name": "formatManifestDrift",
2105
3392
  "kind": "function",
@@ -2206,6 +3493,19 @@
2206
3493
  "signature": "export declare function generateMockValue(schema: unknown, fieldName?: string | undefined, rng?: (() => number) | undefined): unknown;",
2207
3494
  "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
3495
  },
3496
+ {
3497
+ "name": "generateRegressionTest",
3498
+ "kind": "function",
3499
+ "package": "@nifrajs/testing",
3500
+ "signature": "export declare function generateRegressionTest(capsule: IncidentCapsule, options?: GenerateRegressionTestOptions): string;",
3501
+ "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 */"
3502
+ },
3503
+ {
3504
+ "name": "GenerateRegressionTestOptions",
3505
+ "kind": "interface",
3506
+ "package": "@nifrajs/testing",
3507
+ "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}"
3508
+ },
2209
3509
  {
2210
3510
  "name": "generateServerEntry",
2211
3511
  "kind": "function",
@@ -2240,6 +3540,13 @@
2240
3540
  "signature": "export declare function generateTraceId(): string;",
2241
3541
  "doc": "/** A fresh 16-byte (32-hex) trace id. */"
2242
3542
  },
3543
+ {
3544
+ "name": "getBrowserNavigate",
3545
+ "kind": "function",
3546
+ "package": "@nifrajs/web",
3547
+ "signature": "export declare function getBrowserNavigate(): BrowserNavigate | undefined;",
3548
+ "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. */"
3549
+ },
2243
3550
  {
2244
3551
  "name": "getContext",
2245
3552
  "kind": "function",
@@ -2247,6 +3554,12 @@
2247
3554
  "signature": "export declare function getContext<C extends Context = Context>(): C;",
2248
3555
  "doc": "/** Return the current request context, or throw when no context-storage wrapper is active. */"
2249
3556
  },
3557
+ {
3558
+ "name": "getRecipe",
3559
+ "kind": "function",
3560
+ "package": "@nifrajs/cli",
3561
+ "signature": "export declare function getRecipe(version: string): UpgradeRecipe | undefined;"
3562
+ },
2250
3563
  {
2251
3564
  "name": "getSession",
2252
3565
  "kind": "function",
@@ -2426,6 +3739,13 @@
2426
3739
  "signature": "export declare function hydrate(chain: readonly unknown[], props: RenderProps, container: unknown): void;",
2427
3740
  "doc": "/** Hydrate a server-rendered Vue layout `chain` (with the loader `props`) inside `container`. */"
2428
3741
  },
3742
+ {
3743
+ "name": "HydrationBoundary",
3744
+ "kind": "function",
3745
+ "package": "@nifrajs/web-react",
3746
+ "signature": "export declare function HydrationBoundary(props: {\n readonly state: DehydratedState | undefined;\n readonly children?: ReactNode;\n}): ReactNode;",
3747
+ "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 */"
3748
+ },
2429
3749
  {
2430
3750
  "name": "I18nProvider",
2431
3751
  "kind": "function",
@@ -2485,12 +3805,51 @@
2485
3805
  "package": "@nifrajs/middleware",
2486
3806
  "signature": "export declare function idempotency(options: IdempotencyOptions): Middleware;"
2487
3807
  },
3808
+ {
3809
+ "name": "IdempotencyAbandonInput",
3810
+ "kind": "interface",
3811
+ "package": "@nifrajs/core",
3812
+ "signature": "export interface IdempotencyAbandonInput extends IdempotencyEntryKey {\n /** Opaque ownership token returned by `begin(state:\"new\")`. */\n readonly reservation: string;\n}"
3813
+ },
3814
+ {
3815
+ "name": "IdempotencyBeginInput",
3816
+ "kind": "interface",
3817
+ "package": "@nifrajs/core",
3818
+ "signature": "export interface IdempotencyBeginInput extends IdempotencyEntryKey {\n readonly fingerprint: string;\n readonly ttlMs: number;\n}"
3819
+ },
3820
+ {
3821
+ "name": "IdempotencyBeginResult",
3822
+ "kind": "type",
3823
+ "package": "@nifrajs/core",
3824
+ "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};",
3825
+ "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 */"
3826
+ },
2488
3827
  {
2489
3828
  "name": "IdempotencyClaim",
2490
3829
  "kind": "type",
2491
3830
  "package": "@nifrajs/middleware",
2492
3831
  "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
3832
  },
3833
+ {
3834
+ "name": "IdempotencyCompletionInput",
3835
+ "kind": "interface",
3836
+ "package": "@nifrajs/core",
3837
+ "signature": "export interface IdempotencyCompletionInput extends IdempotencyEntryKey {\n /** Opaque ownership token returned by `begin(state:\"new\")`. */\n readonly reservation: string;\n readonly response: StoredResponse;\n}"
3838
+ },
3839
+ {
3840
+ "name": "IdempotencyConfig",
3841
+ "kind": "interface",
3842
+ "package": "@nifrajs/core",
3843
+ "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}",
3844
+ "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 */"
3845
+ },
3846
+ {
3847
+ "name": "IdempotencyEntryKey",
3848
+ "kind": "interface",
3849
+ "package": "@nifrajs/core",
3850
+ "signature": "export interface IdempotencyEntryKey {\n readonly namespace: string;\n readonly key: string;\n}",
3851
+ "doc": "/** Namespaces isolate the same client key across tenants/subjects without putting identity in a header. */"
3852
+ },
2494
3853
  {
2495
3854
  "name": "IdempotencyOptions",
2496
3855
  "kind": "interface",
@@ -2504,6 +3863,26 @@
2504
3863
  "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
3864
  "doc": "/** A captured response, replayed verbatim on a retry. Body is base64 (binary-safe + JSON-serializable). */"
2506
3865
  },
3866
+ {
3867
+ "name": "IdempotencyResponseTooLargeError",
3868
+ "kind": "class",
3869
+ "package": "@nifrajs/core",
3870
+ "signature": "export declare class IdempotencyResponseTooLargeError extends Error {\n readonly maxBytes: number;\n constructor(maxBytes: number);\n}"
3871
+ },
3872
+ {
3873
+ "name": "IdempotencyScope",
3874
+ "kind": "type",
3875
+ "package": "@nifrajs/core",
3876
+ "signature": "export type IdempotencyScope = \"request\" | \"durable\";",
3877
+ "doc": "/** Whether a route's idempotency is satisfied by an in-process store or a durable (cross-restart) one. */"
3878
+ },
3879
+ {
3880
+ "name": "IdempotencyStore",
3881
+ "kind": "interface",
3882
+ "package": "@nifrajs/core",
3883
+ "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}",
3884
+ "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 */"
3885
+ },
2507
3886
  {
2508
3887
  "name": "IdempotencyStore",
2509
3888
  "kind": "interface",
@@ -2511,6 +3890,13 @@
2511
3890
  "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
3891
  "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
3892
  },
3893
+ {
3894
+ "name": "IDEMPOTENT_REPLAY_HEADER",
3895
+ "kind": "const",
3896
+ "package": "@nifrajs/core",
3897
+ "signature": "export declare const IDEMPOTENT_REPLAY_HEADER = \"x-nifra-idempotent-replay\";",
3898
+ "doc": "/** Header stamped on a replayed response so clients/proxies can tell a replay from a fresh run. */"
3899
+ },
2514
3900
  {
2515
3901
  "name": "identityLoader",
2516
3902
  "kind": "const",
@@ -2657,12 +4043,43 @@
2657
4043
  "signature": "export declare function implement<const C extends ContractShape, H extends HandlersFor<C>>(contract: C, handlers: H): Server<RegistryFromImpl<C, H>>;",
2658
4044
  "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
4045
  },
4046
+ {
4047
+ "name": "ImportChange",
4048
+ "kind": "interface",
4049
+ "package": "@nifrajs/cli",
4050
+ "signature": "export interface ImportChange {\n readonly file: string;\n readonly from: string;\n readonly to: string;\n readonly count: number;\n}"
4051
+ },
2660
4052
  {
2661
4053
  "name": "importHmacKey",
2662
4054
  "kind": "function",
2663
4055
  "package": "@nifrajs/middleware",
2664
4056
  "signature": "export declare function importHmacKey(secret: string | Uint8Array, hash?: string): Promise<CryptoKey>;"
2665
4057
  },
4058
+ {
4059
+ "name": "ImportMove",
4060
+ "kind": "interface",
4061
+ "package": "@nifrajs/cli",
4062
+ "signature": "export interface ImportMove {\n readonly from: string;\n readonly to: string;\n}",
4063
+ "doc": "/** An exact import-specifier rewrite (string-level, not AST): `from` → `to`. */"
4064
+ },
4065
+ {
4066
+ "name": "IncidentCapsule",
4067
+ "kind": "interface",
4068
+ "package": "@nifrajs/testing",
4069
+ "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}"
4070
+ },
4071
+ {
4072
+ "name": "IncidentReplayError",
4073
+ "kind": "class",
4074
+ "package": "@nifrajs/testing",
4075
+ "signature": "export declare class IncidentReplayError extends Error {\n readonly result: IncidentReplayResult;\n readonly capsuleId: string;\n constructor(capsule: IncidentCapsule, result: IncidentReplayResult);\n}"
4076
+ },
4077
+ {
4078
+ "name": "IncidentReplayResult",
4079
+ "kind": "interface",
4080
+ "package": "@nifrajs/testing",
4081
+ "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}"
4082
+ },
2666
4083
  {
2667
4084
  "name": "InferInput",
2668
4085
  "kind": "type",
@@ -2682,6 +4099,27 @@
2682
4099
  "signature": "export type InferOutput<S extends StandardSchemaV1> = NonNullable<S[\"~standard\"][\"types\"]>[\"output\"];",
2683
4100
  "doc": "/** Extract a Standard Schema's validated output type. */"
2684
4101
  },
4102
+ {
4103
+ "name": "InfiniteData",
4104
+ "kind": "interface",
4105
+ "package": "@nifrajs/web",
4106
+ "signature": "export interface InfiniteData<T, P> {\n readonly pages: readonly T[];\n readonly pageParams: readonly P[];\n}",
4107
+ "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). */"
4108
+ },
4109
+ {
4110
+ "name": "InfiniteQueryHandle",
4111
+ "kind": "interface",
4112
+ "package": "@nifrajs/web",
4113
+ "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}",
4114
+ "doc": "/** A stable per-key handle for an infinite (paged) query. */"
4115
+ },
4116
+ {
4117
+ "name": "InfiniteQueryOptions",
4118
+ "kind": "interface",
4119
+ "package": "@nifrajs/web",
4120
+ "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}",
4121
+ "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. */"
4122
+ },
2685
4123
  {
2686
4124
  "name": "initAgents",
2687
4125
  "kind": "function",
@@ -2712,8 +4150,15 @@
2712
4150
  "name": "inProcessClient",
2713
4151
  "kind": "function",
2714
4152
  "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\">): Treaty<App>;",
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 typed proxy ALSO carries a real `fetch(url, init)` method — the same in-process\n * bridge — so `createWebApp({ api: inProcessClient(backend) })` can **auto-mount** the backend over\n * HTTP at `/api/*` (it dispatches `api.fetch(req.url, req)` to the backend, no hand-written\n * `server-bun.ts` `/api/*` branch). Without this, `api.fetch` would resolve to a *route* sub-proxy\n * (a call to `/fetch`), not the backend's own `fetch` — so the mount can't reach the app. The `fetch`\n * key is intercepted on the proxy and shadows any (non-existent) `/fetch` route segment; no app\n * defines a literal `/fetch` route reached via the typed proxy, so this is backward-compatible.\n */"
4153
+ "signature": "export declare function inProcessClient<App extends {\n fetch(request: Request): Response | Promise<Response>;\n}>(app: App, options?: Omit<ClientOptions, \"fetch\">): InProcessClient<App>;",
4154
+ "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 */"
4155
+ },
4156
+ {
4157
+ "name": "InProcessClient",
4158
+ "kind": "type",
4159
+ "package": "@nifrajs/client",
4160
+ "signature": "export type InProcessClient<App> = Treaty<App> & BackendMount;",
4161
+ "doc": "/** Typed route client plus the explicit platform-aware backend mount capability. */"
2717
4162
  },
2718
4163
  {
2719
4164
  "name": "installForms",
@@ -2734,6 +4179,31 @@
2734
4179
  "package": "@nifrajs/web",
2735
4180
  "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
4181
  },
4182
+ {
4183
+ "name": "InvariantExecutor",
4184
+ "kind": "type",
4185
+ "package": "@nifrajs/core",
4186
+ "signature": "export type InvariantExecutor = (request: Request) => Response | Promise<Response>;"
4187
+ },
4188
+ {
4189
+ "name": "InvariantFinding",
4190
+ "kind": "interface",
4191
+ "package": "@nifrajs/core",
4192
+ "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}"
4193
+ },
4194
+ {
4195
+ "name": "InvariantFindingCode",
4196
+ "kind": "type",
4197
+ "package": "@nifrajs/core",
4198
+ "signature": "export type InvariantFindingCode = \"classification-understated\" | \"server-error-on-valid-input\" | \"response-schema-violation\" | \"validation-bypass\" | \"server-error-on-invalid-input\";",
4199
+ "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 */"
4200
+ },
4201
+ {
4202
+ "name": "InvariantReport",
4203
+ "kind": "interface",
4204
+ "package": "@nifrajs/core",
4205
+ "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}"
4206
+ },
2737
4207
  {
2738
4208
  "name": "IpMatcher",
2739
4209
  "kind": "type",
@@ -2767,6 +4237,13 @@
2767
4237
  "signature": "export declare function isBuildTarget(value: string): value is BuildTarget;",
2768
4238
  "doc": "/** A type guard narrowing an arbitrary string to a {@link BuildTarget}. */"
2769
4239
  },
4240
+ {
4241
+ "name": "isDataClassification",
4242
+ "kind": "function",
4243
+ "package": "@nifrajs/core",
4244
+ "signature": "export declare function isDataClassification(value: unknown): value is DataClassification;",
4245
+ "doc": "/** Whether `value` is a known classification token. */"
4246
+ },
2770
4247
  {
2771
4248
  "name": "isDraftEnabled",
2772
4249
  "kind": "function",
@@ -2944,6 +4421,12 @@
2944
4421
  "signature": "export interface JobStore {\n /** Persist a new job; return its id. */\n enqueue(job: {\n name: string;\n payload: unknown;\n runAt: number;\n maxAttempts: number;\n }): string | Promise<string>;\n /** Atomically claim up to `limit` jobs due at/before `now`, hiding them for `leaseMs`. */\n lease(now: number, limit: number, leaseMs: number): StoredJob[] | Promise<StoredJob[]>;\n /** A job finished successfully — remove it. */\n complete(id: string): void | Promise<void>;\n /** A job failed but has attempts left — bump its attempt count and reschedule for `runAt`. */\n retry(id: string, runAt: number): void | Promise<void>;\n /** A job exhausted its attempts — move it to the dead-letter set with the last error. */\n deadLetter(id: string, error: string): void | Promise<void>;\n /** Snapshot counts (observability + tests). */\n counts(): JobCounts | Promise<JobCounts>;\n}",
2945
4422
  "doc": "/**\n * Persistence + leasing for the queue. The default {@link MemoryJobStore} is single-process (dev / a\n * single long-running server); implement this over Redis/Postgres/etc. for durability or multiple\n * workers. All methods may be sync or async — the queue awaits them.\n */"
2946
4423
  },
4424
+ {
4425
+ "name": "jobStoreCertificationProfile",
4426
+ "kind": "function",
4427
+ "package": "@nifrajs/testing",
4428
+ "signature": "export declare function jobStoreCertificationProfile(): AdapterCertificationProfile<CertifiableJobStore>;"
4429
+ },
2947
4430
  {
2948
4431
  "name": "JobValidationError",
2949
4432
  "kind": "class",
@@ -2951,6 +4434,13 @@
2951
4434
  "signature": "export declare class JobValidationError extends Error {\n readonly job: string;\n readonly issues: ReadonlyArray<{\n readonly message: string;\n }>;\n readonly name = \"JobValidationError\";\n constructor(job: string, issues: ReadonlyArray<{\n readonly message: string;\n }>);\n}",
2952
4435
  "doc": "/** Thrown by `enqueue` when the payload fails the job's `input` schema (validation at the trust boundary). */"
2953
4436
  },
4437
+ {
4438
+ "name": "joinCausality",
4439
+ "kind": "function",
4440
+ "package": "@nifrajs/core",
4441
+ "signature": "export declare function joinCausality(parents: readonly CausalityContext[], nodeKind: CausalityKind, id: string, options?: ContinueCausalityOptions): CausalityStep;",
4442
+ "doc": "/** Join several immediate parents. Cross-execution joins fail closed. */"
4443
+ },
2954
4444
  {
2955
4445
  "name": "jsonError",
2956
4446
  "kind": "function",
@@ -3135,6 +4625,20 @@
3135
4625
  "signature": "export interface LayoutEntry {\n readonly file: string;\n readonly load: () => Promise<{\n default: unknown;\n meta?: MetaInput;\n }>;\n}",
3136
4626
  "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
4627
  },
4628
+ {
4629
+ "name": "LedgerSink",
4630
+ "kind": "type",
4631
+ "package": "@nifrajs/core",
4632
+ "signature": "export type LedgerSink = (ledger: SealedEffectLedger) => void | Promise<void>;",
4633
+ "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 */"
4634
+ },
4635
+ {
4636
+ "name": "Link",
4637
+ "kind": "const",
4638
+ "package": "@nifrajs/web-react",
4639
+ "signature": "export declare const Link: import(\"react\").ForwardRefExoticComponent<LinkProps & import(\"react\").RefAttributes<HTMLAnchorElement>>;",
4640
+ "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 */"
4641
+ },
3138
4642
  {
3139
4643
  "name": "LinkDescriptor",
3140
4644
  "kind": "interface",
@@ -3142,12 +4646,26 @@
3142
4646
  "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
4647
  "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
4648
  },
4649
+ {
4650
+ "name": "LinkProps",
4651
+ "kind": "interface",
4652
+ "package": "@nifrajs/web-react",
4653
+ "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}",
4654
+ "doc": "/** {@link Link} props: every `<a>` attribute except `href` (set from `to`), plus `to` + `replace`. */"
4655
+ },
3145
4656
  {
3146
4657
  "name": "ListOptions",
3147
4658
  "kind": "interface",
3148
4659
  "package": "@nifrajs/storage",
3149
4660
  "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
4661
  },
4662
+ {
4663
+ "name": "listRecipeVersions",
4664
+ "kind": "function",
4665
+ "package": "@nifrajs/cli",
4666
+ "signature": "export declare function listRecipeVersions(): string[];",
4667
+ "doc": "/** Available target versions, ascending. */"
4668
+ },
3151
4669
  {
3152
4670
  "name": "load",
3153
4671
  "kind": "function",
@@ -3168,6 +4686,12 @@
3168
4686
  "package": "@nifrajs/cli",
3169
4687
  "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
4688
  },
4689
+ {
4690
+ "name": "loadAssuranceConfig",
4691
+ "kind": "function",
4692
+ "package": "@nifrajs/cli",
4693
+ "signature": "export declare function loadAssuranceConfig(cwd: string, configPath?: string): Promise<AssuranceConfig>;"
4694
+ },
3171
4695
  {
3172
4696
  "name": "loadBackend",
3173
4697
  "kind": "function",
@@ -3269,6 +4793,13 @@
3269
4793
  "signature": "export type Locale = string;",
3270
4794
  "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
4795
  },
4796
+ {
4797
+ "name": "Location",
4798
+ "kind": "interface",
4799
+ "package": "@nifrajs/web-react",
4800
+ "signature": "export interface Location {\n readonly pathname: string;\n readonly search: string;\n readonly hash: string;\n}",
4801
+ "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. */"
4802
+ },
3272
4803
  {
3273
4804
  "name": "LogFields",
3274
4805
  "kind": "type",
@@ -3302,6 +4833,20 @@
3302
4833
  "signature": "export declare function lookupType(types: readonly TypeEntry[], name: string): TypeEntry[];",
3303
4834
  "doc": "/** Exact (case-insensitive) name lookup — returns every declaration with that name (a name can exist in\n * more than one package). */"
3304
4835
  },
4836
+ {
4837
+ "name": "LoopDelayHistogram",
4838
+ "kind": "interface",
4839
+ "package": "@nifrajs/middleware",
4840
+ "signature": "export interface LoopDelayHistogram {\n enable(): void;\n reset(): void;\n readonly mean: number;\n}",
4841
+ "doc": "/** The slice of a `perf_hooks` event-loop-delay histogram the sampler needs. */"
4842
+ },
4843
+ {
4844
+ "name": "LoopDelayMonitor",
4845
+ "kind": "type",
4846
+ "package": "@nifrajs/middleware",
4847
+ "signature": "export type LoopDelayMonitor = (resolutionMs: number) => LoopDelayHistogram | undefined;",
4848
+ "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 */"
4849
+ },
3305
4850
  {
3306
4851
  "name": "Manifest",
3307
4852
  "kind": "interface",
@@ -3336,6 +4881,27 @@
3336
4881
  "signature": "export declare function matches(fields: CronFields, date: Date): boolean;",
3337
4882
  "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
4883
  },
4884
+ {
4885
+ "name": "matchesAssuranceSelector",
4886
+ "kind": "function",
4887
+ "package": "@nifrajs/core",
4888
+ "signature": "export declare function matchesAssuranceSelector(route: Pick<ReflectedRoute, \"method\" | \"path\" | \"tool\">, selector: AssuranceRouteSelector): boolean;",
4889
+ "doc": "/** Shared selector semantics for policy rules and framework adapters. */"
4890
+ },
4891
+ {
4892
+ "name": "MAX_COST_AXES",
4893
+ "kind": "const",
4894
+ "package": "@nifrajs/core",
4895
+ "signature": "export declare const MAX_COST_AXES = 8;",
4896
+ "doc": "/** Most cost axes one entry may carry. */"
4897
+ },
4898
+ {
4899
+ "name": "maxClassification",
4900
+ "kind": "function",
4901
+ "package": "@nifrajs/core",
4902
+ "signature": "export declare function maxClassification(values: Iterable<DataClassification>): DataClassification;",
4903
+ "doc": "/** The most sensitive classification among the inputs; `\"public\"` when none are given. */"
4904
+ },
3339
4905
  {
3340
4906
  "name": "MaybePromise",
3341
4907
  "kind": "type",
@@ -3524,7 +5090,7 @@
3524
5090
  "kind": "type",
3525
5091
  "package": "@nifrajs/mcp",
3526
5092
  "signature": "export type McpUiIntent = \"table\" | \"list\" | \"cards\" | \"form\" | \"metric\" | \"detail\" | \"chart\" | (string & {});",
3527
- "doc": "/**\n * A render-intent hint for GENERATIVE hosts (e.g. the ShipNow builder): 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 */"
5093
+ "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
5094
  },
3529
5095
  {
3530
5096
  "name": "McpWidget",
@@ -3558,6 +5124,19 @@
3558
5124
  "package": "@nifrajs/web",
3559
5125
  "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
5126
  },
5127
+ {
5128
+ "name": "MemoryCausalityStoreOptions",
5129
+ "kind": "interface",
5130
+ "package": "@nifrajs/core",
5131
+ "signature": "export interface MemoryCausalityStoreOptions {\n /** Global record bound. Default 10,000. */\n readonly maxRecords?: number;\n /** In-memory evidence disappears on restart and is rejected in production unless explicitly allowed. */\n readonly allowInProduction?: boolean;\n}"
5132
+ },
5133
+ {
5134
+ "name": "MemoryIdempotencyStore",
5135
+ "kind": "class",
5136
+ "package": "@nifrajs/core",
5137
+ "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}",
5138
+ "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 */"
5139
+ },
3561
5140
  {
3562
5141
  "name": "MemoryIdempotencyStore",
3563
5142
  "kind": "class",
@@ -3565,6 +5144,12 @@
3565
5144
  "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
5145
  "doc": "/** In-process store. Refuses to run in production unless explicitly allowed (per-instance ⇒ no cross-instance dedupe). */"
3567
5146
  },
5147
+ {
5148
+ "name": "MemoryIdempotencyStoreOptions",
5149
+ "kind": "interface",
5150
+ "package": "@nifrajs/core",
5151
+ "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}"
5152
+ },
3568
5153
  {
3569
5154
  "name": "MemoryIdempotencyStoreOptions",
3570
5155
  "kind": "interface",
@@ -3578,6 +5163,18 @@
3578
5163
  "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
5164
  "doc": "/** Construct an in-memory job store. `idFor` is injectable for deterministic tests. */"
3580
5165
  },
5166
+ {
5167
+ "name": "MemoryLedgerSink",
5168
+ "kind": "interface",
5169
+ "package": "@nifrajs/core",
5170
+ "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}"
5171
+ },
5172
+ {
5173
+ "name": "MemoryLedgerSinkOptions",
5174
+ "kind": "interface",
5175
+ "package": "@nifrajs/core",
5176
+ "signature": "export interface MemoryLedgerSinkOptions {\n /** Retain at most this many sealed ledgers (oldest evicted first). Default 1000. */\n readonly maxLedgers?: number;\n}"
5177
+ },
3581
5178
  {
3582
5179
  "name": "MemoryResponseCache",
3583
5180
  "kind": "class",
@@ -3687,9 +5284,16 @@
3687
5284
  "name": "Middleware",
3688
5285
  "kind": "interface",
3689
5286
  "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}",
5287
+ "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
5288
  "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
5289
  },
5290
+ {
5291
+ "name": "MIN_DIGEST_KEY_BYTES",
5292
+ "kind": "const",
5293
+ "package": "@nifrajs/core",
5294
+ "signature": "export declare const MIN_DIGEST_KEY_BYTES = 16;",
5295
+ "doc": "/** Minimum digest key material. A short key would make the keyed digest brute-forceable. */"
5296
+ },
3693
5297
  {
3694
5298
  "name": "MockableApp",
3695
5299
  "kind": "interface",
@@ -3793,6 +5397,34 @@
3793
5397
  "signature": "export interface MovableStorageAdapter extends StorageAdapter {\n copy(sourceKey: string, destinationKey: string): Promise<void>;\n move(sourceKey: string, destinationKey: string): Promise<void>;\n}",
3794
5398
  "doc": "/** Optional server-side copy/move capability. */"
3795
5399
  },
5400
+ {
5401
+ "name": "MutationCallbacks",
5402
+ "kind": "interface",
5403
+ "package": "@nifrajs/web",
5404
+ "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}",
5405
+ "doc": "/** Lifecycle callbacks for a mutation. All optional; `onSettled` runs after success OR error. */"
5406
+ },
5407
+ {
5408
+ "name": "MutationHandle",
5409
+ "kind": "interface",
5410
+ "package": "@nifrajs/web",
5411
+ "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}",
5412
+ "doc": "/** A standalone mutation store: subscribe to its state, fire `mutate`, `reset` back to idle. */"
5413
+ },
5414
+ {
5415
+ "name": "MutationState",
5416
+ "kind": "interface",
5417
+ "package": "@nifrajs/web",
5418
+ "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}",
5419
+ "doc": "/** A mutation's observable state. A new (frozen) object per transition (reference-comparable). */"
5420
+ },
5421
+ {
5422
+ "name": "MutationStatus",
5423
+ "kind": "type",
5424
+ "package": "@nifrajs/web",
5425
+ "signature": "export type MutationStatus = \"idle\" | \"pending\" | \"success\" | \"error\";",
5426
+ "doc": "/** A mutation's lifecycle status. */"
5427
+ },
3796
5428
  {
3797
5429
  "name": "namedCombine",
3798
5430
  "kind": "function",
@@ -3800,6 +5432,55 @@
3800
5432
  "signature": "export declare function namedCombine(name: string, ...items: readonly Composable[]): NifraPlugin;",
3801
5433
  "doc": "/** Compose middleware/plugins into one idempotent named bundle. */"
3802
5434
  },
5435
+ {
5436
+ "name": "Navigate",
5437
+ "kind": "function",
5438
+ "package": "@nifrajs/web-react",
5439
+ "signature": "export declare function Navigate({ to, replace }: NavigateProps): null;",
5440
+ "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 */"
5441
+ },
5442
+ {
5443
+ "name": "NavigateFunction",
5444
+ "kind": "type",
5445
+ "package": "@nifrajs/web-react",
5446
+ "signature": "export type NavigateFunction = (to: string | number, options?: NavigateOptions) => void;",
5447
+ "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). */"
5448
+ },
5449
+ {
5450
+ "name": "NavigateOptions",
5451
+ "kind": "interface",
5452
+ "package": "@nifrajs/web",
5453
+ "signature": "export interface NavigateOptions {\n /** Replace the current history entry instead of pushing a new one (like `history.replaceState`). */\n readonly replace?: boolean;\n}",
5454
+ "doc": "/** Options for a programmatic navigation. */"
5455
+ },
5456
+ {
5457
+ "name": "NavigateProps",
5458
+ "kind": "interface",
5459
+ "package": "@nifrajs/web-react",
5460
+ "signature": "export interface NavigateProps {\n readonly to: string;\n readonly replace?: boolean;\n}",
5461
+ "doc": "/** {@link Navigate} props: the destination `to` and whether to `replace` the history entry. */"
5462
+ },
5463
+ {
5464
+ "name": "NavLink",
5465
+ "kind": "const",
5466
+ "package": "@nifrajs/web-react",
5467
+ "signature": "export declare const NavLink: import(\"react\").ForwardRefExoticComponent<NavLinkProps & import(\"react\").RefAttributes<HTMLAnchorElement>>;",
5468
+ "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 */"
5469
+ },
5470
+ {
5471
+ "name": "NavLinkProps",
5472
+ "kind": "interface",
5473
+ "package": "@nifrajs/web-react",
5474
+ "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}",
5475
+ "doc": "/** {@link NavLink} props — like {@link LinkProps}, but `className`/`style`/`children` may be functions\n * of the active state, and `end`/`caseSensitive` tune matching. */"
5476
+ },
5477
+ {
5478
+ "name": "NavLinkRenderProps",
5479
+ "kind": "interface",
5480
+ "package": "@nifrajs/web-react",
5481
+ "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}",
5482
+ "doc": "/** The state a {@link NavLink}'s function-form `className`/`style`/`children` receive. */"
5483
+ },
3803
5484
  {
3804
5485
  "name": "ndjsonStream",
3805
5486
  "kind": "function",
@@ -3827,6 +5508,33 @@
3827
5508
  "signature": "export declare function nextRun(fields: CronFields, from: Date): Date | null;",
3828
5509
  "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
5510
  },
5511
+ {
5512
+ "name": "NIFRA_ASSURANCE",
5513
+ "kind": "const",
5514
+ "package": "@nifrajs/core",
5515
+ "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}>;",
5516
+ "doc": "/** Canonical evidence ids emitted by Nifra's official middleware modules. */"
5517
+ },
5518
+ {
5519
+ "name": "NIFRA_ASSURANCE_IDS",
5520
+ "kind": "const",
5521
+ "package": "@nifrajs/core",
5522
+ "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}>;"
5523
+ },
5524
+ {
5525
+ "name": "NIFRA_BACKEND_MOUNT",
5526
+ "kind": "const",
5527
+ "package": "@nifrajs/core",
5528
+ "signature": "export declare const NIFRA_BACKEND_MOUNT: unique symbol;",
5529
+ "doc": "/** Global symbol so independently bundled copies of core/client/web still agree on the mount seam. */"
5530
+ },
5531
+ {
5532
+ "name": "NIFRA_DEADLINE_HEADER",
5533
+ "kind": "const",
5534
+ "package": "@nifrajs/core",
5535
+ "signature": "export declare const NIFRA_DEADLINE_HEADER = \"x-nifra-deadline\";",
5536
+ "doc": "/** Canonical wire header carrying an absolute Unix epoch deadline in milliseconds. */"
5537
+ },
3830
5538
  {
3831
5539
  "name": "NifraFramework",
3832
5540
  "kind": "interface",
@@ -3834,6 +5542,54 @@
3834
5542
  "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
5543
  "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
5544
  },
5545
+ {
5546
+ "name": "NifraManifest",
5547
+ "kind": "interface",
5548
+ "package": "@nifrajs/core",
5549
+ "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}"
5550
+ },
5551
+ {
5552
+ "name": "NifraManifestAssurance",
5553
+ "kind": "interface",
5554
+ "package": "@nifrajs/core",
5555
+ "signature": "export interface NifraManifestAssurance {\n readonly rule?: string;\n readonly evidence: readonly {\n readonly id: string;\n readonly source: string;\n }[];\n}"
5556
+ },
5557
+ {
5558
+ "name": "NifraManifestCapabilities",
5559
+ "kind": "interface",
5560
+ "package": "@nifrajs/core",
5561
+ "signature": "export interface NifraManifestCapabilities {\n readonly declared: readonly string[];\n readonly evidenced: readonly string[];\n readonly unproven: readonly string[];\n readonly covered: boolean;\n}"
5562
+ },
5563
+ {
5564
+ "name": "NifraManifestChange",
5565
+ "kind": "interface",
5566
+ "package": "@nifrajs/core",
5567
+ "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}"
5568
+ },
5569
+ {
5570
+ "name": "NifraManifestDiff",
5571
+ "kind": "interface",
5572
+ "package": "@nifrajs/core",
5573
+ "signature": "export interface NifraManifestDiff {\n readonly changes: readonly NifraManifestChange[];\n readonly hasBreaking: boolean;\n}"
5574
+ },
5575
+ {
5576
+ "name": "NifraManifestRoute",
5577
+ "kind": "interface",
5578
+ "package": "@nifrajs/core",
5579
+ "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}"
5580
+ },
5581
+ {
5582
+ "name": "NifraManifestSignature",
5583
+ "kind": "interface",
5584
+ "package": "@nifrajs/core",
5585
+ "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}"
5586
+ },
5587
+ {
5588
+ "name": "NifraManifestSigner",
5589
+ "kind": "interface",
5590
+ "package": "@nifrajs/core",
5591
+ "signature": "export interface NifraManifestSigner {\n readonly algorithm: \"Ed25519\";\n readonly keyId: string;\n sign(payload: Uint8Array): ArrayBuffer | Uint8Array | Promise<ArrayBuffer | Uint8Array>;\n}"
5592
+ },
3837
5593
  {
3838
5594
  "name": "NifraMonorepoConfig",
3839
5595
  "kind": "interface",
@@ -3859,7 +5615,7 @@
3859
5615
  "name": "NifraSpan",
3860
5616
  "kind": "interface",
3861
5617
  "package": "@nifrajs/otel",
3862
- "signature": "export interface NifraSpan {\n /** 32-hex W3C trace id — shared across every span/service in the trace. */\n readonly traceId: string;\n /** 16-hex id of this span. */\n readonly spanId: string;\n /** The inbound span's id, if this request continued an upstream trace. */\n readonly parentSpanId?: string;\n /** Whether the trace is sampled (the W3C flag). */\n readonly sampled: boolean;\n /** Span name — `\"<METHOD> <path>\"`. */\n readonly name: string;\n /** Wall-clock start (epoch ms). */\n readonly startTime: number;\n /** Wall-clock end (epoch ms) — set on completion. */\n endTime?: number;\n /** Duration in ms (monotonic). */\n durationMs?: number;\n status: SpanStatus;\n /** OTel-semantic-convention attributes. */\n readonly attributes: Record<string, AttributeValue>;\n}",
5618
+ "signature": "export interface NifraSpan {\n /** 32-hex W3C trace id — shared across every span/service in the trace. */\n readonly traceId: string;\n /** 16-hex id of this span. */\n readonly spanId: string;\n /** The inbound span's id, if this request continued an upstream trace. */\n readonly parentSpanId?: string;\n /** Whether the trace is sampled (the W3C flag). */\n readonly sampled: boolean;\n /** Span name — `\"<METHOD> <path>\"`. */\n readonly name: string;\n /** Wall-clock start (epoch ms). */\n readonly startTime: number;\n /** Wall-clock end (epoch ms) — set on completion. */\n endTime?: number;\n /** Duration in ms (monotonic). */\n durationMs?: number;\n status: SpanStatus;\n /** OTel-semantic-convention attributes. */\n readonly attributes: Record<string, AttributeValue>;\n /** Durable/asynchronous parents that are related but are not this span's single trace parent. */\n readonly links?: readonly ObservationLink[];\n}",
3863
5619
  "doc": "/** A completed (or in-flight) server span for one request. */"
3864
5620
  },
3865
5621
  {
@@ -3910,6 +5666,12 @@
3910
5666
  "signature": "export declare function normalizeRolldownPlugins(plugins: readonly unknown[], isRolldown: boolean): readonly unknown[];",
3911
5667
  "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
5668
  },
5669
+ {
5670
+ "name": "normalizeRouteCapabilities",
5671
+ "kind": "function",
5672
+ "package": "@nifrajs/core",
5673
+ "signature": "export declare function normalizeRouteCapabilities(values: readonly string[] | undefined): readonly string[];"
5674
+ },
3913
5675
  {
3914
5676
  "name": "number",
3915
5677
  "kind": "function",
@@ -3948,6 +5710,13 @@
3948
5710
  "package": "@nifrajs/otel",
3949
5711
  "signature": "export interface ObservationLifecycleOptions {\n readonly adapters?: readonly ObservationAdapter[];\n /** Injectable seams are primarily useful for deterministic tests and constrained runtimes. */\n readonly clock?: ObservationClock;\n readonly generateTraceId?: () => string;\n readonly generateSpanId?: () => string;\n}"
3950
5712
  },
5713
+ {
5714
+ "name": "ObservationLink",
5715
+ "kind": "interface",
5716
+ "package": "@nifrajs/otel",
5717
+ "signature": "export interface ObservationLink {\n readonly traceId: string;\n readonly spanId: string;\n readonly attributes?: Readonly<Record<string, AttributeValue>>;\n}",
5718
+ "doc": "/** A non-parent causal relationship to a span in another trace (the OTel `Link` model). */"
5719
+ },
3951
5720
  {
3952
5721
  "name": "ObservationParent",
3953
5722
  "kind": "interface",
@@ -4047,7 +5816,7 @@
4047
5816
  "name": "OperationDef",
4048
5817
  "kind": "interface",
4049
5818
  "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}",
5819
+ "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
5820
  "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
5821
  },
4053
5822
  {
@@ -4126,6 +5895,26 @@
4126
5895
  "signature": "export declare function parseArgs(argv: readonly string[]): ParsedArgs;",
4127
5896
  "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
5897
  },
5898
+ {
5899
+ "name": "parseCapabilityLockfile",
5900
+ "kind": "function",
5901
+ "package": "@nifrajs/cli",
5902
+ "signature": "export declare function parseCapabilityLockfile(content: string, sourcePath: string): CapabilitySnapshot;"
5903
+ },
5904
+ {
5905
+ "name": "parseCausalityContext",
5906
+ "kind": "function",
5907
+ "package": "@nifrajs/core",
5908
+ "signature": "export declare function parseCausalityContext(input: unknown): CausalityParseResult;",
5909
+ "doc": "/** Parse an untrusted JSON causality context. Unknown fields fail closed so payloads cannot hitchhike. */"
5910
+ },
5911
+ {
5912
+ "name": "parseCausalityRecord",
5913
+ "kind": "function",
5914
+ "package": "@nifrajs/core",
5915
+ "signature": "export declare function parseCausalityRecord(input: unknown): CausalityRecordParseResult;",
5916
+ "doc": "/** Parse an untrusted durable graph record. Unknown fields fail closed at every nesting level. */"
5917
+ },
4129
5918
  {
4130
5919
  "name": "parseContentLength",
4131
5920
  "kind": "function",
@@ -4152,6 +5941,13 @@
4152
5941
  "signature": "export declare function parseCron(expression: string): CronFields;",
4153
5942
  "doc": "/** Parse a 5-field cron expression (or a `@macro`) into matchable {@link CronFields}. */"
4154
5943
  },
5944
+ {
5945
+ "name": "parseDeadlineHeader",
5946
+ "kind": "function",
5947
+ "package": "@nifrajs/core",
5948
+ "signature": "export declare function parseDeadlineHeader(headers: Headers): DeadlineHeaderResult;",
5949
+ "doc": "/** Parse the canonical deadline header without trusting or clamping it. */"
5950
+ },
4155
5951
  {
4156
5952
  "name": "ParsedFontFace",
4157
5953
  "kind": "interface",
@@ -4200,6 +5996,20 @@
4200
5996
  "signature": "export declare function parseNdjsonData(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): Promise<unknown>;",
4201
5997
  "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
5998
  },
5999
+ {
6000
+ "name": "parseNifraManifest",
6001
+ "kind": "function",
6002
+ "package": "@nifrajs/core",
6003
+ "signature": "export declare function parseNifraManifest(content: string, source?: string): Promise<NifraManifest>;",
6004
+ "doc": "/** Parse and hash-verify an emitted manifest before it is trusted by diff/codegen tooling. */"
6005
+ },
6006
+ {
6007
+ "name": "parseNifraManifestSignature",
6008
+ "kind": "function",
6009
+ "package": "@nifrajs/core",
6010
+ "signature": "export declare function parseNifraManifestSignature(content: string, source?: string): NifraManifestSignature;",
6011
+ "doc": "/** Parse the detached sidecar before selecting its operator-controlled public key. */"
6012
+ },
4203
6013
  {
4204
6014
  "name": "parseSnapshotFile",
4205
6015
  "kind": "function",
@@ -4234,6 +6044,26 @@
4234
6044
  "signature": "export declare function pickLanguage<const L extends readonly string[]>(header: string | null, supported: L, defaultLanguage: L[number]): LanguageMatch;",
4235
6045
  "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
6046
  },
6047
+ {
6048
+ "name": "PinChange",
6049
+ "kind": "interface",
6050
+ "package": "@nifrajs/cli",
6051
+ "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}"
6052
+ },
6053
+ {
6054
+ "name": "PinRule",
6055
+ "kind": "interface",
6056
+ "package": "@nifrajs/cli",
6057
+ "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}",
6058
+ "doc": "/** A pin rule: every dependency whose name starts with `match` is set to version `to`. */"
6059
+ },
6060
+ {
6061
+ "name": "pinSweepText",
6062
+ "kind": "function",
6063
+ "package": "@nifrajs/cli",
6064
+ "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};",
6065
+ "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 */"
6066
+ },
4237
6067
  {
4238
6068
  "name": "pipeWebBodyToNode",
4239
6069
  "kind": "function",
@@ -4555,7 +6385,7 @@
4555
6385
  "name": "QueryClient",
4556
6386
  "kind": "interface",
4557
6387
  "package": "@nifrajs/web",
4558
- "signature": "export interface QueryClient {\n /** Get the stable {@link QueryHandle} for `key`, fetched via `fn`. Re-binds the latest `fn` each\n * call (closures change between renders); returns the same handle for the same (hashed) key. */\n query: <T>(key: unknown, fn: () => Promise<T>) => QueryHandle<T>;\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}",
6388
+ "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
6389
  "doc": "/** The keyed query cache. One per app (a binding registers it like the router). */"
4560
6390
  },
4561
6391
  {
@@ -4564,6 +6394,13 @@
4564
6394
  "package": "@nifrajs/web",
4565
6395
  "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
6396
  },
6397
+ {
6398
+ "name": "QueryClientProvider",
6399
+ "kind": "function",
6400
+ "package": "@nifrajs/web-react",
6401
+ "signature": "export declare function QueryClientProvider(props: {\n readonly client: QueryClient;\n readonly children?: ReactNode;\n}): ReactNode;",
6402
+ "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. */"
6403
+ },
4567
6404
  {
4568
6405
  "name": "QueryHandle",
4569
6406
  "kind": "interface",
@@ -4577,6 +6414,13 @@
4577
6414
  "package": "@nifrajs/core",
4578
6415
  "signature": "export declare function queryObjectOf(search: string): Record<string, QueryValue>;"
4579
6416
  },
6417
+ {
6418
+ "name": "QueryOptions",
6419
+ "kind": "interface",
6420
+ "package": "@nifrajs/web",
6421
+ "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}",
6422
+ "doc": "/** Per-query overrides passed alongside the fetcher. */"
6423
+ },
4580
6424
  {
4581
6425
  "name": "QueryState",
4582
6426
  "kind": "interface",
@@ -4649,6 +6493,13 @@
4649
6493
  "package": "@nifrajs/storage",
4650
6494
  "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
6495
  },
6496
+ {
6497
+ "name": "randomEffectDigestKey",
6498
+ "kind": "function",
6499
+ "package": "@nifrajs/core",
6500
+ "signature": "export declare function randomEffectDigestKey(): Uint8Array;",
6501
+ "doc": "/** Fresh random digest key (32 bytes). Per-process by default — persist one externally to correlate across restarts. */"
6502
+ },
4652
6503
  {
4653
6504
  "name": "rateLimit",
4654
6505
  "kind": "function",
@@ -4736,6 +6587,13 @@
4736
6587
  "signature": "export declare function readBoundedBytes(req: BodySource, maxBytes: number): Promise<{\n ok: true;\n bytes: Uint8Array;\n} | {\n ok: false;\n status: 400 | 413;\n}>;",
4737
6588
  "doc": "/**\n * Read a request body as **bytes**, capped at `maxBytes`. Rejects a `Content-Length` over the cap\n * before buffering (`413`) and a malformed `Content-Length` (`400`); a chunked / length-less body\n * falls through to the streaming byte-cap guard. Fast path: a non-chunked request with a\n * `Content-Length` within the cap is read via native `arrayBuffer()` (framing-bounded by the runtime's\n * HTTP server), skipping the manual stream loop.\n */"
4738
6589
  },
6590
+ {
6591
+ "name": "readCausalityHeaders",
6592
+ "kind": "function",
6593
+ "package": "@nifrajs/core",
6594
+ "signature": "export declare function readCausalityHeaders(headers: Headers): CausalityParseResult;",
6595
+ "doc": "/** Parse the public header convention without ever throwing on hostile input. */"
6596
+ },
4739
6597
  {
4740
6598
  "name": "readDeferred",
4741
6599
  "kind": "function",
@@ -4749,6 +6607,27 @@
4749
6607
  "signature": "export declare function readImageDimensions(source: {\n arrayBuffer(): Promise<ArrayBuffer>;\n stream?: () => ReadableStream<Uint8Array>;\n}, maxBytes?: number): Promise<ImageInfo | null>;",
4750
6608
  "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
6609
  },
6610
+ {
6611
+ "name": "recipe",
6612
+ "kind": "const",
6613
+ "package": "@nifrajs/cli",
6614
+ "signature": "export declare const recipe: UpgradeRecipe;",
6615
+ "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 */"
6616
+ },
6617
+ {
6618
+ "name": "recordCapabilityOutcome",
6619
+ "kind": "function",
6620
+ "package": "@nifrajs/core",
6621
+ "signature": "export declare function recordCapabilityOutcome(context: object, capability: string, options: CapabilityOutcomeOptions): void;",
6622
+ "doc": "/** Record the terminal outcome of an already-admitted capability without debiting admission twice. */"
6623
+ },
6624
+ {
6625
+ "name": "redactForEmission",
6626
+ "kind": "function",
6627
+ "package": "@nifrajs/testing",
6628
+ "signature": "export declare function redactForEmission(value: unknown, allow: ReadonlySet<string>, path?: string): unknown;",
6629
+ "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 */"
6630
+ },
4752
6631
  {
4753
6632
  "name": "redactLogFields",
4754
6633
  "kind": "function",
@@ -4784,11 +6663,18 @@
4784
6663
  "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
6664
  "doc": "/** Options for {@link redirect}. */"
4786
6665
  },
6666
+ {
6667
+ "name": "reflectClassification",
6668
+ "kind": "function",
6669
+ "package": "@nifrajs/core",
6670
+ "signature": "export declare function reflectClassification(schema: unknown): ResponseClassification | undefined;",
6671
+ "doc": "/** Read field-level metadata from an introspectable response schema. Never invokes its validator. */"
6672
+ },
4787
6673
  {
4788
6674
  "name": "ReflectedRoute",
4789
6675
  "kind": "interface",
4790
6676
  "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}"
6677
+ "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
6678
  },
4793
6679
  {
4794
6680
  "name": "ReflectedRouteSchema",
@@ -4852,6 +6738,12 @@
4852
6738
  "signature": "export type RegistryOf<App> = App extends Server<infer R, infer _Ctx> ? R : never;",
4853
6739
  "doc": "/** Extract the accumulated route registry from a server's type (`typeof app`), ignoring its middleware context. */"
4854
6740
  },
6741
+ {
6742
+ "name": "RegistryParseResult",
6743
+ "kind": "type",
6744
+ "package": "@nifrajs/events",
6745
+ "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};"
6746
+ },
4855
6747
  {
4856
6748
  "name": "RenderAdapter",
4857
6749
  "kind": "interface",
@@ -4925,7 +6817,7 @@
4925
6817
  "name": "RenderPageOptions",
4926
6818
  "kind": "interface",
4927
6819
  "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}"
6820
+ "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
6821
  },
4930
6822
  {
4931
6823
  "name": "renderPageResult",
@@ -4944,7 +6836,7 @@
4944
6836
  "name": "RenderProps",
4945
6837
  "kind": "interface",
4946
6838
  "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}",
6839
+ "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
6840
  "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
6841
  },
4950
6842
  {
@@ -4982,6 +6874,19 @@
4982
6874
  "signature": "export declare function renderTypesResult(types: readonly TypeEntry[], name: string | undefined, query: string | undefined, limit: number): string;",
4983
6875
  "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 */"
4984
6876
  },
6877
+ {
6878
+ "name": "replayIncident",
6879
+ "kind": "function",
6880
+ "package": "@nifrajs/testing",
6881
+ "signature": "export declare function replayIncident(app: AppLike, capsule: IncidentCapsule, options?: ReplayIncidentOptions): Promise<IncidentReplayResult>;",
6882
+ "doc": "/** Replay a captured incident against the current app and report whether it reproduces. */"
6883
+ },
6884
+ {
6885
+ "name": "ReplayIncidentOptions",
6886
+ "kind": "interface",
6887
+ "package": "@nifrajs/testing",
6888
+ "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}"
6889
+ },
4985
6890
  {
4986
6891
  "name": "reproduciblePath",
4987
6892
  "kind": "function",
@@ -4989,6 +6894,13 @@
4989
6894
  "signature": "export declare function reproduciblePath(absolutePath: string): string;",
4990
6895
  "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
6896
  },
6897
+ {
6898
+ "name": "RequestBudget",
6899
+ "kind": "interface",
6900
+ "package": "@nifrajs/core",
6901
+ "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}",
6902
+ "doc": "/** A time budget shared by one request and every downstream hop it initiates. */"
6903
+ },
4992
6904
  {
4993
6905
  "name": "requestId",
4994
6906
  "kind": "function",
@@ -5002,6 +6914,13 @@
5002
6914
  "package": "@nifrajs/middleware",
5003
6915
  "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
6916
  },
6917
+ {
6918
+ "name": "RequestLedger",
6919
+ "kind": "interface",
6920
+ "package": "@nifrajs/core",
6921
+ "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}",
6922
+ "doc": "/** Per-request ledger. `append` is synchronous (hot-path safe); `seal` is idempotent and async. */"
6923
+ },
5005
6924
  {
5006
6925
  "name": "RequestLogFields",
5007
6926
  "kind": "interface",
@@ -5169,6 +7088,13 @@
5169
7088
  "package": "@nifrajs/middleware",
5170
7089
  "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
7090
  },
7091
+ {
7092
+ "name": "ResponseClassification",
7093
+ "kind": "interface",
7094
+ "package": "@nifrajs/core",
7095
+ "signature": "export interface ResponseClassification {\n readonly fields: Readonly<Record<string, DataClassification>>;\n readonly max: DataClassification;\n}",
7096
+ "doc": "/** Field paths use JSON Pointer segments; array items use a `*` segment. */"
7097
+ },
5172
7098
  {
5173
7099
  "name": "ResponseControls",
5174
7100
  "kind": "interface",
@@ -5190,6 +7116,13 @@
5190
7116
  "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
7117
  "doc": "/** The terminal response-pipeline outcome observed after every transforming `onResponse` hook. */"
5192
7118
  },
7119
+ {
7120
+ "name": "responseFromStored",
7121
+ "kind": "function",
7122
+ "package": "@nifrajs/core",
7123
+ "signature": "export declare function responseFromStored(stored: StoredResponse, options?: {\n readonly maxBytes?: number;\n}): Response;",
7124
+ "doc": "/** Rebuild a live response from storage, stamping the replay marker header. */"
7125
+ },
5193
7126
  {
5194
7127
  "name": "Result",
5195
7128
  "kind": "type",
@@ -5237,6 +7170,13 @@
5237
7170
  "signature": "export interface RevalidateResult<T> {\n readonly __nifraRevalidate: readonly string[];\n readonly data: T;\n}",
5238
7171
  "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
7172
  },
7173
+ {
7174
+ "name": "rewriteVersionSpec",
7175
+ "kind": "function",
7176
+ "package": "@nifrajs/cli",
7177
+ "signature": "export declare function rewriteVersionSpec(spec: string, toVersion: string): string | null;",
7178
+ "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 */"
7179
+ },
5240
7180
  {
5241
7181
  "name": "robots",
5242
7182
  "kind": "function",
@@ -5270,12 +7210,25 @@
5270
7210
  "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
7211
  "doc": "/** The body object type of `App`'s `Method Path` route (`never` when the route declares no body). */"
5272
7212
  },
7213
+ {
7214
+ "name": "RouteCapabilityEvidence",
7215
+ "kind": "interface",
7216
+ "package": "@nifrajs/core",
7217
+ "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}"
7218
+ },
5273
7219
  {
5274
7220
  "name": "RouteChange",
5275
7221
  "kind": "interface",
5276
7222
  "package": "@nifrajs/core",
5277
7223
  "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
7224
  },
7225
+ {
7226
+ "name": "routeClassification",
7227
+ "kind": "function",
7228
+ "package": "@nifrajs/core",
7229
+ "signature": "export declare function routeClassification(responseSchema: unknown, fallback: DataClassification | undefined): ResponseClassification | undefined;",
7230
+ "doc": "/** Merge field metadata with an optional route-level sensitivity fallback. */"
7231
+ },
5279
7232
  {
5280
7233
  "name": "RouteConfigError",
5281
7234
  "kind": "class",
@@ -5287,14 +7240,14 @@
5287
7240
  "name": "RouteConfigErrorCode",
5288
7241
  "kind": "type",
5289
7242
  "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\";",
7243
+ "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
7244
  "doc": "/** Stable codes for boot-time (L2) route configuration failures. */"
5292
7245
  },
5293
7246
  {
5294
7247
  "name": "RouteDescriptor",
5295
7248
  "kind": "interface",
5296
7249
  "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}",
7250
+ "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
7251
  "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
7252
  },
5300
7253
  {
@@ -5304,6 +7257,13 @@
5304
7257
  "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
7258
  "doc": "/** One matched route: pattern, nested layout ids (outermost → innermost), source file, loader. */"
5306
7259
  },
7260
+ {
7261
+ "name": "routeGlob",
7262
+ "kind": "function",
7263
+ "package": "@nifrajs/core",
7264
+ "signature": "export declare function routeGlob(pattern: string): RegExp;",
7265
+ "doc": "/** Compile an absolute route glob. `*` is one segment; `**` is zero or more segments. */"
7266
+ },
5307
7267
  {
5308
7268
  "name": "RouteInfo",
5309
7269
  "kind": "interface",
@@ -5388,6 +7348,20 @@
5388
7348
  "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
7349
  "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
7350
  },
7351
+ {
7352
+ "name": "RouterContext",
7353
+ "kind": "const",
7354
+ "package": "@nifrajs/web-react",
7355
+ "signature": "export declare const RouterContext: import(\"react\").Context<RouterContextValue>;",
7356
+ "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. */"
7357
+ },
7358
+ {
7359
+ "name": "RouterContextValue",
7360
+ "kind": "interface",
7361
+ "package": "@nifrajs/web-react",
7362
+ "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}",
7363
+ "doc": "/** The current route the routing hooks read. Provided by `compose` on SSR + client mount alike. */"
7364
+ },
5391
7365
  {
5392
7366
  "name": "RouterMatch",
5393
7367
  "kind": "type",
@@ -5406,7 +7380,7 @@
5406
7380
  "name": "RouteSchema",
5407
7381
  "kind": "interface",
5408
7382
  "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}",
7383
+ "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
7384
  "doc": "/** Per-route input schemas. Each is any Standard Schema (zod/valibot/arktype/…). */"
5411
7385
  },
5412
7386
  {
@@ -5474,6 +7448,13 @@
5474
7448
  "signature": "export declare function run(argv: readonly string[]): Promise<{\n code: 0 | 1;\n message: string;\n}>;",
5475
7449
  "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
7450
  },
7451
+ {
7452
+ "name": "runAdversarialContract",
7453
+ "kind": "function",
7454
+ "package": "@nifrajs/testing",
7455
+ "signature": "export declare function runAdversarialContract(app: ContractTestApp, options?: AdversarialContractOptions): Promise<AdversarialContractReport>;",
7456
+ "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 */"
7457
+ },
5477
7458
  {
5478
7459
  "name": "runApp",
5479
7460
  "kind": "function",
@@ -5481,6 +7462,12 @@
5481
7462
  "signature": "export declare function runApp(app: AppLike, requests: readonly RequestSpec[], options?: RunOptions): Promise<RunResult[]>;",
5482
7463
  "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
7464
  },
7465
+ {
7466
+ "name": "runAssurance",
7467
+ "kind": "function",
7468
+ "package": "@nifrajs/cli",
7469
+ "signature": "export declare function runAssurance(cwd: string, options?: {\n readonly json?: boolean;\n readonly config?: string;\n}): Promise<boolean>;"
7470
+ },
5484
7471
  {
5485
7472
  "name": "runBackend",
5486
7473
  "kind": "function",
@@ -5488,6 +7475,20 @@
5488
7475
  "signature": "export declare function runBackend(cwd: string, requests: unknown, entry?: string): Promise<{\n results: unknown;\n} | {\n error: string;\n}>;",
5489
7476
  "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
7477
  },
7478
+ {
7479
+ "name": "runCapabilityCheck",
7480
+ "kind": "function",
7481
+ "package": "@nifrajs/cli",
7482
+ "signature": "export declare function runCapabilityCheck(cwd: string, options?: {\n readonly config?: string;\n readonly lockfile?: string;\n readonly json?: boolean;\n}): Promise<boolean>;",
7483
+ "doc": "/** Fail on assurance violations or any drift from the checked-in capability lockfile. */"
7484
+ },
7485
+ {
7486
+ "name": "runCapabilitySnapshot",
7487
+ "kind": "function",
7488
+ "package": "@nifrajs/cli",
7489
+ "signature": "export declare function runCapabilitySnapshot(cwd: string, options?: {\n readonly config?: string;\n readonly out?: string;\n}): Promise<boolean>;",
7490
+ "doc": "/** Write a lockfile only from a clean, fully-covered project report. */"
7491
+ },
5491
7492
  {
5492
7493
  "name": "runCheck",
5493
7494
  "kind": "function",
@@ -5495,6 +7496,13 @@
5495
7496
  "signature": "export declare function runCheck(cwd: string, opts?: {\n readonly json?: boolean;\n readonly lintsOnly?: boolean;\n}): Promise<boolean>;",
5496
7497
  "doc": "/** Run the full check; print a report (`--json` for machine output) and return whether it passed. */"
5497
7498
  },
7499
+ {
7500
+ "name": "runContractInvariants",
7501
+ "kind": "function",
7502
+ "package": "@nifrajs/core",
7503
+ "signature": "export declare function runContractInvariants(app: ReflectableApp, options?: RunInvariantsOptions): Promise<InvariantReport>;",
7504
+ "doc": "/**\n * @deprecated Use `runAdversarialContract` from `@nifrajs/testing`. The testing package is the\n * authoritative deep contract laboratory and powers CLI L4; this export remains for compatibility.\n */"
7505
+ },
5498
7506
  {
5499
7507
  "name": "runDiff",
5500
7508
  "kind": "function",
@@ -5509,6 +7517,13 @@
5509
7517
  "signature": "export declare function runDoctor(cwd: string, opts?: {\n readonly json?: boolean;\n readonly autoFix?: boolean;\n}): Promise<boolean>;",
5510
7518
  "doc": "/** Run doctor; print a report (`--json` for machine output) and return whether it passed. */"
5511
7519
  },
7520
+ {
7521
+ "name": "runFailureScenario",
7522
+ "kind": "function",
7523
+ "package": "@nifrajs/testing",
7524
+ "signature": "export declare function runFailureScenario<Output>(scenario: FailureScenario<Output>, options: FailureLabOptions): Promise<FailureScenarioReport>;",
7525
+ "doc": "/** Run one scenario and evaluate its post-failure invariant without leaking its result or error text. */"
7526
+ },
5512
7527
  {
5513
7528
  "name": "runInitAgents",
5514
7529
  "kind": "function",
@@ -5516,6 +7531,33 @@
5516
7531
  "signature": "export declare function runInitAgents(cwd: string, opts?: {\n readonly json?: boolean;\n readonly force?: boolean;\n}): Promise<boolean>;",
5517
7532
  "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
7533
  },
7534
+ {
7535
+ "name": "RunInvariantsOptions",
7536
+ "kind": "interface",
7537
+ "package": "@nifrajs/core",
7538
+ "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}"
7539
+ },
7540
+ {
7541
+ "name": "runLevels",
7542
+ "kind": "function",
7543
+ "package": "@nifrajs/cli",
7544
+ "signature": "export declare function runLevels(cwd: string, options?: CollectLevelsOptions & {\n readonly json?: boolean;\n readonly min?: number;\n}): Promise<boolean>;",
7545
+ "doc": "/** CLI entry: print the ladder (or JSON) and return whether the requested floor is met. */"
7546
+ },
7547
+ {
7548
+ "name": "runManifestDiff",
7549
+ "kind": "function",
7550
+ "package": "@nifrajs/cli",
7551
+ "signature": "export declare function runManifestDiff(cwd: string, beforePath: string, afterPath: string, options?: {\n readonly json?: boolean;\n}): Promise<boolean>;",
7552
+ "doc": "/** Diff two already-emitted, hash-verified artifacts. Suitable for deploy promotion gates. */"
7553
+ },
7554
+ {
7555
+ "name": "runManifestEmit",
7556
+ "kind": "function",
7557
+ "package": "@nifrajs/cli",
7558
+ "signature": "export declare function runManifestEmit(cwd: string, options?: {\n readonly config?: string;\n readonly out?: string;\n readonly sign?: string;\n}): Promise<boolean>;",
7559
+ "doc": "/** Build only after both assurance layers pass, then optionally create an operator-signed sidecar. */"
7560
+ },
5519
7561
  {
5520
7562
  "name": "runMcpServer",
5521
7563
  "kind": "function",
@@ -5582,6 +7624,19 @@
5582
7624
  "signature": "export declare function runSnapshot(cwd: string, options: {\n out?: string;\n}): Promise<void>;",
5583
7625
  "doc": "/** `nifra snapshot`: write the current contract as the CI baseline. */"
5584
7626
  },
7627
+ {
7628
+ "name": "runtimeAdapterCertificationProfile",
7629
+ "kind": "function",
7630
+ "package": "@nifrajs/testing",
7631
+ "signature": "export declare function runtimeAdapterCertificationProfile(): AdapterCertificationProfile<CertifiableRuntimeAdapter>;"
7632
+ },
7633
+ {
7634
+ "name": "runUpgrade",
7635
+ "kind": "function",
7636
+ "package": "@nifrajs/cli",
7637
+ "signature": "export declare function runUpgrade(cwd: string, options: UpgradeOptions): Promise<boolean>;",
7638
+ "doc": "/** CLI entry. Returns false (→ non-zero exit) on an unknown version, no project, or a failed verify. */"
7639
+ },
5585
7640
  {
5586
7641
  "name": "runWebSocket",
5587
7642
  "kind": "function",
@@ -5652,6 +7707,13 @@
5652
7707
  "package": "@nifrajs/cli",
5653
7708
  "signature": "export interface ScaffoldWriteResult extends ScaffoldResult {\n readonly written: boolean;\n readonly reason?: string;\n}"
5654
7709
  },
7710
+ {
7711
+ "name": "scanEffectImports",
7712
+ "kind": "function",
7713
+ "package": "@nifrajs/cli",
7714
+ "signature": "export declare function scanEffectImports(content: string): string[];",
7715
+ "doc": "/** Value-bearing import edges relevant to effect provenance, in source order. */"
7716
+ },
5655
7717
  {
5656
7718
  "name": "scanFetchText",
5657
7719
  "kind": "function",
@@ -5793,6 +7855,13 @@
5793
7855
  "package": "@nifrajs/web",
5794
7856
  "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
7857
  },
7858
+ {
7859
+ "name": "SealedEffectLedger",
7860
+ "kind": "interface",
7861
+ "package": "@nifrajs/core",
7862
+ "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}",
7863
+ "doc": "/** The immutable result of sealing a request's ledger. Token-only; safe to hand to any sink. */"
7864
+ },
5796
7865
  {
5797
7866
  "name": "searchExamples",
5798
7867
  "kind": "function",
@@ -5806,6 +7875,13 @@
5806
7875
  "package": "@nifrajs/core",
5807
7876
  "signature": "export declare function searchOf(url: string): string;"
5808
7877
  },
7878
+ {
7879
+ "name": "SearchParamsInit",
7880
+ "kind": "type",
7881
+ "package": "@nifrajs/web-react",
7882
+ "signature": "export type SearchParamsInit = URLSearchParams | Record<string, string | readonly string[]> | string;",
7883
+ "doc": "/** The value forms `setSearchParams` accepts. */"
7884
+ },
5809
7885
  {
5810
7886
  "name": "searchSections",
5811
7887
  "kind": "function",
@@ -5887,6 +7963,27 @@
5887
7963
  "signature": "export declare function serializeData(data: unknown): string;",
5888
7964
  "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
7965
  },
7966
+ {
7967
+ "name": "serializeNifraManifest",
7968
+ "kind": "function",
7969
+ "package": "@nifrajs/core",
7970
+ "signature": "export declare function serializeNifraManifest(manifest: NifraManifest): string;",
7971
+ "doc": "/** Byte-stable artifact serialization (including `contentHash`). */"
7972
+ },
7973
+ {
7974
+ "name": "serializeNifraManifestSignature",
7975
+ "kind": "function",
7976
+ "package": "@nifrajs/core",
7977
+ "signature": "export declare function serializeNifraManifestSignature(signature: NifraManifestSignature): string;",
7978
+ "doc": "/** Byte-stable serialization for the detached signature sidecar. */"
7979
+ },
7980
+ {
7981
+ "name": "serializeResponse",
7982
+ "kind": "function",
7983
+ "package": "@nifrajs/core",
7984
+ "signature": "export declare function serializeResponse(response: Response, options?: {\n readonly maxBytes?: number;\n}): Promise<StoredResponse>;",
7985
+ "doc": "/** Buffer a response into a storable form. Clones first so the live response body stays intact. */"
7986
+ },
5890
7987
  {
5891
7988
  "name": "serve",
5892
7989
  "kind": "function",
@@ -5924,7 +8021,7 @@
5924
8021
  "name": "Server",
5925
8022
  "kind": "class",
5926
8023
  "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}",
8024
+ "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 * `hostname` is the bind address, defaulting to Bun's `0.0.0.0` (every interface). Pass\n * `\"127.0.0.1\"` to bind loopback only - an admin surface, a sidecar, or anything that must not be\n * reachable off the box. Omitting it when you meant to restrict is a real exposure, so it is a\n * first-class option rather than something a caller has to drop down to `Bun.serve` for.\n */\n listen(port: number, options?: {\n readonly reusePort?: boolean;\n readonly hostname?: string;\n }): RunningServer;\n /**\n * Gracefully stop: wait for in-flight requests to finish (up to `drainMs`), then\n * issue a single terminal stop — graceful if everything drained, forced if\n * stragglers remain. Safe to call when not listening.\n *\n * The Bun semantics: poll `pendingRequests` (awaiting\n * `stop()`'s promise drops in-flight requests), and decide graceful-vs-forced in\n * ONE call (Bun can't escalate an already-graceful `stop()` to a forced close).\n * New connections may be accepted during the drain window; in a real deploy the\n * load balancer has already stopped routing here, and `drainMs` bounds it.\n */\n stop({ drainMs }?: {\n drainMs?: number;\n }): Promise<void>;\n private installSignalHandlers;\n}",
5928
8025
  "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
8026
  },
5930
8027
  {
@@ -5972,7 +8069,7 @@
5972
8069
  "name": "ServerOptions",
5973
8070
  "kind": "interface",
5974
8071
  "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}"
8072
+ "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
8073
  },
5977
8074
  {
5978
8075
  "name": "ServeStaticOptions",
@@ -6035,6 +8132,13 @@
6035
8132
  "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
8133
  "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
8134
  },
8135
+ {
8136
+ "name": "setBrowserNavigate",
8137
+ "kind": "function",
8138
+ "package": "@nifrajs/web",
8139
+ "signature": "export declare function setBrowserNavigate(navigate: BrowserNavigate | undefined): void;",
8140
+ "doc": "/** Register (or clear, with `undefined`) the browser navigate — called by `installHistory`. Not for\n * app use. */"
8141
+ },
6038
8142
  {
6039
8143
  "name": "setMountedRouter",
6040
8144
  "kind": "function",
@@ -6076,6 +8180,13 @@
6076
8180
  "package": "@nifrajs/cache",
6077
8181
  "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
8182
  },
8183
+ {
8184
+ "name": "SetSearchParams",
8185
+ "kind": "type",
8186
+ "package": "@nifrajs/web-react",
8187
+ "signature": "export type SetSearchParams = (next: SearchParamsInit | ((prev: URLSearchParams) => SearchParamsInit), options?: NavigateOptions) => void;",
8188
+ "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). */"
8189
+ },
6079
8190
  {
6080
8191
  "name": "setWsRuntime",
6081
8192
  "kind": "function",
@@ -6089,6 +8200,13 @@
6089
8200
  "package": "@nifrajs/middleware",
6090
8201
  "signature": "export declare function sha256(input: string | Uint8Array): Promise<Uint8Array<ArrayBuffer>>;"
6091
8202
  },
8203
+ {
8204
+ "name": "shapeOf",
8205
+ "kind": "function",
8206
+ "package": "@nifrajs/testing",
8207
+ "signature": "export declare function shapeOf(value: unknown): unknown;",
8208
+ "doc": "/** A stable structural fingerprint: keys + value *types*, not values. Used for the optional shape check. */"
8209
+ },
6092
8210
  {
6093
8211
  "name": "sharpImageBackend",
6094
8212
  "kind": "function",
@@ -6103,6 +8221,13 @@
6103
8221
  "signature": "export type SharpLike = (input: Uint8Array) => SharpInstance;",
6104
8222
  "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
8223
  },
8224
+ {
8225
+ "name": "ShedReason",
8226
+ "kind": "type",
8227
+ "package": "@nifrajs/middleware",
8228
+ "signature": "export type ShedReason = \"inflight\" | \"loop-lag\" | \"queue-timeout\" | \"policy\" | \"cancelled\";",
8229
+ "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 */"
8230
+ },
6106
8231
  {
6107
8232
  "name": "signal",
6108
8233
  "kind": "function",
@@ -6164,6 +8289,13 @@
6164
8289
  "package": "@nifrajs/image",
6165
8290
  "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
8291
  },
8292
+ {
8293
+ "name": "signNifraManifest",
8294
+ "kind": "function",
8295
+ "package": "@nifrajs/core",
8296
+ "signature": "export declare function signNifraManifest(manifest: NifraManifest, signer: NifraManifestSigner): Promise<NifraManifestSignature>;",
8297
+ "doc": "/** Sign without handling private keys: the operator-supplied signer may call KMS/HSM/local WebCrypto. */"
8298
+ },
6167
8299
  {
6168
8300
  "name": "signValue",
6169
8301
  "kind": "function",
@@ -6211,6 +8343,19 @@
6211
8343
  "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
8344
  "doc": "/** A whole build's size report — every chunk (largest first) + the totals. */"
6213
8345
  },
8346
+ {
8347
+ "name": "SkippedRoute",
8348
+ "kind": "interface",
8349
+ "package": "@nifrajs/core",
8350
+ "signature": "export interface SkippedRoute {\n readonly method: string;\n readonly path: string;\n readonly reason: string;\n}"
8351
+ },
8352
+ {
8353
+ "name": "snapshotCapabilities",
8354
+ "kind": "function",
8355
+ "package": "@nifrajs/core",
8356
+ "signature": "export declare function snapshotCapabilities(report: CapabilityAssuranceReport): CapabilitySnapshot;",
8357
+ "doc": "/** Deterministic, PII-free lockfile material. */"
8358
+ },
6214
8359
  {
6215
8360
  "name": "SnapshotFile",
6216
8361
  "kind": "interface",
@@ -6403,11 +8548,24 @@
6403
8548
  "signature": "export interface StandardWebSocket {\n send(data: string | ArrayBufferView | ArrayBuffer): void;\n close(code?: number, reason?: string): void;\n readonly readyState: number;\n binaryType?: string;\n addEventListener(type: string, listener: (event: never) => void): void;\n}",
6404
8549
  "doc": "/**\n * A standard server-side `WebSocket` — the half returned by Deno's `Deno.upgradeWebSocket` and the\n * Workers `WebSocketPair`. {@link attachWebSocket} wires one to a nifra handler, so the Deno and Workers\n * bridges share all the dispatch/normalization/error-isolation logic (only the upgrade call differs).\n */"
6405
8550
  },
8551
+ {
8552
+ "name": "startCausality",
8553
+ "kind": "function",
8554
+ "package": "@nifrajs/core",
8555
+ "signature": "export declare function startCausality(nodeKind: CausalityKind, id: string, options: StartCausalityOptions): CausalityStep;",
8556
+ "doc": "/** Start a root execution node at an ingress boundary. */"
8557
+ },
8558
+ {
8559
+ "name": "StartCausalityOptions",
8560
+ "kind": "interface",
8561
+ "package": "@nifrajs/core",
8562
+ "signature": "export interface StartCausalityOptions {\n /** Stable graph identity. Generate once at the ingress boundary, then propagate it. */\n readonly executionId: string;\n /** Epoch milliseconds. Injectable for deterministic tests. Default `Date.now()`. */\n readonly at?: number;\n /** Observation opened for this exact node. */\n readonly trace?: CausalityTrace;\n}"
8563
+ },
6406
8564
  {
6407
8565
  "name": "StartObservation",
6408
8566
  "kind": "interface",
6409
8567
  "package": "@nifrajs/otel",
6410
- "signature": "export interface StartObservation {\n readonly name: string;\n /** Explicit parent. `null` forces a root span; `undefined` falls back to `traceparent`. */\n readonly parent?: ObservationParent | null;\n /** Inbound W3C header used when `parent` is undefined. */\n readonly traceparent?: string | null;\n readonly attributes?: Readonly<Record<string, AttributeValue>>;\n}"
8568
+ "signature": "export interface StartObservation {\n readonly name: string;\n /** Explicit parent. `null` forces a root span; `undefined` falls back to `traceparent`. */\n readonly parent?: ObservationParent | null;\n /** Inbound W3C header used when `parent` is undefined. */\n readonly traceparent?: string | null;\n readonly attributes?: Readonly<Record<string, AttributeValue>>;\n /** Non-parent causal relationships, for example an outbox event that resumed this workflow. */\n readonly links?: readonly ObservationLink[];\n}"
6411
8569
  },
6412
8570
  {
6413
8571
  "name": "StaticPath",
@@ -6443,6 +8601,12 @@
6443
8601
  "signature": "export interface StorageAdapter {\n /** Store `data` under `key`, overwriting any existing object. */\n put(key: string, data: StorageData, options?: PutOptions): Promise<void>;\n /** Read the object at `key`, or `null` if it doesn't exist. */\n get(key: string): Promise<StorageObject | null>;\n /** Remove `key`. No-op if it doesn't exist. */\n delete(key: string): Promise<void>;\n /** Whether an object exists at `key`. */\n exists(key: string): Promise<boolean>;\n /** List stored keys (optionally filtered by prefix + capped). */\n list(options?: ListOptions): Promise<string[]>;\n}",
6444
8602
  "doc": "/**\n * A blob store keyed by string. Keys are POSIX-ish paths (`avatars/u1.png`); every adapter rejects unsafe\n * keys (absolute, `..` traversal, NUL, backslash) so a key valid in one adapter is valid in all. All\n * methods are async.\n */"
6445
8603
  },
8604
+ {
8605
+ "name": "storageAdapterCertificationProfile",
8606
+ "kind": "function",
8607
+ "package": "@nifrajs/testing",
8608
+ "signature": "export declare function storageAdapterCertificationProfile(options?: {\n readonly paging?: boolean;\n readonly presign?: boolean;\n readonly move?: boolean;\n}): AdapterCertificationProfile<CertifiableStorageAdapter>;"
8609
+ },
6446
8610
  {
6447
8611
  "name": "StorageAdapterConformanceError",
6448
8612
  "kind": "class",
@@ -6527,6 +8691,13 @@
6527
8691
  "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
8692
  "doc": "/** A job as handed back by {@link JobStore.lease}. `attempt` is the count of PRIOR attempts (0 the first time). */"
6529
8693
  },
8694
+ {
8695
+ "name": "StoredResponse",
8696
+ "kind": "interface",
8697
+ "package": "@nifrajs/core",
8698
+ "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}",
8699
+ "doc": "/** A serialized response held by a store. `body` is base64 so binary payloads round-trip intact. */"
8700
+ },
6530
8701
  {
6531
8702
  "name": "string",
6532
8703
  "kind": "function",
@@ -6805,7 +8976,7 @@
6805
8976
  "name": "traceHeaders",
6806
8977
  "kind": "function",
6807
8978
  "package": "@nifrajs/otel",
6808
- "signature": "export declare function traceHeaders(trace: TraceContext): {\n traceparent: string;\n};",
8979
+ "signature": "export declare function traceHeaders(trace: TraceContext, causality?: CausalityContext): {\n readonly traceparent: string;\n} & Readonly<Record<string, string>>;",
6809
8980
  "doc": "/** Spread into an outgoing `fetch`/`ctx.api` call's headers to continue the trace downstream:\n * `fetch(url, { headers: traceHeaders(c.trace) })`. */"
6810
8981
  },
6811
8982
  {
@@ -6819,7 +8990,7 @@
6819
8990
  "name": "TracingOptions",
6820
8991
  "kind": "interface",
6821
8992
  "package": "@nifrajs/otel",
6822
- "signature": "export interface TracingOptions {\n /** Where spans are sent. Default: {@link consoleSpanExporter}. */\n readonly exporter?: SpanExporter;\n /** Additional observation adapters (DevTools, a private redacting backend, metrics, …). */\n readonly adapters?: readonly ObservationAdapter[];\n /** Sets the `service.name` attribute on every span. */\n readonly serviceName?: string;\n /**\n * Set the outbound `traceparent` on the RESPONSE too (handy for browser/client correlation).\n * Default false — most setups only propagate downstream, not back to the caller.\n */\n readonly responseHeader?: boolean;\n}"
8993
+ "signature": "export interface TracingOptions {\n /** Where spans are sent. Default: {@link consoleSpanExporter}. */\n readonly exporter?: SpanExporter;\n /** Additional observation adapters (DevTools, a private redacting backend, metrics, …). */\n readonly adapters?: readonly ObservationAdapter[];\n /** Sets the `service.name` attribute on every span. */\n readonly serviceName?: string;\n /**\n * Set the outbound `traceparent` on the RESPONSE too (handy for browser/client correlation).\n * Default false — most setups only propagate downstream, not back to the caller.\n */\n readonly responseHeader?: boolean;\n /**\n * Optional durable graph recorder. When configured, the request root is appended before the\n * handler runs and recorder failure fails closed. Without one, `c.causality` is still propagated.\n */\n readonly causality?: {\n readonly recorder?: CausalityRecorder;\n /** Injectable epoch clock for deterministic tests. */\n readonly now?: () => number;\n /**\n * Explicit trust gate for service-to-service causality headers. Internet clients are untrusted\n * by default; a false result or thrown/rejected check starts a fresh execution graph.\n */\n readonly acceptInbound?: (request: Request, context: CausalityContext) => boolean | Promise<boolean>;\n };\n}"
6823
8994
  },
6824
8995
  {
6825
8996
  "name": "TrailingSlashOptions",
@@ -6924,6 +9095,13 @@
6924
9095
  "signature": "export declare function uiResourceMeta(uri: string): Record<string, unknown>;",
6925
9096
  "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
9097
  },
9098
+ {
9099
+ "name": "UNBOUNDED_DEADLINE",
9100
+ "kind": "const",
9101
+ "package": "@nifrajs/core",
9102
+ "signature": "export declare const UNBOUNDED_DEADLINE: number;",
9103
+ "doc": "/** Sentinel used only for an unbounded local budget. It is never written to the wire. */"
9104
+ },
6927
9105
  {
6928
9106
  "name": "unsignValue",
6929
9107
  "kind": "function",
@@ -6938,6 +9116,24 @@
6938
9116
  "signature": "export declare class UnsupportedMockSchemaError extends Error {\n readonly keyword: string;\n constructor(keyword: string, message: string);\n}",
6939
9117
  "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
9118
  },
9119
+ {
9120
+ "name": "UpgradeOptions",
9121
+ "kind": "interface",
9122
+ "package": "@nifrajs/cli",
9123
+ "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}"
9124
+ },
9125
+ {
9126
+ "name": "UpgradePlan",
9127
+ "kind": "interface",
9128
+ "package": "@nifrajs/cli",
9129
+ "signature": "export interface UpgradePlan {\n readonly version: string;\n readonly pins: readonly PinChange[];\n readonly importMoves: readonly ImportChange[];\n readonly notes: readonly string[];\n}"
9130
+ },
9131
+ {
9132
+ "name": "UpgradeRecipe",
9133
+ "kind": "interface",
9134
+ "package": "@nifrajs/cli",
9135
+ "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}"
9136
+ },
6941
9137
  {
6942
9138
  "name": "UploadResult",
6943
9139
  "kind": "type",
@@ -6958,6 +9154,20 @@
6958
9154
  "package": "@nifrajs/core",
6959
9155
  "signature": "export declare function urlPartsOf(url: string): UrlParts;"
6960
9156
  },
9157
+ {
9158
+ "name": "useCapability",
9159
+ "kind": "function",
9160
+ "package": "@nifrajs/core",
9161
+ "signature": "export declare function useCapability(context: object, capability: string, options?: UseCapabilityOptions): void;",
9162
+ "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 */"
9163
+ },
9164
+ {
9165
+ "name": "UseCapabilityOptions",
9166
+ "kind": "interface",
9167
+ "package": "@nifrajs/core",
9168
+ "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}",
9169
+ "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 */"
9170
+ },
6961
9171
  {
6962
9172
  "name": "useFetcher",
6963
9173
  "kind": "function",
@@ -7021,6 +9231,34 @@
7021
9231
  "signature": "export declare function useFetchers(): Readonly<ShallowRef<readonly Fetcher[]>>;",
7022
9232
  "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
9233
  },
9234
+ {
9235
+ "name": "useInfiniteQuery",
9236
+ "kind": "function",
9237
+ "package": "@nifrajs/web-react",
9238
+ "signature": "export declare function useInfiniteQuery<T, P>(key: unknown, fn: (pageParam: P) => Promise<T>, options: UseInfiniteQueryOptions<T, P>): UseInfiniteQueryResult<T, P>;",
9239
+ "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 */"
9240
+ },
9241
+ {
9242
+ "name": "UseInfiniteQueryOptions",
9243
+ "kind": "interface",
9244
+ "package": "@nifrajs/web-react",
9245
+ "signature": "export interface UseInfiniteQueryOptions<T, P> extends InfiniteQueryOptions<T, P> {\n readonly enabled?: boolean;\n}",
9246
+ "doc": "/** Options for {@link useInfiniteQuery} — the engine's {@link InfiniteQueryOptions} plus `enabled`. */"
9247
+ },
9248
+ {
9249
+ "name": "UseInfiniteQueryResult",
9250
+ "kind": "interface",
9251
+ "package": "@nifrajs/web-react",
9252
+ "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}",
9253
+ "doc": "/** An infinite query's reactive state + paging controls. */"
9254
+ },
9255
+ {
9256
+ "name": "useLocation",
9257
+ "kind": "function",
9258
+ "package": "@nifrajs/web-react",
9259
+ "signature": "export declare function useLocation(): Location;",
9260
+ "doc": "/** The current {@link Location} (`pathname`/`search`/`hash`), derived from the router context. */"
9261
+ },
7024
9262
  {
7025
9263
  "name": "useMDXComponents",
7026
9264
  "kind": "function",
@@ -7028,6 +9266,34 @@
7028
9266
  "signature": "export declare function useMDXComponents(): Record<string, (props: Record<string, unknown>) => unknown>;",
7029
9267
  "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
9268
  },
9269
+ {
9270
+ "name": "useMutation",
9271
+ "kind": "function",
9272
+ "package": "@nifrajs/web-react",
9273
+ "signature": "export declare function useMutation<TData, TVariables = void>(fn: (variables: TVariables) => Promise<TData>, callbacks?: MutationCallbacks<TData, TVariables>): UseMutationResult<TData, TVariables>;",
9274
+ "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 */"
9275
+ },
9276
+ {
9277
+ "name": "UseMutationResult",
9278
+ "kind": "interface",
9279
+ "package": "@nifrajs/web-react",
9280
+ "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}",
9281
+ "doc": "/** A mutation's reactive state + imperative controls (the TanStack `useMutation` shape). */"
9282
+ },
9283
+ {
9284
+ "name": "useNavigate",
9285
+ "kind": "function",
9286
+ "package": "@nifrajs/web-react",
9287
+ "signature": "export declare function useNavigate(): NavigateFunction;",
9288
+ "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). */"
9289
+ },
9290
+ {
9291
+ "name": "useParams",
9292
+ "kind": "function",
9293
+ "package": "@nifrajs/web-react",
9294
+ "signature": "export declare function useParams<T extends Record<string, string | undefined> = Record<string, string>>(): Readonly<T>;",
9295
+ "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 */"
9296
+ },
7031
9297
  {
7032
9298
  "name": "useQuery",
7033
9299
  "kind": "function",
@@ -7039,8 +9305,8 @@
7039
9305
  "name": "useQuery",
7040
9306
  "kind": "function",
7041
9307
  "package": "@nifrajs/web-react",
7042
- "signature": "export declare function useQuery<T>(key: unknown, fn: () => Promise<T>): UseQueryResult<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 +\n * one in-flight fetch (dedup). Refetches on mount and when the key changes; SSR-idle.\n */"
9308
+ "signature": "export declare function useQuery<T>(key: unknown, fn: () => Promise<T>, options?: UseQueryOptions): UseQueryResult<T>;",
9309
+ "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
9310
  },
7045
9311
  {
7046
9312
  "name": "useQuery",
@@ -7067,8 +9333,8 @@
7067
9333
  "name": "useQueryClient",
7068
9334
  "kind": "function",
7069
9335
  "package": "@nifrajs/web-react",
7070
- "signature": "export declare function useQueryClient(): Pick<QueryClient, \"invalidateQueries\">;",
7071
- "doc": "/** Access the query client to imperatively `invalidateQueries(keyOrPrefix)` (e.g. after a mutation). */"
9336
+ "signature": "export declare function useQueryClient(): QueryClient;",
9337
+ "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
9338
  },
7073
9339
  {
7074
9340
  "name": "useQueryClient",
@@ -7091,6 +9357,13 @@
7091
9357
  "signature": "export declare function useQueryClient(): Pick<QueryClient, \"invalidateQueries\">;",
7092
9358
  "doc": "/** Access the query client to imperatively `invalidateQueries(keyOrPrefix)` (e.g. after a mutation). */"
7093
9359
  },
9360
+ {
9361
+ "name": "UseQueryOptions",
9362
+ "kind": "interface",
9363
+ "package": "@nifrajs/web-react",
9364
+ "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}",
9365
+ "doc": "/** Options for {@link useQuery}. */"
9366
+ },
7094
9367
  {
7095
9368
  "name": "UseQueryResult",
7096
9369
  "kind": "interface",
@@ -7102,7 +9375,7 @@
7102
9375
  "name": "UseQueryResult",
7103
9376
  "kind": "interface",
7104
9377
  "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}",
9378
+ "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
9379
  "doc": "/** A query's reactive {@link QueryState} plus `isPending` + `refetch`. */"
7107
9380
  },
7108
9381
  {
@@ -7112,6 +9385,13 @@
7112
9385
  "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
9386
  "doc": "/** A query's reactive {@link QueryState} (read `.value`) plus `refetch`. */"
7114
9387
  },
9388
+ {
9389
+ "name": "useSearchParams",
9390
+ "kind": "function",
9391
+ "package": "@nifrajs/web-react",
9392
+ "signature": "export declare function useSearchParams(): readonly [URLSearchParams, SetSearchParams];",
9393
+ "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 */"
9394
+ },
7115
9395
  {
7116
9396
  "name": "useT",
7117
9397
  "kind": "function",
@@ -7179,6 +9459,44 @@
7179
9459
  "package": "@nifrajs/core",
7180
9460
  "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
9461
  },
9462
+ {
9463
+ "name": "validCapabilityId",
9464
+ "kind": "function",
9465
+ "package": "@nifrajs/core",
9466
+ "signature": "export declare function validCapabilityId(value: string): boolean;"
9467
+ },
9468
+ {
9469
+ "name": "validEvidence",
9470
+ "kind": "function",
9471
+ "package": "@nifrajs/core",
9472
+ "signature": "export declare function validEvidence(value: unknown): value is AssuranceEvidence;"
9473
+ },
9474
+ {
9475
+ "name": "validEvidenceId",
9476
+ "kind": "function",
9477
+ "package": "@nifrajs/core",
9478
+ "signature": "export declare function validEvidenceId(value: string): boolean;"
9479
+ },
9480
+ {
9481
+ "name": "validIdempotencyKey",
9482
+ "kind": "function",
9483
+ "package": "@nifrajs/core",
9484
+ "signature": "export declare function validIdempotencyKey(key: string): boolean;",
9485
+ "doc": "/** A key must be a non-empty, bounded, control-char-free token. Fail closed on anything else. */"
9486
+ },
9487
+ {
9488
+ "name": "validIdempotencyNamespace",
9489
+ "kind": "function",
9490
+ "package": "@nifrajs/core",
9491
+ "signature": "export declare function validIdempotencyNamespace(namespace: string): boolean;",
9492
+ "doc": "/** Namespace values are server-resolved, bounded opaque tokens (normally a tenant/subject hash). */"
9493
+ },
9494
+ {
9495
+ "name": "validMethod",
9496
+ "kind": "function",
9497
+ "package": "@nifrajs/core",
9498
+ "signature": "export declare function validMethod(value: string): value is Method;"
9499
+ },
7182
9500
  {
7183
9501
  "name": "vanillaAdapter",
7184
9502
  "kind": "const",
@@ -7200,12 +9518,32 @@
7200
9518
  "signature": "export type Verdict = \"ok\" | \"caveat\" | \"unsupported\";",
7201
9519
  "doc": "/** A target's verdict for one feature: fully fine, works-with-a-caveat, or won't work at all. */"
7202
9520
  },
9521
+ {
9522
+ "name": "VerificationLevelsResult",
9523
+ "kind": "interface",
9524
+ "package": "@nifrajs/cli",
9525
+ "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}"
9526
+ },
9527
+ {
9528
+ "name": "VerificationLevelStatus",
9529
+ "kind": "interface",
9530
+ "package": "@nifrajs/cli",
9531
+ "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}",
9532
+ "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 */"
9533
+ },
7203
9534
  {
7204
9535
  "name": "VerifiedJwt",
7205
9536
  "kind": "interface",
7206
9537
  "package": "@nifrajs/middleware",
7207
9538
  "signature": "export interface VerifiedJwt<C extends JwtClaims = JwtClaims> {\n readonly header: JwtHeader;\n readonly claims: C;\n readonly token: string;\n}"
7208
9539
  },
9540
+ {
9541
+ "name": "verifyAdapterCertification",
9542
+ "kind": "function",
9543
+ "package": "@nifrajs/testing",
9544
+ "signature": "export declare function verifyAdapterCertification(report: AdapterCertificationReport): Promise<boolean>;",
9545
+ "doc": "/** Recompute the portable evidence hash. Consumers should verify before trusting a stored report. */"
9546
+ },
7209
9547
  {
7210
9548
  "name": "verifyCsrfToken",
7211
9549
  "kind": "function",
@@ -7250,6 +9588,13 @@
7250
9588
  "package": "@nifrajs/middleware",
7251
9589
  "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
9590
  },
9591
+ {
9592
+ "name": "verifyNifraManifestSignature",
9593
+ "kind": "function",
9594
+ "package": "@nifrajs/core",
9595
+ "signature": "export declare function verifyNifraManifestSignature(manifest: NifraManifest, signature: NifraManifestSignature, publicKey: CryptoKey): Promise<boolean>;",
9596
+ "doc": "/** Verify the hash first, then the detached Ed25519 signature. Malformed/tampered input returns false. */"
9597
+ },
7253
9598
  {
7254
9599
  "name": "verifyWebhook",
7255
9600
  "kind": "function",
@@ -7273,7 +9618,7 @@
7273
9618
  "name": "VERSION",
7274
9619
  "kind": "const",
7275
9620
  "package": "@nifrajs/core",
7276
- "signature": "export declare const VERSION: \"1.6.0\";",
9621
+ "signature": "export declare const VERSION: \"1.12.0\";",
7277
9622
  "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
9623
  },
7279
9624
  {
@@ -7396,6 +9741,13 @@
7396
9741
  "signature": "export declare function widgetDocument(opts: DefineMcpWidgetOptions): string;",
7397
9742
  "doc": "/** Assemble the full self-contained widget document (bridge inlined in `<head>` so body scripts can use\n * `mcpApp` immediately). */"
7398
9743
  },
9744
+ {
9745
+ "name": "withDeadlineHeader",
9746
+ "kind": "function",
9747
+ "package": "@nifrajs/core",
9748
+ "signature": "export declare function withDeadlineHeader(input: DeadlineHeadersInit, budget: RequestBudget, reserveMs?: number): Headers;",
9749
+ "doc": "/** Add this budget's absolute deadline to an outbound request. */"
9750
+ },
7399
9751
  {
7400
9752
  "name": "withHeaders",
7401
9753
  "kind": "function",
@@ -7410,6 +9762,13 @@
7410
9762
  "signature": "export declare function withISR(app: ISRApp, options: ISROptions): (req: Request, platform?: ISRPlatform) => Promise<Response>;",
7411
9763
  "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
9764
  },
9765
+ {
9766
+ "name": "withRouteAssurance",
9767
+ "kind": "function",
9768
+ "package": "@nifrajs/core",
9769
+ "signature": "export declare function withRouteAssurance<T extends object>(target: T, declaration: AssuranceDeclaration | readonly AssuranceDeclaration[]): T;",
9770
+ "doc": "/** Attach enforcement evidence to the middleware/plugin that installs it. */"
9771
+ },
7413
9772
  {
7414
9773
  "name": "Worker",
7415
9774
  "kind": "interface",