import { FastifyRequest } from 'fastify'; import { PluginOption } from 'vite'; import { S as ServiceRegistry, R as RouteParams, a as ServiceMethodParams, b as ServiceDataHandler, c as CoreAppConfig, A as AppRoute, C as CoreTaujsConfig, d as CoreSecurityConfig, T as TaujsViteOverride, e as RouteContext$1, f as RouteData$1 } from './types-Ce1QlQ5E.js'; export { D as DeferredDataAttributes, g as DeferredDataOf, E as EmptyRouteData, H as HeadAttributes, h as HeadDataOf, J as JsonObject, i as JsonPrimitive, j as JsonValue, k as RegistryCaller, l as RoutePolicy, m as RoutePolicyEvidenceName, n as RoutePolicyRule, o as RoutePolicySelector, p as ServiceContext, q as ServiceMethodMetadata, r as TaujsOptimizeDeps, s as TaujsViteConfig, t as TaujsViteContext, u as TypedServiceContext, v as callServiceMethod, w as defineService, x as defineServiceRegistry, y as getServiceMethodMetadata, z as withDeadline } from './types-Ce1QlQ5E.js'; import { TaujsRendererContribution } from './Renderer.js'; type CSPDirectives = Record; type CSPViolationReport = { 'document-uri': string; 'violated-directive': string; 'blocked-uri'?: string; 'source-file'?: string; 'line-number'?: number; 'column-number'?: number; 'script-sample'?: string; 'original-policy'?: string; disposition?: 'enforce' | 'report'; }; type ServiceDataMetadata = Readonly<{ serviceName: string; serviceMethod: string; }>; /** * The smallest read-only view of the request a mapper needs to translate path params (plus query * state and header values) into explicit service params, without exposing the capability-rich * loader context. The facts view does not grant the mapper τjs's request-scoped registry caller; * mappers should remain synchronous, side-effect-free argument translations. Both `headers` and * the facts object itself are fresh frozen copies, never the loader context's own objects, so * mutating them has no effect on the request. */ type ServiceDataRequestFacts = Readonly<{ url: string; headers: Readonly>; }>; type ServiceDataMapper

= (params: RouteParams, facts: ServiceDataRequestFacts) => P; type ServiceDataArgs = RouteParams extends ServiceMethodParams ? [serviceName: S, serviceMethod: M, mapper?: ServiceDataMapper>] : [serviceName: S, serviceMethod: M, mapper: ServiceDataMapper>]; type ServiceMethodResult = F extends (...args: any[]) => infer P ? Awaited

: never; declare function createServiceData(): (...[serviceName, serviceMethod, mapper]: ServiceDataArgs) => ServiceDataHandler>; declare const getServiceDataMetadata: (handler: unknown) => ServiceDataMetadata | undefined; type ErrorKind = 'infra' | 'upstream' | 'domain' | 'validation' | 'auth' | 'canceled' | 'timeout'; declare class AppError extends Error { readonly kind: ErrorKind; readonly httpStatus: number; readonly details?: unknown; readonly safeMessage: string; readonly code?: string; constructor(message: string, kind: ErrorKind, options?: { httpStatus?: number; details?: unknown; cause?: unknown; safeMessage?: string; code?: string; }); private getSafeMessage; private serialiseValue; toJSON(): any; static notFound(message: string, details?: unknown, code?: string): AppError; static forbidden(message: string, details?: unknown, code?: string): AppError; static badRequest(message: string, details?: unknown, code?: string): AppError; static unprocessable(message: string, details?: unknown, code?: string): AppError; static timeout(message: string, details?: unknown, code?: string): AppError; static canceled(message: string, details?: unknown, code?: string): AppError; static internal(message: string, cause?: unknown, details?: unknown, code?: string): AppError; static upstream(message: string, cause?: unknown, details?: unknown, code?: string): AppError; static serviceUnavailable(message: string, cause?: unknown, details?: unknown, code?: string): AppError; /** * Brand-based identity check: true for any AppError instance, including ones * constructed by a different copy of this class. Use this instead of * `instanceof AppError` everywhere an error may cross a module boundary. */ static isAppError(value: unknown): value is AppError; static from(err: unknown, fallback?: string): AppError; } type SecurityConfig = CoreSecurityConfig & { csp?: { directives?: CSPDirectives; generateCSP?: (directives: CSPDirectives, nonce: string, req?: FastifyRequest) => string; reporting?: { endpoint: string; onViolation?: (report: CSPViolationReport, req: FastifyRequest) => void; reportOnly?: boolean; }; }; }; type AppConfig = CoreAppConfig & { renderer: TaujsRendererContribution; plugins?: PluginOption[]; routes?: readonly AppRoute[]; }; type TaujsConfig = CoreTaujsConfig & { apps: readonly AppConfig[]; security?: SecurityConfig; vite?: TaujsViteOverride; }; /** * Public-alias repair (2026-07-30): generic with a broad default, mirroring `RouteData` below. * Bare `RouteContext` is the broad runtime shape `{ appId, path, attr, params }`; supply your * config - `RouteContext` - for per-route precision. The previous non-generic * alias collapsed to `never` (optional `routes` failed RoutesOfApp's array test) and was * unusable. Pinned by `test/PublicRouteContext.test-d.ts`. */ type RouteContext = RouteContext$1; type RouteData = RouteData$1; declare function defineConfig(config: C): C; /** * Const-preserving capture point for a route array authored outside `taujs.config.ts`. Identity * at runtime; preserves the literal types that `RouteContext`/`RouteData` derive from. Fragments * compose by spreading: `routes: [...authRoutes, ...catalogRoutes]`. */ declare function defineRoutes>(routes: R): R; /** * Const-preserving capture point for a whole app configuration authored outside `taujs.config.ts`. * Identity at runtime; preserves the literal types that `RouteContext`/`RouteData` derive from. */ declare function defineApp(app: A): A; export { type AppConfig, AppError, type RouteContext, type RouteData, RouteParams, type SecurityConfig, ServiceDataHandler, type ServiceDataMetadata, type ServiceDataRequestFacts, ServiceRegistry, type TaujsConfig, TaujsRendererContribution, TaujsViteOverride, createServiceData, defineApp, defineConfig, defineRoutes, getServiceDataMetadata };