import { R as RouteEntry, a as RouteRole } from './roles-DBgzkvEt.js'; /** * Runtime well-known endpoint — Request → Response serving ManifestV1 * compiled from the app's enumerated routes. * * Pure + isomorphic: no node builtins, no framework imports. The app hands * over RouteEntry[] (or a thunk) computed from its router; this module only * compiles and serializes. */ /** Modest CDN/browser cache — structure changes only on redeploy/HMR. */ declare const WELL_KNOWN_CACHE_CONTROL = "public, max-age=300"; declare const WELL_KNOWN_CONTENT_TYPE = "application/json"; type WellKnownHandlerConfig = { /** * Enumerated routes from the app's router. May be a static array or a * thunk (sync or async) so the tree can be re-read per request. */ routes: RouteEntry[] | (() => RouteEntry[] | Promise); /** Optional cavunoPage marker map keyed by sourcePath. */ markers?: ReadonlyMap; }; type WellKnownHandler = (request: Request) => Promise; /** * Create a framework-portable Request → Response handler that serves the * compiled ManifestV1 as JSON. Wire format is the versioned manifest only * (warnings/ambiguities stay build/doctor concerns). */ declare function createWellKnownHandler(config: WellKnownHandlerConfig): WellKnownHandler; /** * Deterministic JSON for ManifestV1. Roles are already inserted in * ALL_ROLES order by compileManifest — preserve that insertion order. */ declare function serializeManifest(manifest: { version: 1; roles: Partial>; }): string; /** * Build-plugin variant of the well-known manifest *. * * Pure function — no fs imports and no write callback: callers (vite * plugin, starter build hook) own the write of `contents` to `path` under * `public/`, including error handling — a swallowed async write in a build * step would be a silent broken artifact. */ declare const WELL_KNOWN_MANIFEST_PATH = ".well-known/cavuno.json"; type EmitWellKnownManifestConfig = { routes: RouteEntry[]; markers?: ReadonlyMap; }; type EmitWellKnownManifestResult = { path: string; contents: string; }; /** * Compile routes into a ManifestV1 document ready to land at * `public/.well-known/cavuno.json`. Returns path + contents. */ declare function emitWellKnownManifest(config: EmitWellKnownManifestConfig): EmitWellKnownManifestResult; /** * TanStack route-tree → RouteEntry[] enumerator. * * board-sdk has NO runtime (or type) dependency on @tanstack/react-router. * The public documented Route shape we walk is structural: * * { * id?: string; // e.g. '__root__', '/jobs/$slug' * path?: string; // relative segment, e.g. '$slug', 'jobs' * fullPath?: string; // absolute template, e.g. '/jobs/$slug' * children?: Array | Record of the same shape * } * * This matches the object exported by routeTree.gen.ts after * `_addFileChildren` / accepted by `createRouter({ routeTree })`. * Prefer `fullPath` when present; convert `$param` → `:param`, bare `$` * splat → `*`. Skip root + pathless/technical layout nodes (underscore * segments) while still walking their children. * * Research note (2026-07-22): TanStack `Route` exposes `id`, `path`, * `fullPath`, `children` on the instance (router-core Route interface). * `router.flatRoutes` / `routesById` require a live Router instance — * this helper deliberately walks the route *tree* so callers can pass * the generated routeTree without instantiating a router. */ /** * Minimal structural type for a TanStack route-tree node. * Compatible with the public Route shape; no @tanstack imports. */ type TanStackRouteNode = { id?: string; path?: string; fullPath?: string; children?: readonly TanStackRouteNode[] | Readonly>; }; /** * Walk a TanStack route tree into RouteEntry[] for the route-contract * compiler. Technical/pathless nodes are skipped; their descendants are * still visited. */ declare function routeEntriesFromTanStackRouteTree(routeTree: TanStackRouteNode): RouteEntry[]; /** * Convert a TanStack path template to URLPattern `:param` / `*` form. * `/jobs/$categorySlug` → `/jobs/:categorySlug` * `/files/$` → `/files/*` */ declare function tanStackPathToUrlPattern(path: string): string; export { type EmitWellKnownManifestConfig, type EmitWellKnownManifestResult, type TanStackRouteNode, WELL_KNOWN_CACHE_CONTROL, WELL_KNOWN_CONTENT_TYPE, WELL_KNOWN_MANIFEST_PATH, type WellKnownHandler, type WellKnownHandlerConfig, createWellKnownHandler, emitWellKnownManifest, routeEntriesFromTanStackRouteTree, serializeManifest, tanStackPathToUrlPattern };