import { n as FarmClientPlugin } from './lifecycle-De0vQG45.js'; import { Z as PluginRoutes, P as PluginRoutesFactory } from './route-CZkTBD-s.js'; import { FarmRenderer } from './renderer.js'; import { IncomingMessage, ServerResponse } from 'http'; import { d as FarmStorageUserConfig } from './types-Cc8l9IqS.js'; import { FarmSchema, FarmSchemaModel, FarmSchemaField, FarmSchemaFieldType, FarmSchemaReference, FarmSchemaConstraint, FarmSchemaModelExtension, FarmSchemaModelOverride, defineSchema } from './schema.js'; import React__default, { ComponentType, ReactNode } from 'react'; import { F as FarmIntegrationAPI, e as FarmIntegrationAPIMethod, c as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, h as FarmIntegrationRouteOperationCarrier, I as InferIntegrationAPIFromRoutes } from './integration-api-BbaiokCC.js'; import { OrmClient, SchemaDefinition, ModelDefinition, FieldBuilder, JsonValue, AnyModelDefinition, SchemaModels } from '@farming-labs/orm'; import { a as FarmDocsUserConfig, F as FarmDocsResolvedConfig } from './types-CKwggz9n.js'; import { FarmMarkdownUserConfig, FarmMarkdownResolvedConfig } from './markdown.js'; import { FarmObservabilityUserConfig } from './observability.js'; import * as vite from 'vite'; import { ViteDevServer, UserConfig, Plugin, Connect } from 'vite'; import { j as FarmWorkflowsUserConfig, a as FarmServerConfig, F as FarmWorkflowsResolvedConfig, R as ResolvedFarmServerConfig } from './workflows-BantWytQ.js'; import { FarmCronUserConfig, FarmCronResolvedConfig } from './cron.js'; import { ResolvedFarmEnv, FarmEnvConfig } from './env.js'; import { b as FarmRedirectStatus } from './navigation-errors-Dvwpzaer.js'; import { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from './server-action-security.js'; import * as esbuild from 'esbuild'; import { F as FarmImageConfig, R as ResolvedFarmImageConfig } from './image-config-Duob7wER.js'; import { k as FarmI18nUserConfig, R as ResolvedFarmI18nConfig } from './types-CnH8DOqo.js'; import { FarmCacheUserConfig } from './cache.js'; import { R as ResolvedFarmThemeConfig, d as FarmThemeConfig } from './types-DQnyD3VD.js'; import { FarmLayoutFonts } from './font.js'; import { _withAfterNodeMiddleware } from './after.js'; import { F as FarmIslandStrategy } from './island-CfGru1MO.js'; /** * Agent-readiness configuration: opt-in primitives that make a Farm site easier * for AI agents and crawlers to discover, resolve, and use. Off by default so * sites that do not want agent exposure (internal tools, private dashboards) are * unaffected. */ /** schema.org JSON-LD emitted in the document head to identify the site. */ interface FarmAgentJsonLd { /** * schema.org `@type`. Common values: `"Organization"` for a company or * project, `"SoftwareApplication"` for a product, `"WebSite"`, `"Person"`. * * @default "Organization" */ type?: string; /** Entity name. Defaults to the site's Open Graph site name or page title. */ name?: string; /** Canonical URL for the entity. Defaults to the configured `metadataBase`. */ url?: string; /** Short description. Defaults to the page/site metadata description. */ description?: string; /** Logo URL. */ logo?: string; /** URLs that also represent this entity (social profiles, repos) — schema.org `sameAs`. */ sameAs?: string[]; /** Additional schema.org properties merged into the emitted object. */ properties?: Record; } interface FarmAgentUserConfig { /** * Emit schema.org JSON-LD in the document head so agents and crawlers can * resolve the site's identity. `true` emits an `Organization` built from the * site's metadata; an object customizes the type and fields. * * @default false */ jsonLd?: boolean | FarmAgentJsonLd; } interface ResolvedFarmAgentConfig { jsonLd: FarmAgentJsonLd | false; } /** * Integration auth routes accept ordinary form posts, which browsers send * cross-site without a CORS preflight. Without an origin check, a third-party * page can submit credentials to an app's own sign-in route and plant an * attacker-controlled session in the victim's browser (login CSRF), or drive a * forced sign-out. This mirrors the server-action origin contract so both * entry points reject the same requests. */ type IntegrationOriginRejection = "missing-origin" | "opaque-origin" | "invalid-origin" | "cross-site"; type IntegrationOriginResult = { ok: true; } | { ok: false; reason: IntegrationOriginRejection; }; interface IntegrationOriginPolicy { /** Extra trusted origins, using the `serverActions.allowedOrigins` pattern syntax. */ allowedOrigins?: readonly string[]; /** * Whether a request carrying no origin metadata at all must be rejected. * * Form posts always carry an Origin header in supported browsers, so * state-changing POSTs default to rejecting (`true`). Top-level GET * navigations legitimately arrive with no Origin and no Referer — a typed * URL or a bookmark — so GET callers pass `false` to avoid breaking them. */ requireOriginMetadata?: boolean; } /** * Resolve configured origin patterns once, at integration construction, so an * invalid pattern fails loudly at startup instead of per request. */ declare function resolveIntegrationAllowedOrigins(values: readonly string[] | undefined, label: string): readonly string[]; declare function validateIntegrationRequestOrigin(request: Request, policy?: IntegrationOriginPolicy): IntegrationOriginResult; declare function describeIntegrationOriginRejection(reason: IntegrationOriginRejection): string; type RuntimeClientFactory = () => TClient | Promise; type FarmIntegrationOrmSchema = SchemaDefinition>; type FarmIntegrationOrmClient = OrmClient; type FarmIntegrationOrmFieldKind = TField["type"] extends "id" | "uuid" ? "id" : TField["type"] extends "text" ? "string" : TField["type"] extends "number" ? "decimal" : Extract; type FarmIntegrationOrmFieldNullable = TField extends { nullable: true; } ? true : TField extends { required: false; } ? true : false; type FarmIntegrationOrmEnumValue = TField extends { values: readonly (infer TValue extends string)[]; } ? TValue : string; type FarmIntegrationOrmFieldValue = TField["type"] extends "id" | "uuid" | "string" | "text" ? string : TField["type"] extends "boolean" ? boolean : TField["type"] extends "integer" ? number : TField["type"] extends "number" ? string : TField["type"] extends "datetime" ? Date : TField["type"] extends "json" ? JsonValue : TField["type"] extends "enum" ? FarmIntegrationOrmEnumValue : never; type InferFarmIntegrationOrmField = FieldBuilder, FarmIntegrationOrmFieldNullable, FarmIntegrationOrmFieldValue>; type InferFarmIntegrationOrmFields = { [TFieldKey in keyof TModel["fields"] & string]: InferFarmIntegrationOrmField>; }; type InferFarmIntegrationOrmSchema = SchemaDefinition<{ [TModelKey in keyof TSchema["models"] & string]: ModelDefinition>, {}>; }>; type InferFarmIntegrationOrmClient = TSchema extends FarmIntegrationSchema ? OrmClient> : never; interface CreateIntegrationOrmOptions { schema: TSchema; config?: Pick; storage?: FarmStorageUserConfig; client?: TClient | RuntimeClientFactory; } declare function createIntegrationOrm(options: CreateIntegrationOrmOptions): Promise>; declare function resolveIntegrationOrmRuntimeClient(options: Omit, "schema">): Promise; declare function farmIntegrationSchemaToOrmSchema(schema: FarmIntegrationSchema): Promise; type IntegrationOrmModelNames = keyof SchemaModels & string; interface ResolvedClientCacheAdapterEntry { /** Absolute adapter module path with forward slashes, ready for codegen. */ importPath: string; options: { version?: string; flushDelayMs?: number; }; } interface ClientCachePersistenceEntryCode { imports: string; init: string; } /** * Resolve `cache.client.adapter` from configuration to an absolute module * path for the generated client entries. Fails the build with an actionable * error when the option is set but the module cannot be found. */ declare function resolveFarmClientCacheAdapterEntry(root: string, cache: FarmCacheUserConfig | undefined): ResolvedClientCacheAdapterEntry | undefined; /** * Code fragments for the generated client entries: an import of the user's * adapter module and an init call that runs before hydration starts. Empty * strings when persistence is not configured, so entries stay unchanged. */ declare function generateClientCachePersistenceCode(entry: ResolvedClientCacheAdapterEntry | undefined): ClientCachePersistenceEntryCode; /** * Farm.js Middleware System * * Type definitions for the middleware system */ /** * Next function type for middleware chain */ type MiddlewareResult = void | Response; type NextFunction = () => Promise; type MiddlewareStoreKey> = Extract; /** * A typed view over the request-scoped maps used by middleware. */ interface ReadonlyMiddlewareStore = Record> { readonly size: number; get>(key: TKey): TValues[TKey] | undefined; has>(key: TKey): boolean; entries(): IterableIterator<[MiddlewareStoreKey, TValues[MiddlewareStoreKey]]>; keys(): IterableIterator>; values(): IterableIterator]>; forEach(callback: (value: TValues[MiddlewareStoreKey], key: MiddlewareStoreKey, store: ReadonlyMiddlewareStore) => void, thisArg?: any): void; [Symbol.iterator](): IterableIterator<[ MiddlewareStoreKey, TValues[MiddlewareStoreKey] ]>; } interface MiddlewareStore = Record> extends ReadonlyMiddlewareStore { clear(): void; delete>(key: TKey): boolean; set>(key: TKey, value: TValues[TKey]): this; } /** * Middleware function signature */ type MiddlewareFunction = (ctx: MiddlewareContext, next: NextFunction) => MiddlewareResult | Promise; /** * Context passed to a named, request-first middleware export. * `locals` and the get/set helpers stay on the server. `data` can be exposed * through page props and should contain only serializable, client-safe values. */ interface RequestMiddlewareContext = Record, TData extends Record = Record> { readonly url: URL; readonly pathname: string; readonly searchParams: URLSearchParams; readonly method: string; readonly params: Record; readonly route: string; readonly locals: MiddlewareStore; readonly data: MiddlewareStore; readonly headers: Map; readonly cookies: CookieJar; get>(key: TKey): TLocals[TKey] | undefined; has>(key: TKey): boolean; set>(key: TKey, value: TLocals[TKey]): void; delete>(key: TKey): boolean; redirect(url: string, status?: number): void; rewrite(url: string): void; json(data: any, status?: number): void; text(content: string, status?: number): void; html(content: string, status?: number): void; } type RequestMiddleware = Record, TData extends Record = Record> = (request: Request, context: RequestMiddlewareContext) => MiddlewareResult | Promise; /** * Cookie options */ interface CookieOptions { maxAge?: number; expires?: Date; path?: string; domain?: string; secure?: boolean; httpOnly?: boolean; sameSite?: "strict" | "lax" | "none"; } /** * Cookie management interface */ interface CookieJar { get(name: string): string | undefined; set(name: string, value: string, options?: CookieOptions): void; /** * Remove a cookie. Pass the `path`/`domain` it was set with; a tombstone only * matches a cookie with the same scope. */ delete(name: string, options?: CookieOptions): void; getAll(): Record; } interface RateLimitIncrementResult { count: number; /** Unix epoch timestamp in milliseconds when the fixed window resets. */ resetAt: number; } interface RateLimitStorage { /** Atomically increment a key and create or retain its fixed expiry window. */ increment(key: string, windowMs: number): Promise | RateLimitIncrementResult; /** Optional inspection support used by getRateLimitStatus(). */ get?(key: string): Promise | RateLimitIncrementResult | null; } interface MemoryRateLimitStorageOptions { /** Maximum number of active keys retained by this process. */ maxEntries?: number; } interface RateLimitConfig { requests: number; window: string; keyGenerator?: (ctx: MiddlewareContext) => string; onLimit?: (ctx: MiddlewareContext) => void | Response | Promise; storage?: RateLimitStorage; } interface RateLimitStatus { requests: number; limit: number; remaining: number; resetIn: number | null; resetAt: Date | null; isLimited: boolean; } /** * Middleware configuration */ type MiddlewareMatcher = string | RegExp | ((ctx: MiddlewareContext) => boolean); interface MiddlewareConfig$1 { matcher?: MiddlewareMatcher | MiddlewareMatcher[]; exclude?: (string | RegExp)[]; runtime?: "nodejs" | "edge"; } interface MiddlewareConfigEntry extends MiddlewareConfig$1 { handler?: MiddlewareFunction; handlers?: MiddlewareFunction[]; } type FarmMiddlewareConfig = MiddlewareConfig$1 | MiddlewareConfigEntry | MiddlewareConfigEntry[]; /** * Middleware context - the main object passed to middleware functions */ interface MiddlewareContext { request: IncomingMessage; response: ServerResponse; url: URL; pathname: string; searchParams: URLSearchParams; method: string; params: Record; route: string; parent?: { data: Map; locals?: Map; headers: Record; }; vite: { isDev: boolean; hmr: boolean; server?: ViteDevServer; }; data: Map; locals: Map; headers: Map; cookies: CookieJar; _handled: boolean; _redirectUrl?: string; _rewriteUrl?: string; redirect(url: string, status?: number): void; rewrite(url: string): void; json(data: any, status?: number): void; text(content: string, status?: number): void; html(content: string, status?: number): void; } /** * Middleware chain interface */ interface MiddlewareChain { use(fn: MiddlewareFunction): MiddlewareChain; /** * Conditionally run middleware based on a condition. * Supports boolean values or functions that evaluate to boolean. * * @example * .when(true, (ctx, next) => { ... }) // Always run * .when((ctx) => ctx.data.get('flag'), (ctx, next) => { ... }) // Conditional */ when(condition: boolean | ((ctx: MiddlewareContext) => boolean), fn: MiddlewareFunction | ((chain: MiddlewareChain) => void)): MiddlewareChain; rateLimit(config: RateLimitConfig): MiddlewareChain; redirect(source: string, destination: string, permanent?: boolean): MiddlewareChain; /** * Rewrite the current route to a new destination. * In route-specific middleware, this rewrites the middleware's route. * * @param destination - The destination path to rewrite to * @param condition - Optional boolean or function that evaluates to boolean. If false, rewrite is skipped. * * @example * // In /contact/middleware.ts * .rewrite('/about') // Always rewrites /contact to /about * .rewrite('/about', true) // Always rewrites * .rewrite('/about', false) // Never rewrites * .rewrite('/about', (ctx) => ctx.data.get('shouldRewrite')) // Conditional rewrite */ rewrite(destination: string, condition?: boolean | ((ctx: MiddlewareContext) => boolean)): MiddlewareChain; build(): { handlers: MiddlewareFunction[]; config?: MiddlewareConfig$1; }; } /** * Middleware module export */ interface MiddlewareModule { default?: MiddlewareChain | MiddlewareFunction; middleware?: RequestMiddleware; config?: MiddlewareConfig$1; } type FarmMdxComponent = React__default.ComponentType | keyof React__default.JSX.IntrinsicElements; type FarmMdxComponents = Record; interface FarmMdxUserConfig { /** * Component map or module path that exports `components` or a default component map. * Relative paths resolve from the project root. */ components?: string | FarmMdxComponents; /** * Serve source-authored markdown pages at `/route.md`. * Enabled by default for `page.md` and `page.mdx`. */ markdownRoutes?: boolean; /** Class name used for the wrapper around rendered markdown content. */ className?: string; } interface FarmMdxResolvedConfig { components?: string | FarmMdxComponents; markdownRoutes: boolean; className: string; } declare function resolveMdxConfig(config: FarmMdxUserConfig | undefined): FarmMdxResolvedConfig; type FarmRouteRuntime = "auto" | "node" | "edge"; type FarmRouteRegions = "auto" | readonly string[]; type FarmRouteMaxDuration = "auto" | number; /** Portable execution controls shared by file, programmatic, and config routes. */ interface FarmRouteRuntimeConfig { runtime?: FarmRouteRuntime; regions?: FarmRouteRegions; maxDuration?: FarmRouteMaxDuration; } interface ResolvedFarmRouteRuntimeConfig { runtime: FarmRouteRuntime; regions?: string[]; maxDuration?: number; } type FarmRouteRuntimeEntryKind = "page" | "api" | "metadata" | "rule"; type FarmRouteRenderingMode = "static" | "dynamic"; interface FarmRouteRuntimeManifestEntry extends ResolvedFarmRouteRuntimeConfig { kind: FarmRouteRuntimeEntryKind; pattern: string; rendering: FarmRouteRenderingMode; source?: string; } interface FarmRouteRuntimeManifest { version: 1; routes: FarmRouteRuntimeManifestEntry[]; } declare function normalizeFarmRouteRuntimeConfig(value: FarmRouteRuntimeConfig | null | undefined, source?: string): FarmRouteRuntimeConfig; /** Merge from lowest to highest precedence. Explicit "auto" values reset inherited hints. */ declare function mergeFarmRouteRuntimeConfigs(...configs: Array): FarmRouteRuntimeConfig; declare function resolveFarmRouteRuntimeConfig(config: FarmRouteRuntimeConfig | null | undefined, source?: string): ResolvedFarmRouteRuntimeConfig; declare function hasFarmRouteRuntimeControls(config: FarmRouteRuntimeConfig | null | undefined): boolean; declare function getFarmRouteRuntimeConfig(value: unknown): FarmRouteRuntimeConfig; declare function createFarmRouteRuntimeKey(config: ResolvedFarmRouteRuntimeConfig): string; /** Resolve matching route rules from broadest to most specific. */ declare function resolveFarmRouteRuleRuntimeConfig(pathname: string, routeRules: Record | null | undefined): FarmRouteRuntimeConfig; declare function farmRouteRuleMatches(pattern: string, pathname: string): boolean; type FarmRouteRuleRenderMode = "static" | "dynamic"; type FarmRouteRuleRedirect = string | { to: string; statusCode?: FarmRedirectStatus; permanent?: boolean; }; type FarmRouteRuleCors = boolean | { origin?: string; methods?: string | readonly string[]; headers?: string | readonly string[]; }; interface FarmRouteRule extends FarmRouteRuntimeConfig { prerender?: boolean; render?: FarmRouteRuleRenderMode; ssr?: boolean; swr?: boolean | number; isr?: boolean | number; cors?: FarmRouteRuleCors; headers?: Record; redirect?: FarmRouteRuleRedirect; } type FarmRouteRules = Record; declare function normalizeRouteRules(routeRules: FarmRouteRules | undefined): FarmRouteRules; declare function routeRulesToRedirects(routeRules: FarmRouteRules): RedirectConfig[]; declare function routeRulesToHeaders(routeRules: FarmRouteRules): HeaderConfig[]; declare function routeRulesToNitroRouteRules(routeRules: FarmRouteRules): Record; type EsbuildTransform = (typeof esbuild)["transform"]; type FarmLayerEntry = string; interface ResolvedFarmLayer { /** The value used in `extends`. */ source: string; /** Stable name used by the `#layers/` alias. */ name: string; /** Absolute layer package or directory root. */ root: string; /** Source directory relative to the layer root. */ srcDir: string; /** Resolved layer config file when one exists. */ configFile?: string; } interface FarmSourceRoot { name: string; root: string; srcDir: string; layer: boolean; } interface ResolveFarmLayersOptions { root: string; mode: "development" | "production"; } interface FarmLayerResolution> { config: TConfig & { extends?: readonly FarmLayerEntry[]; layers: ResolvedFarmLayer[]; }; layers: ResolvedFarmLayer[]; } declare function resolveFarmLayers>(projectConfig: TConfig, options: ResolveFarmLayersOptions): Promise>; declare function getFarmSourceRoots(config: { root?: string; srcDir?: string; layers?: readonly ResolvedFarmLayer[]; }): FarmSourceRoot[]; declare function getFarmAppDirectories(config: { root?: string; srcDir?: string; layers?: readonly ResolvedFarmLayer[]; }): string[]; declare function getFarmLayerAliases(layers: readonly ResolvedFarmLayer[] | undefined): Record; declare function createFarmConfigResolutionPlugin(options: { transform: EsbuildTransform; }): esbuild.Plugin; declare function loadFarmConfigFile>(configPath: string, options: { root: string; cacheRoot?: string; }): Promise; declare const DEFAULT_FARM_DEVTOOLS_SHORTCUT = "mod+shift+."; declare const FARM_DEVTOOLS_PATH = "/__farm/devtools"; declare const FARM_DEVTOOLS_LAUNCH_PARAM = "__farm_devtools"; /** * Configuration for the built-in DevTools dashboard. The dashboard is deprecated in favor * of the `@farm.js/devtools` plugin, which reuses this configuration for enablement and * the keyboard shortcut. Both options keep working while the built-in UI remains available. */ interface FarmDevtoolsConfig { /** Enable the development-only DevTools UI and runtime endpoints. */ enabled?: boolean; /** Keyboard shortcut used to toggle DevTools, or false to disable the shortcut. */ shortcut?: string | false; } type FarmDevtoolsUserConfig = boolean | FarmDevtoolsConfig; interface ResolvedFarmDevtoolsConfig { enabled: boolean; shortcut: string | false; } declare function resolveFarmDevtoolsConfig(config: FarmDevtoolsUserConfig | ResolvedFarmDevtoolsConfig | undefined, mode?: "development" | "production"): ResolvedFarmDevtoolsConfig; type FarmBuildActivityPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left"; interface FarmDevIndicatorsConfig { /** Show build and HMR activity in the browser during development. */ buildActivity?: boolean; /** Corner used by the build activity indicator. */ buildActivityPosition?: FarmBuildActivityPosition; } interface ResolvedFarmDevIndicatorsConfig { buildActivity: boolean; buildActivityPosition: FarmBuildActivityPosition; } declare function resolveFarmDevIndicatorsConfig(config: FarmDevIndicatorsConfig | undefined, mode?: "development" | "production"): ResolvedFarmDevIndicatorsConfig; declare function generateFarmDevIndicatorsClientRuntime(config: ResolvedFarmDevIndicatorsConfig): string; interface FarmAuthEmailAndPasswordConfig { /** Require a verified email before creating a session. @default false */ requireEmailVerification?: boolean; /** Smallest accepted password length. @default 8 */ minPasswordLength?: number; /** Largest accepted password length. @default 128 */ maxPasswordLength?: number; } interface FarmAuthSessionConfig { /** Session lifetime in seconds. @default 604800 */ expiresIn?: number; /** Session refresh interval in seconds. @default 86400 */ updateAge?: number; } interface FarmAuthDatabaseConfig { /** * Postgres connection string. Defaults to DATABASE_URL. * Local development falls back to SQLite when no URL is present. */ url?: string; /** Local SQLite path. @default ".farm/auth.sqlite" */ path?: string; /** Automatically update the auth schema in development. @default true */ migrateInDevelopment?: boolean; } interface FarmAuthConfig { /** Set false to disable auth without removing its configuration. @default true */ enabled?: boolean; /** Display name used by authentication emails and metadata. */ appName?: string; /** Route prefix for the auth endpoints. @default "/api/auth" */ basePath?: string; /** * Email/password authentication. It is enabled by default; set false to * disable it when adding another sign-in method. */ emailAndPassword?: boolean | FarmAuthEmailAndPasswordConfig; session?: FarmAuthSessionConfig; database?: FarmAuthDatabaseConfig; } type FarmAuthUserConfig = boolean | FarmAuthConfig; interface ResolvedFarmAuthConfig { enabled: boolean; appName?: string; basePath: string; emailAndPassword: { enabled: boolean; requireEmailVerification: boolean; minPasswordLength: number; maxPasswordLength: number; }; session: { expiresIn: number; updateAge: number; }; database: { url?: string; path: string; migrateInDevelopment: boolean; }; } type FarmPreloadMode = "warn" | "enforce"; interface FarmPreloadUserConfig { /** Report excess hints or remove the lower-priority hints. @default "enforce" */ mode?: FarmPreloadMode; /** Maximum image preload hints per document. @default 1 */ maxImages?: number; /** Maximum font preload hints per document. @default 2 */ maxFonts?: number; } interface ResolvedFarmPreloadConfig { mode: FarmPreloadMode; maxImages: number; maxFonts: number; } interface FarmPerformanceConfig { preload?: FarmPreloadUserConfig; } interface ResolvedFarmPerformanceConfig { preload: ResolvedFarmPreloadConfig; } type FarmPreloadKind = "image" | "font"; interface FarmPreloadBudgetWarning { kind: FarmPreloadKind; count: number; budget: number; removed: number; } interface FarmManagedPreloads { value: string; warnings: FarmPreloadBudgetWarning[]; } interface FarmManagedDocumentPreloads { html: string; linkHeader: string; warnings: FarmPreloadBudgetWarning[]; } /** * Apply image and font budgets to HTML preload elements. High-priority image * hints are retained before ordinary hints, making an explicitly preloaded LCP * image the winner when a document contains too many React-generated hints. */ declare function manageFarmHtmlPreloads(html: string, config: ResolvedFarmPreloadConfig): FarmManagedPreloads; /** Apply the same budgets to HTTP Link preload hints, including Farm fonts. */ declare function manageFarmLinkHeaderPreloads(value: string, config: ResolvedFarmPreloadConfig): FarmManagedPreloads; /** Apply a single document budget across HTML and HTTP Link header hints. */ declare function manageFarmDocumentPreloads(html: string, linkHeader: string, config: ResolvedFarmPreloadConfig): FarmManagedDocumentPreloads; /** Rate-limit identical route-and-budget warnings within a server process. */ declare function reportFarmPreloadWarnings(warnings: FarmPreloadBudgetWarning[], context?: string): void; type FarmCspDirectiveValue = string | readonly string[] | boolean | null | undefined; type FarmCspDirectives = Readonly>; interface FarmCspOptions { /** A pre-serialized CSP value. Cannot be combined with directives. */ policy?: string; /** CSP directives using camelCase or kebab-case names. */ directives?: FarmCspDirectives; /** Emit Content-Security-Policy-Report-Only instead of enforcing the policy. */ reportOnly?: boolean; } type FarmCspConfig = string | FarmCspOptions; interface FarmSecurityConfig { /** App-wide Content Security Policy applied to pages, APIs, and static output. */ csp?: FarmCspConfig | false; /** @deprecated Use csp. */ contentSecurityPolicy?: never; } interface ResolvedFarmCspConfig { value: string; reportOnly: boolean; } interface ResolvedFarmSecurityConfig { csp: ResolvedFarmCspConfig | false; } declare const DEFAULT_FARM_API_BASE_PATH = "/api"; interface FarmAPIConfigResolverContext { root: string; mode: "development" | "production"; env: ResolvedFarmEnv; } type FarmAPIConfigValue = string | undefined | ((context: FarmAPIConfigResolverContext) => string | undefined | Promise); interface FarmAPIConfig { /** * Public API root. An origin-only URL is joined with `basePath`; a URL that * already has a path is used as-is. May be resolved from deployment context. */ baseURL?: FarmAPIConfigValue; /** Public API path and same-origin server mount used when `baseURL` has no path. @default "/api" */ basePath?: FarmAPIConfigValue; } interface ResolvedFarmAPIConfig { /** Fully resolved public API root, either absolute or root-relative. */ baseURL: string; /** Effective pathname of `baseURL`. */ basePath: string; } declare function resolveFarmAPIConfig(config: FarmAPIConfig | undefined, context: FarmAPIConfigResolverContext): Promise; /** Normalize already-resolved API strings. */ declare function normalizeFarmAPIConfig(config: { baseURL?: string; basePath?: string; } | undefined): ResolvedFarmAPIConfig; declare function normalizeFarmAPIBasePath(value: string): string; /** Read the API root embedded by Farm's Vite build. */ declare function getFarmAPIBaseURL(): string; /** Resolve a canonical Farm route such as `/api/users` against an API root. */ declare function resolveFarmAPIRequestURL(routePath: string, baseURL?: string, fallbackOrigin?: string): URL; declare const FARM_RESOLVED_CUSTOM_CONTEXT: unique symbol; interface RedirectConfig { source: string; destination: string; permanent?: boolean; statusCode?: FarmRedirectStatus; } interface HeaderConfig { source: string; headers: Array<{ key: string; value: string; }>; } interface RewriteConfig { source: string; destination: string; } /** @deprecated Use FarmImageConfig. */ type ImageConfig = FarmImageConfig; /** @deprecated Use FarmI18nUserConfig. */ type I18nConfig = FarmI18nUserConfig; interface OpenAPIConfig { enabled?: boolean; route?: string; /** * Path where the raw OpenAPI spec is served as JSON, so agents and API tools * can fetch it at a predictable URL. Set to `false` to disable. * * @default "/openapi.json" */ specRoute?: string | false; title?: string; description?: string; version?: string; servers?: Array<{ url: string; description?: string; }>; contact?: { name?: string; email?: string; url?: string; }; license?: { name: string; url?: string; }; } type MiddlewareConfig = FarmMiddlewareConfig; interface NotFoundConfig { /** Path to a custom 404 page component (e.g., "./src/app/not-found.tsx") */ component?: string; } type FarmDeployTarget = "vercel" | "cloudflare" | "netlify" | "node" | string; interface FarmDeployConfig { /** * Deployment platform. When present, Farm picks the matching Nitro preset and * output directory unless explicitly overridden. */ target?: FarmDeployTarget; /** Nitro preset override. Usually inferred from target. */ preset?: FarmConfig["preset"]; /** Deployable output directory, relative to project root unless absolute. */ outputDir?: string; /** Alias for outputDir for terser config. */ output?: string; /** Cloudflare Pages project name used by `farm deploy --cloudflare`. */ projectName?: string; vercel?: { outputDirectory?: string; buildCommand?: string; installCommand?: string; framework?: string | null; }; cloudflare?: { outputDir?: string; projectName?: string; }; netlify?: { outputDir?: string; site?: string; }; } interface ResolvedFarmDeployConfig extends Omit { target?: FarmDeployTarget; preset: FarmConfig["preset"]; outputDir: string; } interface FarmUserConfig extends Omit { /** Reusable Farm directories or installed packages, applied from left to right. */ extends?: readonly FarmLayerEntry[]; /** Global plugins. Integration-bound plugins must be contributed through an integration. */ plugins?: FarmPlugin[]; integrations?: FarmIntegrationsUserConfig; /** * Farm-native authentication. `true` enables email/password auth with * server helpers from `@farm.js/auth/server` and React APIs from * `@farm.js/auth/client`. */ auth?: FarmAuthUserConfig; /** Shared application data, route, ISR, and PPR cache. */ cache?: FarmCacheUserConfig; migrations?: FarmMigrationsUserConfig; /** Map portable cron schedules to ordinary GET API routes. */ cron?: FarmCronUserConfig | FarmCronResolvedConfig | false; workflows?: FarmWorkflowsUserConfig | boolean; preset?: FarmConfig["preset"]; deploy?: FarmDeployConfig; docs?: FarmDocsUserConfig; md?: FarmMarkdownUserConfig | boolean; mdx?: FarmMdxUserConfig; observability?: FarmObservabilityUserConfig; trailingSlash?: boolean; redirects?: () => Promise | RedirectConfig[]; rewrites?: () => Promise | RewriteConfig[]; headers?: () => Promise | HeaderConfig[]; images?: ImageConfig; publicDir?: string; i18n?: FarmI18nUserConfig | false; openapi?: OpenAPIConfig; middleware?: FarmMiddlewareConfig; routeRules?: FarmRouteRules; context?: FarmConfig["context"]; /** Server ingress and trusted-proxy policy. */ server?: FarmServerConfig; serverActions?: FarmServerActionsConfig; /** Build identifier used to detect and recover from deployment version skew. */ deploymentId?: string; notFound?: NotFoundConfig; distDir?: string; generateBuildId?: () => string | Promise; compress?: boolean; devIndicators?: FarmDevIndicatorsConfig; serverRuntimeConfig?: Record; publicRuntimeConfig?: Record; env?: FarmEnvConfig; vite?: UserConfig | ((config: UserConfig) => UserConfig); [key: string]: any; } interface ResolvedFarmConfig extends Required> { agent: ResolvedFarmAgentConfig; /** @internal Tracks whether `context` came from user/layer config instead of the default noop. */ [FARM_RESOLVED_CUSTOM_CONTEXT]?: boolean; root: string; extends: readonly FarmLayerEntry[]; layers: ResolvedFarmLayer[]; plugins: FarmPlugin[]; vite: UserConfig; deploy: ResolvedFarmDeployConfig; docs: FarmDocsResolvedConfig; md: FarmMarkdownResolvedConfig; mdx: FarmMdxResolvedConfig; migrations: ResolvedFarmMigrationsConfig; cron: FarmCronResolvedConfig; workflows: FarmWorkflowsResolvedConfig; api: ResolvedFarmAPIConfig; env: ResolvedFarmEnv; server: ResolvedFarmServerConfig; serverActions: ResolvedFarmServerActionsConfig; devtools: ResolvedFarmDevtoolsConfig; devIndicators: ResolvedFarmDevIndicatorsConfig; images: ResolvedFarmImageConfig; i18n: ResolvedFarmI18nConfig; auth: ResolvedFarmAuthConfig; performance: ResolvedFarmPerformanceConfig; security: ResolvedFarmSecurityConfig; theme: ResolvedFarmThemeConfig; renderer: FarmRenderer; routeRules: FarmRouteRules; notFound: NotFoundConfig; } type FarmLayerConfig = Omit; declare function normalizeDeployTarget(target?: FarmDeployTarget): FarmDeployTarget | undefined; declare function getPresetForDeployTarget(target?: FarmDeployTarget): FarmConfig["preset"] | undefined; declare function getDeployTargetForPreset(preset?: string): FarmDeployTarget | undefined; declare function resolveDeployOutputPath(root: string, outputDir: string): string; declare function resolveDeployConfig(config: Pick, overrides?: { target?: FarmDeployTarget; preset?: FarmConfig["preset"]; outputDir?: string; /** Build environment consulted for platform detection. Tests inject this. */ env?: NodeJS.ProcessEnv; }): ResolvedFarmDeployConfig; declare function resolveMigrationsConfig(migrations: FarmMigrationsUserConfig | undefined): ResolvedFarmMigrationsConfig; declare function resolveConfig(userConfig: FarmUserConfig, mode: "development" | "production"): Promise; declare function loadConfig(rootDir?: string, configPath?: string, mode?: string, loadEnvironment?: (typeof vite)["loadEnv"]): Promise; /** Browser-safe bridge: neither handlers nor Node.js imports cross this boundary. */ interface APIRequestRuntime { basePath: string; dispatch(request: Request): Promise; } interface FarmVitePluginOptions extends FarmConfig { openapi?: FarmUserConfig["openapi"]; images?: FarmUserConfig["images"]; publicDir?: FarmUserConfig["publicDir"]; /** @internal Modules selected by the compiled isolated-hydration ownership plan. */ isolatedClientBoundaryModules?: ReadonlySet; } declare function farmI18nClientBridgePlugin(): Plugin; /** Exported for tests: the request boundary all Farm dev middlewares share. */ declare function withFarmRequestTracing(handler: Parameters[0], apiRuntime?: APIRequestRuntime, resolveTraceUrl?: (request: Connect.IncomingMessage) => URL): Connect.NextHandleFunction; interface FarmModuleAstNode { type: string; start: number; end: number; [key: string]: unknown; } declare function rewriteEarlySsrRelativeImports(options: { code: string; id: string; root: string; parse: (code: string) => FarmModuleAstNode; }): string | null; declare function transformIsolatedClientBoundaryModule(options: { code: string; moduleReference: string; islandStrategy: FarmIslandStrategy; parse: (code: string) => FarmModuleAstNode; }): string | null; /** * Whether Farm should append its own client-root HMR handler to a * `"use client"` module. * * Re-rendering the whole root on every edit only makes sense for a renderer * that diffs the result against the live DOM. On Solid and Svelte `render()` * tears the tree down and rebuilds it, so a one character change in any client * component would wipe the page's state. Those renderers ship their own HMR * integration (solid-refresh, svelte's hot API) which preserves component * state, and appending an `import.meta.hot.accept` here would swallow the * update before theirs could run. */ declare function shouldEmitFarmClientRootHmr(renderer?: FarmRenderer): boolean; declare function farmPlugin(options?: FarmVitePluginOptions, initialPluginManager?: PluginManager): Plugin; declare function defineConfig(config?: FarmVitePluginOptions): Promise; type MaybePromise$1 = T | Promise; /** @internal Marks a Node response whose intercepted end is awaiting response hooks. */ declare const FARM_NODE_RESPONSE_END_PENDING: unique symbol; declare const FARM_PLUGIN_INTEGRATION_INSTANCE: unique symbol; declare const FARM_PLUGIN_INTEGRATION_BOUND: unique symbol; interface FarmPluginIntegrationContext { /** Key used to register the integration in farm.config.ts. */ readonly key: string; readonly category: string; readonly type: string; readonly instance: TInstance; readonly serverRuntime: boolean; } declare class FarmRuntimeShutdownError extends Error { readonly errors: readonly unknown[]; constructor(message: string, errors: readonly unknown[]); } interface PluginRequestContext { set: (target: FarmRequest | Request, key: string, value: any, options?: { exposeToPage?: boolean; }) => void; get: (target: FarmRequest | Request, key: string) => T | undefined; has: (target: FarmRequest | Request, key: string) => boolean; delete: (target: FarmRequest | Request, key: string) => boolean; clear: (target: FarmRequest | Request) => void; getAll: (target: FarmRequest | Request, options?: { exposedOnly?: boolean; }) => Map; } interface FarmRequestStore { set(key: string, value: unknown, options?: { exposeToPage?: boolean; }): void; get(key: string): T | undefined; has(key: string): boolean; delete(key: string): boolean; clear(): void; snapshot(options?: { exposedOnly?: boolean; }): Map; } interface FarmPluginContext { config: FarmConfig; viteServer?: ViteDevServer; isDev: boolean; isProd: boolean; /** The owning integration when this plugin is contributed through `integration.plugins`. */ readonly integration?: Readonly>; /** Register resource cleanup that must run when the application runtime closes. */ lifecycle: FarmPluginLifecycle; /** @deprecated Use `ctx.req` inside request hooks. */ requestContext: PluginRequestContext; } type FarmPluginHookContext = TIntegrationBound extends true ? Omit & { /** The owning integration bound by `definePlugin.forIntegration()`. */ readonly integration: Readonly>; } : TContext; interface FarmPluginLifecycle { /** * Register a database, storage, queue, or other resource disposer. * Disposers run once in reverse registration order after plugin shutdown hooks. */ onShutdown(dispose: () => void | Promise): () => void; } interface FarmRequestPluginContext extends FarmPluginContext { /** Request-scoped values for the current hook invocation. */ readonly req: FarmRequestStore; } interface RouteDiscoveredPayload { kind: "page" | "layout"; pattern: string; modulePath: string; } interface RoutesGeneratedPayload { routes: RouteDiscoveredPayload[]; pageCount: number; layoutCount: number; } interface MiddlewareDiscoveredPayload { path: string; filePath: string; handlerCount: number; } interface APIRouteDiscoveredPayload { path: string; filePath: string; methods: string[]; } interface RouteMatchPayload { pathname: string; method?: string; } interface RouteMatchResultPayload { pathname: string; matched: boolean; routePattern: string | null; params: Record; layoutPatterns: string[]; } interface RenderLifecyclePayload { pathname: string; method: string; routePattern: string | null; params: Record; } interface APIHandlerLifecyclePayload { pathname: string; method: string; routePath?: string; } interface ErrorLifecyclePayload { phase: string; error: unknown; meta?: Record; } interface HMRUpdatePayload { file: string; modules: string[]; } interface BundleLifecyclePayload { root: string; preset: string; universal: boolean; distDir: string; outputDir?: string; } interface BundleResultPayload extends BundleLifecyclePayload { success: boolean; } interface NitroBuildLifecyclePayload { root: string; preset: string; distDir: string; outputDir: string; } interface ShutdownPayload { reason: string; } type FarmPluginRuntimeKind = "request" | "page" | "api" | "action" | "integration" | "docs" | "asset" | (string & {}); interface FarmPluginRouteRuntimePayload { pathname: string; pattern?: string | null; params?: Record; } interface FarmPluginSetupContext extends FarmPluginContext { env: ResolvedFarmEnv; } interface FarmPluginStateContext extends FarmPluginContext { state: TState; } interface FarmPluginRuntimeBaseEvent extends FarmPluginStateContext { request: Request; /** Request-scoped values shared by plugin hooks. */ req: FarmRequestStore; kind: FarmPluginRuntimeKind; route?: FarmPluginRouteRuntimePayload; signal: AbortSignal; waitUntil(promise: Promise): void; } type FarmPluginRuntimeContextEvent = FarmPluginRuntimeBaseEvent; interface FarmPluginRuntimeBeforeEvent, TIntegrationInstance = unknown> extends FarmPluginRuntimeBaseEvent { ctx: Readonly; } interface FarmPluginRuntimeAfterEvent, TIntegrationInstance = unknown> extends FarmPluginRuntimeBeforeEvent { response: Response; durationMs: number; } interface FarmPluginRuntimeErrorEvent, TIntegrationInstance = unknown> extends FarmPluginRuntimeBeforeEvent { error: unknown; durationMs: number; } type FarmPluginRuntimeStartEvent = FarmPluginStateContext; interface FarmPluginRuntimeCloseEvent extends FarmPluginStateContext, ShutdownPayload { } type FarmPluginContextFor = FarmPluginHookContext, TIntegrationInstance, TIntegrationBound>; type FarmRequestPluginContextFor = FarmPluginHookContext, TIntegrationInstance, TIntegrationBound>; type FarmPluginSetupContextFor = FarmPluginHookContext, TIntegrationInstance, TIntegrationBound>; type FarmPluginStateContextFor = FarmPluginHookContext, TIntegrationInstance, TIntegrationBound>; type FarmPluginRuntimeEventFor = FarmPluginHookContext; interface FarmPluginRuntimeHooks, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false> { start?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; context?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; before?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; after?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; error?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; close?(event: FarmPluginRuntimeEventFor, TIntegrationInstance, TIntegrationBound>): MaybePromise$1; } interface FarmPluginRuntimeRequestOptions { kind?: FarmPluginRuntimeKind; route?: FarmPluginRouteRuntimePayload; waitUntil?: (promise: Promise) => void; } type FarmPluginRuntimeRequestHandler = (request: Request) => MaybePromise$1; interface FarmPluginRuntimeSession { request: Request; response?: Response; ctx: Readonly>; startedAt: number; options: FarmPluginRuntimeRequestOptions; waitUntil(promise: Promise): void; } type FarmPluginDiscoveredRoute = RouteDiscoveredPayload | ({ kind: "middleware"; } & MiddlewareDiscoveredPayload) | ({ kind: "api"; } & APIRouteDiscoveredPayload); interface FarmPluginRouterHooks { discovered?(route: FarmPluginDiscoveredRoute, context: FarmPluginStateContextFor): MaybePromise$1; generated?(routes: RoutesGeneratedPayload, context: FarmPluginStateContextFor): MaybePromise$1; before?(route: RouteMatchPayload, context: FarmPluginStateContextFor): MaybePromise$1; after?(result: RouteMatchResultPayload, context: FarmPluginStateContextFor): MaybePromise$1; } interface FarmPluginRenderHooks { before?(render: RenderLifecyclePayload, context: FarmPluginStateContextFor): MaybePromise$1; html?(html: string, render: RenderLifecyclePayload, context: FarmPluginStateContextFor): MaybePromise$1; } interface FarmPluginBuildHooks { before?(bundle: BundleLifecyclePayload, context: FarmPluginStateContextFor): MaybePromise$1; configure?(buildConfig: any, context: FarmPluginStateContextFor): MaybePromise$1; after?(result: BundleResultPayload, context: FarmPluginStateContextFor): MaybePromise$1; } interface FarmPluginDevHooks { server?(viteServer: ViteDevServer, context: FarmPluginStateContextFor): MaybePromise$1; update?(update: HMRUpdatePayload, context: FarmPluginStateContextFor): MaybePromise$1; } interface FarmPluginClientConfig extends FarmClientPlugin { /** Explicitly public, JSON-safe data embedded in the browser bundle. */ public?: TPublic; } interface FarmPlugin, TClientState = any, TClientPublic = any, TIntegrationInstance = unknown, TIntegrationBound extends boolean = false, TRoutes extends PluginRoutes = PluginRoutes> { name: string; version?: string; enforce?: "pre" | "post"; /** Declarative API routes, mounted through the normal dev and production API pipeline. */ routes?: PluginRoutesFactory; /** Transform Farm config before the development or production pipeline is created. */ configure?: (config: FarmConfig, context: FarmPluginContextFor) => MaybePromise$1; /** Initialize private plugin state once for this plugin manager. */ setup?: (context: FarmPluginSetupContextFor) => MaybePromise$1; runtime?: FarmPluginRuntimeHooks; router?: FarmPluginRouterHooks; render?: FarmPluginRenderHooks; build?: FarmPluginBuildHooks; dev?: FarmPluginDevHooks; /** Optional browser lifecycle for this logical plugin. */ client?: FarmPluginClientConfig; /** @internal Carries the expected integration instance type without runtime data. */ readonly [FARM_PLUGIN_INTEGRATION_INSTANCE]?: (instance: TIntegrationInstance) => void; /** @internal Prevents integration-bound plugins from being registered globally. */ readonly [FARM_PLUGIN_INTEGRATION_BOUND]?: TIntegrationBound; /** @deprecated Use `setup` instead. */ init?: (context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `runtime.start` instead. */ ready?: (context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `dev.server` instead. */ devServerCreated?: (viteServer: ViteDevServer, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `configure` instead. */ config?: (config: FarmConfig, context: FarmPluginContextFor) => FarmConfig | Promise; configResolved?: (config: FarmConfig, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `build.before` instead. */ buildStart?: (context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `build.after` instead. */ buildEnd?: (context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.discovered` instead. */ routeDiscovered?: (route: RouteDiscoveredPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.generated` instead. */ routesGenerated?: (routes: RoutesGeneratedPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.discovered` instead. */ middlewareDiscovered?: (middleware: MiddlewareDiscoveredPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.discovered` instead. */ apiRouteDiscovered?: (route: APIRouteDiscoveredPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.before` instead. */ beforeRouteMatch?: (route: RouteMatchPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `router.after` instead. */ afterRouteMatch?: (result: RouteMatchResultPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `render.before` instead. */ beforeRender?: (render: RenderLifecyclePayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `render.html` instead. */ afterRender?: (html: string, render: RenderLifecyclePayload, context: FarmPluginContextFor) => string | Promise | void | Promise; /** @deprecated Use `runtime.before` instead. */ beforeApiHandler?: (request: Request, api: APIHandlerLifecyclePayload, context: FarmRequestPluginContextFor) => Request | Promise | void | Promise; /** @deprecated Use `runtime.after` instead. */ afterApiHandler?: (response: Response, api: APIHandlerLifecyclePayload, context: FarmPluginContextFor) => Response | Promise | void | Promise; onError?: (error: ErrorLifecyclePayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `dev.update` instead. */ hmrUpdate?: (update: HMRUpdatePayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `build.before` instead. */ beforeBundle?: (bundle: BundleLifecyclePayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `build.after` instead. */ afterBundle?: (result: BundleResultPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `build.configure` instead. */ beforeNitroBuild?: (nitroConfig: any, context: FarmPluginContextFor) => any | Promise; afterNitroBuild?: (payload: NitroBuildLifecyclePayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use `runtime.close` instead. */ shutdown?: (payload: ShutdownPayload, context: FarmPluginContextFor) => void | Promise; /** @deprecated Use the Web Request based `runtime.before` hook instead. */ beforeRequest?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContextFor) => void | Promise; /** @deprecated Use the Web Response based `runtime.after` hook instead. */ afterResponse?: (req: FarmRequest, res: FarmResponse, context: FarmRequestPluginContextFor) => void | Promise; /** @deprecated Use `render.html` instead. */ transformHTML?: (html: string, context: FarmPluginContextFor) => string | Promise; /** @deprecated Use `render.before` or `render.html` instead. */ transformPage?: (component: any, context: FarmPluginContextFor) => any | Promise; } declare class PluginManager { private plugins; private hookPresence; private runtimeHookPresence; private context; private pluginStates; private setupComplete; private initialized; private runtimeReady; private runtimeClosed; private runtimeStartPromise?; private runtimeClosePromise?; private runtimeShutdownHooksRunning; private runtimeDisposers; private runtimeRequestContexts; private failedRuntimeSessions; constructor(context: Omit); private createPluginHookContext; private createRequestHookContext; private copyRequestStore; private copyRuntimeRequestContext; private createRuntimeBaseEvent; private createRuntimeRequestContext; private runRuntimeErrorHooks; private createStateHookContext; private getPluginHooks; private getHookContext; addPlugin(plugin: FarmPlugin): void; addPlugins(plugins: FarmPlugin[]): void; getPlugins(): FarmPlugin[]; getSortedPlugins(): FarmPlugin[]; hasHook(hookName: keyof FarmPlugin): boolean; hasRuntimeHook(hookName: "context" | "before" | "after" | "error"): boolean; hasRuntimeRequestHooks(): boolean; copyRequestContext(source: FarmRequest | Request, target: FarmRequest | Request): void; setupPlugins(): Promise; startRuntime(): Promise; closeRuntime(reason?: string): Promise; beginRuntimeRequest(request: Request, options?: FarmPluginRuntimeRequestOptions): Promise; endRuntimeRequest(session: FarmPluginRuntimeSession, initialResponse: Response): Promise; failRuntimeRequest(session: FarmPluginRuntimeSession, error: unknown): Promise; runRuntimeRequest(request: Request, handler: FarmPluginRuntimeRequestHandler, options?: FarmPluginRuntimeRequestOptions): Promise; runHook(hookName: K, ...args: any[]): Promise; runHookSerial(hookName: K, initialValue: any, ...args: any[]): Promise; runHookParallel(hookName: K, ...args: any[]): Promise; /** @internal Runs hooks for only the plugins selected by the runtime adapter. */ runHookParallelFiltered(hookName: K, include: (plugin: FarmPlugin) => boolean, ...args: any[]): Promise; updateContext(updates: Partial): void; } declare function definePlugin, TClientState = unknown, TClientPublic = undefined, TIntegrationInstance = unknown, const TRoutes extends PluginRoutes = PluginRoutes>(plugin: FarmPlugin): FarmPlugin; declare namespace definePlugin { /** Bind an integration instance type while preserving inference for plugin state and context. */ function forIntegration(): , TClientState = unknown, TClientPublic = undefined>(plugin: FarmPlugin) => FarmPlugin; } type FarmIntegrationCategory = "auth" | "payment" | "monitoring" | "logging" | (string & {}); /** @deprecated Use FarmIntegrationCategory instead. */ type FarmIntegrationSlot = FarmIntegrationCategory; type FarmIntegrationRouteParamValue = string | string[]; type FarmIntegrationRouteParams = Record; type FarmIntegrationRouteMethod = FarmIntegrationAPIMethod | Lowercase | "ALL" | "all"; type FarmIntegrationRouteInputSource = "body" | "query"; type MaybePromise = T | Promise; type FarmIntegrationValidationPathSegment = PropertyKey | { readonly key: PropertyKey; }; interface FarmIntegrationRouteInput { body?: TBody; query?: TQuery; } interface FarmIntegrationValidationIssue { source: FarmIntegrationRouteInputSource; path?: readonly (string | number)[]; code?: string; message: string; } interface FarmIntegrationValidationErrorLike { issues?: readonly { path?: readonly FarmIntegrationValidationPathSegment[]; code?: string; message?: string; }[]; message?: string; } type FarmIntegrationValidationResult = { success: true; data: TValue; } | { success: false; error: FarmIntegrationValidationErrorLike; }; type FarmIntegrationStandardValidationResult = { value: TValue; } | { issues: readonly { path?: readonly FarmIntegrationValidationPathSegment[]; code?: string; message: string; }[]; }; interface FarmIntegrationInputSchema { _output?: TValue; parse?(value: unknown): MaybePromise; safeParse?(value: unknown): MaybePromise>; safeParseAsync?(value: unknown): Promise>; "~standard"?: { validate(value: unknown): MaybePromise>; types?: { output: TValue; }; }; } interface FarmIntegrationRouteInputSchemas { body?: FarmIntegrationInputSchema; query?: FarmIntegrationInputSchema; } /** @deprecated Use `FarmRequestStore` and access it through `ctx.req`. */ type FarmIntegrationRequestContextStore = FarmRequestStore; declare const FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalDispatch"; /** * Request-context key under which an integration middleware can hand * `Set-Cookie` values to the runtime when it returns `void` (i.e. lets the * request continue to the downstream route/page handler). The runtime reads * this key back after a `void` middleware return and forwards the cookies onto * the response it ultimately sends, so a server-side session refresh (or any * other cookie rotation) reaches the browser instead of being dropped. */ declare const FARM_INTEGRATION_SET_COOKIES_KEY = "farm:integration:set-cookies"; /** * Forward `Set-Cookie` values from an integration middleware that returns * `void` (the authenticated/passthrough branch) to the runtime, so they are * merged onto the response the runtime sends for the matched route. This is * the passthrough counterpart to appending `Set-Cookie` to a `Response` the * middleware returns directly (e.g. a failure redirect): both paths can rotate * auth cookies, and both must be able to reach the browser. */ declare function forwardIntegrationSetCookies(context: Pick, cookies: string[]): void; type FarmIntegrationRouteDb = InferFarmIntegrationOrmClient; interface FarmIntegrationRouteStorageArgs { getClient(): Promise; getOrm(): Promise>; } interface FarmIntegrationRouteArgs { db: FarmIntegrationRouteDb; getDb(): Promise>; storage: FarmIntegrationRouteStorageArgs; } interface FarmIntegrationConfigContext { key: string; integration: FarmIntegration; appConfig: FarmPluginContext["config"]; /** Alias for appConfig. */ config: FarmPluginContext["config"]; args: FarmIntegrationRouteArgs; env: Record; isDev: boolean; isProd: boolean; } interface FarmIntegrationConfigDefinition { schema?: FarmIntegrationInputSchema; env?: Record; defaults?: Partial | ((context: FarmIntegrationConfigContext) => MaybePromise>); input?: Partial | ((context: FarmIntegrationConfigContext) => MaybePromise>); resolve?(context: FarmIntegrationConfigContext): MaybePromise | undefined>; } type FarmIntegrationConfigInput = FarmIntegrationInputSchema | FarmIntegrationConfigDefinition; type FarmIntegrationLifecycleLogLevel = "info" | "warn" | "error"; interface FarmIntegrationLifecycleLogger { info(message: string, meta?: Record): void; warn(message: string, meta?: Record): void; error(message: string, meta?: Record): void; } interface FarmIntegrationLifecycleContext extends FarmIntegrationConfigContext { integration: FarmIntegration; integrationConfig: TConfig; log: FarmIntegrationLifecycleLogger; reason?: string; cleanup(callback?: () => MaybePromise): Promise; } type FarmIntegrationLifecycleHook = (context: FarmIntegrationLifecycleContext) => MaybePromise; /** * Small per-call integration metadata. Values received over HTTP are * client-controlled and should be validated before authorization decisions. */ type FarmIntegrationData = Record; interface FarmIntegrationHandlerContext { request: Request; requestId: string; url: URL; pathname: string; method: string; params: FarmIntegrationRouteParams; input: FarmIntegrationRouteInput; args: FarmIntegrationRouteArgs; data: FarmIntegrationData; integration: { category: FarmIntegrationCategory; /** @deprecated Use category instead. */ slot: FarmIntegrationCategory; type: string; instance: unknown; }; route: { kind: "route" | "middleware"; path: string; methods: readonly string[]; }; req: FarmRequestStore; /** @deprecated Use `req` instead. */ requestContext: FarmRequestStore; config: FarmPluginContext["config"]; isDev: boolean; isProd: boolean; } interface FarmIntegrationRouteHookContext extends FarmIntegrationHandlerContext { response?: Response; } type FarmIntegrationRouteHook = { bivarianceHack(request: Request, context: FarmIntegrationRouteHookContext): Promise | Response | void; }["bivarianceHack"]; interface FarmIntegrationRoute { path: string; method?: FarmIntegrationRouteMethod; methods?: readonly FarmIntegrationRouteMethod[]; middleware?: readonly FarmIntegrationRouteMiddleware[]; before?: readonly FarmIntegrationRouteHook[]; after?: readonly FarmIntegrationRouteHook[]; rawBody?: boolean; bodyFormat?: FarmIntegrationAPIBodyFormat; body?: FarmIntegrationInputSchema; query?: FarmIntegrationInputSchema; input?: FarmIntegrationRouteInputSchemas; handler(request: Request, context: FarmIntegrationHandlerContext): Promise | Response; } interface FarmTypedIntegrationRoute extends FarmIntegrationRoute { path: TPath; method: TMethod; __operation: FarmIntegrationAPIOperation; } interface FarmIntegrationRouteMiddleware { handler(request: Request, context: FarmIntegrationHandlerContext): Promise | Response | void; } interface FarmIntegrationMiddleware { matcher?: string | string[]; handler(request: Request, context: FarmIntegrationHandlerContext): Promise | Response | void; } interface FarmIntegrationProviderProps { children: ReactNode; } interface FarmIntegrationProviderComponentReference { /** Client-safe module specifier using `@/`, a path relative to the app root, or a package. */ module: string; /** Named export to use. Defaults to the module's default export. */ export?: string; } interface FarmIntegrationProvider { name: string; type: string; props?: Record; /** * The provider can be instantiated independently around each isolated * client root without relying on context or state owned by the route root. * Providers are treated as route-wide unless they explicitly opt in. */ supportsIsolatedHydration?: boolean; component?: ComponentType | FarmIntegrationProviderComponentReference; } interface FarmIntegrationDocumentNavigation { matcher: string | readonly string[]; } /** @deprecated Use `FarmSchemaFieldType`. */ type FarmIntegrationSchemaFieldType = FarmSchemaFieldType; /** @deprecated Use `FarmSchemaReference`. */ type FarmIntegrationSchemaReference = FarmSchemaReference; /** @deprecated Use `FarmSchemaField`. */ type FarmIntegrationSchemaField = FarmSchemaField; /** @deprecated Use `FarmSchemaConstraint`. */ type FarmIntegrationSchemaConstraint = FarmSchemaConstraint; /** @deprecated Use `FarmSchemaModel`. */ type FarmIntegrationSchemaModel = FarmSchemaModel; /** @deprecated Use `FarmSchemaModelExtension`. */ type FarmIntegrationSchemaModelExtension = FarmSchemaModelExtension; /** @deprecated Use `FarmSchemaModelOverride`. */ type FarmIntegrationSchemaModelOverride = FarmSchemaModelOverride; /** @deprecated Use `FarmSchema`. */ type FarmIntegrationSchema = FarmSchema; /** @deprecated Use `defineSchema`. This is an exact alias, not a wrapper. */ declare const defineIntegrationSchema: typeof defineSchema; type FarmIntegrationLogPhase = "registered" | "validate" | "setup" | "ready" | "dispose" | "request:start" | "request:end" | "request:error"; interface FarmIntegrationLogEvent { category: FarmIntegrationCategory; /** @deprecated Use category instead. */ slot: FarmIntegrationCategory; type: string; phase: FarmIntegrationLogPhase; route?: { kind: "route" | "middleware"; path: string; methods: readonly string[]; }; requestId?: string; request?: Request; response?: Response; error?: unknown; durationMs?: number; level?: FarmIntegrationLifecycleLogLevel; message?: string; meta?: Record; context: Map; } type FarmIntegrationLogger = (event: FarmIntegrationLogEvent) => void | Promise; interface FarmIntegrationPluginOwner { key: string; category: FarmIntegrationCategory; type: string; source: "lifecycle" | "contribution"; serverRuntime: boolean; } /** A normal plugin or an integration-bound plugin compatible with the shared instance. */ type FarmIntegrationContributedPlugin = FarmPlugin | FarmPlugin; interface FarmIntegration { readonly kind: "farm-integration"; category: FarmIntegrationCategory; /** @deprecated Use category instead. */ slot?: FarmIntegrationCategory; type: string; instance: TInstance; /** Set to false when a platform adapter owns this integration's production routes. */ serverRuntime?: boolean; api?: FarmIntegrationAPI; schema?: TSchema; config?: FarmIntegrationConfigInput; validate?: FarmIntegrationLifecycleHook; setup?: FarmIntegrationLifecycleHook; ready?: FarmIntegrationLifecycleHook; dispose?: FarmIntegrationLifecycleHook; log?: FarmIntegrationLogger; routes?: readonly FarmIntegrationRoute[]; endpoints?: FarmIntegrationEndpoints; middleware?: readonly FarmIntegrationMiddleware[]; providers?: readonly FarmIntegrationProvider[]; documentNavigations?: readonly FarmIntegrationDocumentNavigation[]; /** Additional Farm plugins owned and configured by this integration. */ plugins?: readonly FarmIntegrationContributedPlugin>[]; } type FarmIntegrationsUserConfig = Record | undefined>; /** @internal Identifies plugins owned by platform-managed integrations. */ declare function getFarmIntegrationPluginServerRuntime(plugin: FarmPlugin): boolean | undefined; /** Returns the integration that contributed a normalized plugin, when applicable. */ declare function getFarmIntegrationPluginOwner(plugin: FarmPlugin): Readonly | undefined; type IntegrationRouteBuilderOptions = { middleware?: readonly FarmIntegrationRouteMiddleware[]; before?: readonly FarmIntegrationRouteHook[]; after?: readonly FarmIntegrationRouteHook[]; rawBody?: boolean; headers?: Record; credentials?: RequestCredentials; bodyFormat?: FarmIntegrationAPIBodyFormat; responseFormat?: FarmIntegrationAPIResponseFormat; isServer?: TServer; body?: FarmIntegrationInputSchema; query?: FarmIntegrationInputSchema; input?: FarmIntegrationRouteInputSchemas; handler(request: Request, context: FarmIntegrationHandlerContext): Promise | Response; }; interface FarmIntegrationRouteFactory { get(path: TPath, input: Omit, "bodyFormat">): FarmTypedIntegrationRoute; post(path: TPath, input: IntegrationRouteBuilderOptions): FarmTypedIntegrationRoute; query(path: TPath, input: IntegrationRouteBuilderOptions): FarmTypedIntegrationRoute; put(path: TPath, input: IntegrationRouteBuilderOptions): FarmTypedIntegrationRoute; patch(path: TPath, input: IntegrationRouteBuilderOptions): FarmTypedIntegrationRoute; delete(path: TPath, input: IntegrationRouteBuilderOptions): FarmTypedIntegrationRoute; options(path: TPath, input: Omit, "bodyFormat">): FarmTypedIntegrationRoute; head(path: TPath, input: Omit, "bodyFormat">): FarmTypedIntegrationRoute; } interface FarmIntegrationRoutesFactoryContext { route: FarmIntegrationRouteFactory; integrationRoute: FarmIntegrationRouteFactory; } type FarmIntegrationRoutesFactory = (context: FarmIntegrationRoutesFactoryContext) => readonly FarmIntegrationRoute[]; type FarmIntegrationEndpointValue = FarmIntegrationRoute | readonly FarmIntegrationEndpointValue[] | { readonly [key: string]: FarmIntegrationEndpointValue | undefined; }; type FarmIntegrationEndpoints = { readonly [key: string]: FarmIntegrationEndpointValue | undefined; }; interface FarmIntegrationEndpointsFactoryContext extends FarmIntegrationRoutesFactoryContext { endpoint: FarmIntegrationRouteFactory; } type FarmIntegrationEndpointsFactory = (context: FarmIntegrationEndpointsFactoryContext) => FarmIntegrationEndpoints; declare function createIntegrationRoute(_schema?: TSchema): FarmIntegrationRouteFactory; declare const integrationRoute: FarmIntegrationRouteFactory; type RegisteredIntegrationRuntime = { integration: FarmIntegration; config: FarmPluginContext["config"]; isDev: boolean; isProd: boolean; }; type FarmIntegrationRoutesInput = readonly FarmIntegrationRoute[] | FarmIntegrationRoutesFactory; type FarmIntegrationEndpointsInput = FarmIntegrationEndpoints | FarmIntegrationEndpointsFactory; type FarmIntegrationInput = Omit, "kind" | "category" | "slot" | "instance" | "config" | "routes" | "endpoints" | "plugins"> & { instance: TInstance; config?: FarmIntegrationConfigInput; routes?: FarmIntegrationRoutesInput; endpoints?: FarmIntegrationEndpointsInput; plugins?: readonly FarmIntegrationContributedPlugin>[]; } & ({ category: FarmIntegrationCategory; slot?: FarmIntegrationCategory; } | { category?: FarmIntegrationCategory; slot: FarmIntegrationCategory; }); type FarmIntegrationCategoryInput = { category: FarmIntegrationCategory; slot?: FarmIntegrationCategory; } | { category?: FarmIntegrationCategory; slot: FarmIntegrationCategory; }; type FarmIntegrationShapeForInference = FarmIntegrationCategoryInput & { api?: FarmIntegrationAPI; schema?: FarmIntegrationSchema; config?: unknown; routes?: unknown; endpoints?: unknown; }; type ExtractIntegrationSchema = TIntegration extends { schema: infer TSchema extends FarmIntegrationSchema; } ? TSchema : undefined; type ResolveIntegrationRoutesInput = TRoutes extends FarmIntegrationRoutesFactory ? ReturnType : TRoutes; type ResolveIntegrationEndpointsInput = TEndpoints extends FarmIntegrationEndpointsFactory ? ReturnType : TEndpoints; type ExtractIntegrationRoutesFromRoutesInput = ResolveIntegrationRoutesInput extends readonly (infer TRoute)[] ? TRoute : never; type ExtractIntegrationRoutesFromEndpointValue = TValue extends FarmIntegrationRouteOperationCarrier ? TValue : TValue extends readonly (infer TItem)[] ? ExtractIntegrationRoutesFromEndpointValue : TValue extends object ? ExtractIntegrationRoutesFromEndpointValue : never; type ExtractIntegrationRoutesFromEndpointsInput = ExtractIntegrationRoutesFromEndpointValue>; type ExtractIntegrationRouteUnion = (TIntegration extends { routes: infer TRoutes; } ? ExtractIntegrationRoutesFromRoutesInput : never) | (TIntegration extends { endpoints: infer TEndpoints; } ? ExtractIntegrationRoutesFromEndpointsInput : never); type ExtractDefinedIntegrationRoutes = [ExtractIntegrationRouteUnion] extends [never] ? undefined : readonly ExtractIntegrationRouteUnion[]; type ExtractDefinedIntegrationEndpoints = TIntegration extends { endpoints: infer TEndpoints; } ? ResolveIntegrationEndpointsInput : undefined; type ExtractIntegrationAPIRoutes = Extract, FarmIntegrationRouteOperationCarrier>; type ExtractIntegrationCategory = TIntegration extends { category: infer TCategory extends FarmIntegrationCategory; } ? TCategory : TIntegration extends { slot: infer TSlot extends FarmIntegrationCategory; } ? TSlot : FarmIntegrationCategory; type ExtractDerivedIntegrationAPI> = TIntegration extends { api: infer TAPI extends FarmIntegrationAPI; } ? TAPI : [ExtractIntegrationAPIRoutes] extends [never] ? FarmIntegrationAPI | undefined : InferIntegrationAPIFromRoutes[]>; type DefinedIntegration> = Omit & { readonly kind: "farm-integration"; category: ExtractIntegrationCategory; slot: ExtractIntegrationCategory; routes: ExtractDefinedIntegrationRoutes; endpoints: ExtractDefinedIntegrationEndpoints; api: ExtractDerivedIntegrationAPI; }; declare function defineIntegration>(integration: TIntegration & FarmIntegrationInput>): DefinedIntegration; declare function isFarmIntegration(value: unknown): value is FarmIntegration; declare function resolveIntegrationPlugins(integrations: FarmIntegrationsUserConfig | undefined): FarmPlugin[]; declare function getIntegrationProviders(integrations: FarmIntegrationsUserConfig | undefined): FarmIntegrationProvider[]; declare function isFarmIntegrationProviderComponentReference(value: FarmIntegrationProvider["component"]): value is FarmIntegrationProviderComponentReference; declare function getIntegrationDocumentNavigationMatchers(integrations: FarmIntegrationsUserConfig | undefined): string[]; declare function getIntegrationSchemas(integrations: FarmIntegrationsUserConfig | undefined): Record; declare function getRegisteredIntegrationRuntime(key: string): RegisteredIntegrationRuntime | undefined; declare function getRegisteredIntegrations(): Record; declare function getRegisteredIntegrationSchemas(): Record; declare function matchIntegrationRoute(integrations: FarmIntegrationsUserConfig | undefined, input: { pathname: string; method?: string; }): { key: string; integration: FarmIntegration; route: { path: string; methods: readonly string[]; }; params: FarmIntegrationRouteParams; } | null; declare function matchRegisteredIntegrationRoute(input: { pathname: string; method?: string; }): { key: string; integration: FarmIntegration; route: { path: string; methods: readonly string[]; }; params: FarmIntegrationRouteParams; } | null; declare function getRegisteredIntegrationAPIManifest(): Record; declare function dispatchIntegrationRequest(runtime: RegisteredIntegrationRuntime, request: Request, options?: { currentRequest?: Request; data?: FarmIntegrationData; internal?: boolean; }): Promise; declare global { namespace FarmJS { /** @internal Application route patterns registered by generated types. */ interface RouteRegistry { } } } /** A renderer-neutral component accepted by Farm's file-system router. */ type FarmComponentType> = ((props: TProps) => any) | (new (props: TProps) => any); /** All generated route module patterns for the current application. */ type AppRoutePattern = FarmJS.RouteRegistry extends { pattern: infer TPattern extends string; } ? TPattern : string; type FarmRoutePropsDefault = never; type FarmRoutePropsTarget = AppRoutePattern; type StripPageRouteSuffix = TRoute extends `${infer TPath}?${string}` ? StripPageRouteSuffix : TRoute extends `${infer TPath}#${string}` ? StripPageRouteSuffix : TRoute; type SimplifyPageRouteParams = { [TKey in keyof TValue]: TValue[TKey]; } & {}; type PageRouteSegmentParams = TSegment extends `[[...${infer TParam}]]` ? { [TKey in TParam]?: string; } : TSegment extends `[...${infer TParam}]` ? { [TKey in TParam]: string; } : TSegment extends `[${infer TParam}]` ? { [TKey in TParam]: string; } : {}; type ExtractPageRouteParams = TRoute extends `${infer TSegment}/${infer TRest}` ? PageRouteSegmentParams & ExtractPageRouteParams : PageRouteSegmentParams; /** Infer the decoded params received by a page from a route pattern. */ type PageRouteParams = string extends TRoute ? Record : TRoute extends string ? SimplifyPageRouteParams>> : never; type ResolvePageRouteParams = [TRoute] extends [never] ? Record : TRoute extends string ? PageRouteParams : Record; type NitroPreset = "node-server" | "vercel" | "cloudflare" | "cloudflare-pages" | "netlify" | "netlify-edge" | "bun" | "deno" | "azure" | "aws-lambda" | "firebase" | "custom" | "self-host" | "farm" | string; type FarmMigrationCommand = string | { /** Shell command to run for this migration step. */ command: string; /** Optional label printed by the CLI before running the command. */ name?: string; /** Working directory for this command, relative to the project root unless absolute. */ cwd?: string; /** Additional environment variables for this command. */ env?: Record; /** Skip this command without removing it from config. */ skip?: boolean; }; interface FarmMigrationsConfig { /** One-shot commands that create or update app/integration schemas. */ commands?: FarmMigrationCommand[]; } type FarmMigrationsUserConfig = FarmMigrationsConfig | FarmMigrationCommand[]; interface ResolvedFarmMigrationsConfig { commands: FarmMigrationCommand[]; } interface FarmContextFactoryInput { request: Request; rawRequest?: FarmRequest; params: Record; search: Record; path: string; } type FarmContextFactory = (input: FarmContextFactoryInput) => TContext | Promise; interface FarmAppContext { } interface FarmConfig { root?: string; /** App source directory. @default "src" */ srcDir?: string; extends?: readonly FarmLayerEntry[]; /** Resolved layer graph. Populated by config resolution. */ layers?: readonly ResolvedFarmLayer[]; outDir?: string; basePath?: string; /** Generate and canonicalize non-root application page URLs with a trailing slash. */ trailingSlash?: boolean; /** * Component renderer used for JSX compilation, SSR, and browser hydration. * React is used when omitted. */ renderer?: FarmRenderer; preset?: NitroPreset; deploy?: { target?: "vercel" | "cloudflare" | "netlify" | "node" | string; preset?: NitroPreset; outputDir?: string; output?: string; projectName?: string; vercel?: { outputDirectory?: string; buildCommand?: string; installCommand?: string; framework?: string | null; }; cloudflare?: { outputDir?: string; projectName?: string; }; netlify?: { outputDir?: string; site?: string; }; }; storage?: FarmStorageUserConfig; /** Shared application data, route, ISR, and PPR cache. */ cache?: FarmCacheUserConfig; integrations?: FarmIntegrationsUserConfig; /** Farm-native authentication. `true` enables email/password auth. */ auth?: FarmAuthUserConfig | ResolvedFarmAuthConfig; plugins?: FarmPlugin[]; migrations?: FarmMigrationsUserConfig; /** Map portable cron schedules to ordinary GET API routes. */ cron?: FarmCronUserConfig | FarmCronResolvedConfig | false; workflows?: FarmWorkflowsUserConfig | boolean; /** Public base URL and path used by Farm's browser API clients. */ api?: FarmAPIConfig; env?: FarmEnvConfig | ResolvedFarmEnv; middleware?: FarmMiddlewareConfig; routeRules?: FarmRouteRules; context?: FarmContextFactory; /** Server ingress and trusted-proxy policy. */ server?: FarmServerConfig; serverActions?: FarmServerActionsConfig; /** App-wide HTTP security policy. */ security?: FarmSecurityConfig | ResolvedFarmSecurityConfig; /** Opt-in agent-readiness primitives (JSON-LD and related). Off by default. */ agent?: FarmAgentUserConfig; images?: FarmImageConfig; /** Browser resource scheduling and preload budgets. */ performance?: FarmPerformanceConfig; /** Built-in light, dark, and system color-mode runtime. */ theme?: FarmThemeConfig | ResolvedFarmThemeConfig | false; i18n?: FarmI18nUserConfig | ResolvedFarmI18nConfig | false; /** Build identifier used to detect stale clients during rolling deployments. */ deploymentId?: string; /** Optional project-relative module used for unmatched page routes. */ notFound?: { component?: string; }; /** Server-only application runtime values. */ serverRuntimeConfig?: Record; /** Serializable application values exposed to `src/client.ts`. */ publicRuntimeConfig?: Record; docs?: FarmDocsUserConfig | FarmDocsResolvedConfig; md?: FarmMarkdownUserConfig | FarmMarkdownResolvedConfig | boolean; mdx?: FarmMdxUserConfig | FarmMdxResolvedConfig; observability?: FarmObservabilityUserConfig; /** Farm product telemetry for deployed server runtimes. Set to false to disable. */ telemetry?: boolean; /** * Development-only runtime inspector. Enabled by default during `farm dev`. * * @deprecated The built-in dashboard is deprecated. Install `@farm.js/devtools` and add * `devtools()` to `plugins` instead; it reuses this runtime and owns the maintained UI. * `devtools: false` and `shortcut` remain supported for the transition. */ devtools?: FarmDevtoolsUserConfig; /** Development-only browser feedback for build and HMR activity. */ devIndicators?: FarmDevIndicatorsConfig; /** * When true, Link href is not strictly typed (accepts any string). * Use when you want to skip route-type errors on Link or don't use generated route types. */ suppressLintOnLink?: boolean; experimental?: { serverComponents?: boolean; serverActions?: boolean; /** * Enables Partial Prerendering (static-shell caching). Routes still opt in * individually with `export const ppr = true`, the Next-compatible * `export const experimental_ppr = true`, or a `"use ppr"` directive; * without this flag those declarations are inert and the route renders * fully dynamically. * * @experimental * @default false */ ppr?: boolean; /** * Controls non-RSC hydration ownership for server modules that import * leaf `"use client"` components. * * - `"off"` keeps the current route-wide hydration boundary. * - `"analyze"` reports eligible boundaries without changing runtime behavior. * - `"enabled"` hydrates eligible client leaves independently and falls * back to route-wide hydration for unsupported module graphs. * * This does not enable React Server Components. `"use client"` remains a * valid client-boundary declaration in normal SSR applications. * * @experimental * @default "off" */ isolatedClientHydration?: FarmIsolatedClientHydrationMode; /** * Automatically optimize eligible server-only host-element subtrees with * the native Strata renderer. Unsupported trees keep normal React * rendering; no application boundary component is required. * * @experimental * @default false */ optimizedBoundary?: boolean; }; vite?: any; } type FarmIsolatedClientHydrationMode = "off" | "analyze" | "enabled"; /** * Middleware data available in page components */ interface MiddlewareProps { /** * Map containing all data set by middleware via ctx.data.set() * * @example * ```tsx * // In middleware.ts * ctx.data.set('user', { id: 1, name: 'John' }); * * // In page.tsx * const user = props.middleware?.data.get('user'); * ``` */ data: Map; } /** * Plugin context data available in server page components. * Only values explicitly exposed by plugins are included. */ interface PluginContextProps { data: Map; } /** * Page component props * * @param params - Dynamic route parameters (e.g., { id: '123' } for /users/[id]) * @param searchParams - URL search/query parameters * @param path - Current pathname * @param middleware - Data set by middleware.ts (optional, available if middleware exists) * @param context - Data explicitly exposed by plugins for this request (optional) */ interface PageProps { params: ResolvePageRouteParams; searchParams: Promise>; path: string; /** * Data from middleware.ts in the same directory or parent directories * Access data via props.middleware?.data.get('key') * * @example * ```tsx * export default function Page(props: PageProps) { * const user = props.middleware?.data.get('user'); * const stats = props.middleware?.data.get('dashboardStats'); * * return
Welcome {user?.name}
; * } * ``` */ middleware?: MiddlewareProps; /** * Request-scoped plugin context values explicitly exposed by plugins. * Access data via props.context?.data.get('key'). */ context?: PluginContextProps; } interface LoadingProps { params: ResolvePageRouteParams; searchParams: Promise>; search?: Record; path: string; middleware?: MiddlewareProps; context?: PluginContextProps; } interface ErrorProps extends LoadingProps { error: unknown; reset: () => void; } /** * Helper type to create typed page props with specific middleware data shape * * @example * ```tsx * interface MyMiddlewareData { * user: { id: number; name: string }; * stats: { views: number }; * } * * type MyPageProps = PagePropsWithMiddleware; * * export default function Page(props: MyPageProps) { * const user = props.middleware?.data.get('user'); // Fully typed! * const stats = props.middleware?.data.get('stats'); // Fully typed! * * return
Welcome {user?.name}
; * } * ``` */ type PagePropsWithMiddleware, TRoute extends FarmRoutePropsTarget = FarmRoutePropsDefault> = PageProps & { middleware: { data: Map; }; }; interface LayoutProps { children: any; params: ResolvePageRouteParams; } /** Props passed to a route's `generateMetadata` function. */ type MetadataProps = PageProps; /** Props passed to a layout's `generateMetadata` function. */ interface LayoutMetadataProps { params: ResolvePageRouteParams; } type Page = FarmComponentType>; type Layout = FarmComponentType>; type Loading = FarmComponentType>; type ErrorBoundary = FarmComponentType>; /** * Route module exports for pages * * SSR is the default - pages render on each request * SSG is opt-in via `export const ssg = true`, Next-compatible route * config exports, or a top-of-file rendering directive. * * @example SSR Page (default): * ```tsx * export default async function Page() { * const data = await fetchData(); * return
{data.title}
; * } * ``` * * @example SSG Page: * ```tsx * export const ssg = true; * * export default function AboutPage() { * return

About Us

; * } * ``` * * @example SSG with Revalidation (ISR): * ```tsx * export const ssg = true; * export const revalidate = 60; // Regenerate every 60 seconds * * export default async function ProductsPage() { * const products = await fetchProducts(); * return ; * } * ``` * * @example Dynamic SSG Route: * ```tsx * export const ssg = true; * * export async function getStaticPaths() { * const posts = await fetchPosts(); * return posts.map(post => ({ slug: post.slug })); * } * * export default async function BlogPost({ params }) { * const post = await fetchPost(params.slug); * return
{post.title}
; * } * ``` * * @example Next-compatible Route Config: * ```tsx * export const dynamic = "force-static"; * export const revalidate = 60; * * export default function DocsPage() { * return

Docs

; * } * ``` * * @example Directive Route Config: * ```tsx * "use ssg; 60"; * * export default function DocsPage() { * return

Docs

; * } * ``` */ interface RouteModule { default?: Page; /** Execution runtime for this route. Layout values are inherited unless overridden. */ runtime?: FarmRouteRuntime; /** Provider-specific execution regions, or "auto" to clear an inherited value. */ regions?: FarmRouteRegions; /** Maximum execution time in seconds, or "auto" to use the provider default. */ maxDuration?: FarmRouteMaxDuration; /** * Mark this page for Static Site Generation (SSG) * When true, the page will be pre-rendered at build time */ ssg?: boolean; /** * Revalidate interval in seconds for Incremental Static Regeneration (ISR) * Only applicable when ssg = true */ revalidate?: number | false; /** * Next.js-compatible rendering mode. * - force-static/error: pre-render at build time * - force-dynamic: render on each request */ dynamic?: "auto" | "force-static" | "force-dynamic" | "error"; /** * Opt into Partial Prerendering/static-shell caching for this route. * Compatible with Farm's `ppr` export and Next.js `experimental_ppr`. * Requires `experimental.ppr` in `farm.config.ts`; inert without it. */ ppr?: boolean; experimental_ppr?: boolean; /** * Return all paths to pre-render for dynamic SSG routes * Required for dynamic routes (e.g., [slug]) when ssg = true */ getStaticPaths?: GenerateStaticParams; /** * @deprecated Use getStaticPaths instead */ generateStaticParams?: GenerateStaticParams; metadata?: Metadata & Record; generateMetadata?: (props: MetadataProps) => Promise | Metadata; } /** A value accepted for one static route parameter. */ type StaticPathPrimitive = string | number | boolean; /** * Parameters returned by `getStaticPaths` or `generateStaticParams`. * Arrays create individual URL segments for catch-all route parameters. */ type StaticPathParams = Record; type StaticRouteSegmentParams = TSegment extends `[[...${infer TParam}]]` ? { [TKey in TParam]?: readonly StaticPathPrimitive[]; } : TSegment extends `[...${infer TParam}]` ? { [TKey in TParam]: readonly StaticPathPrimitive[]; } : TSegment extends `[${infer TParam}]` ? { [TKey in TParam]: StaticPathPrimitive; } : {}; type ExtractStaticRouteParams = TRoute extends `${infer TSegment}/${infer TRest}` ? StaticRouteSegmentParams & ExtractStaticRouteParams : StaticRouteSegmentParams; /** Infer the values accepted from `getStaticPaths` for a route pattern. */ type StaticRouteParams = string extends TRoute ? StaticPathParams : TRoute extends string ? SimplifyPageRouteParams>> : never; type ResolveStaticRouteParams = [TRoute] extends [never] ? StaticPathParams : TRoute extends string ? StaticRouteParams : StaticPathParams; /** A route-aware `getStaticPaths` or `generateStaticParams` function. */ type GenerateStaticParams = () => Array> | Promise>>; interface LayoutModule { default: Layout; /** Semantic fonts inherited by framework-owned surfaces for this route. */ fonts?: FarmLayoutFonts; runtime?: FarmRouteRuntime; regions?: FarmRouteRegions; maxDuration?: FarmRouteMaxDuration; metadata?: Metadata & Record; generateMetadata?: (props: LayoutMetadataProps) => Promise | Metadata; } interface Metadata { metadataBase?: string | URL; title?: string | { default?: string; template?: string; }; description?: string; keywords?: string | string[]; author?: string; authors?: Array<{ name: string; url?: string; }>; creator?: string; publisher?: string; robots?: string | { index?: boolean; follow?: boolean; }; openGraph?: { title?: string; description?: string; url?: string; siteName?: string; images?: string | { url: string; width?: number; height?: number; alt?: string; type?: string; } | Array<{ url: string; width?: number; height?: number; alt?: string; type?: string; }>; image?: string; type?: string; locale?: string; }; twitter?: { card?: "summary" | "summary_large_image" | "app" | "player"; site?: string; creator?: string; title?: string; description?: string; images?: string | { url: string; width?: number; height?: number; alt?: string; type?: string; } | Array; }; alternates?: { canonical?: string; languages?: Record; }; icons?: string | { icon?: string | Array; shortcut?: string | Array; apple?: string | Array; }; manifest?: string; } interface FarmRequest extends IncomingMessage { params?: Record; query?: Record; body?: any; } interface FarmResponse extends ServerResponse { json: (data: any) => void; status: (code: number) => FarmResponse; redirect: (url: string, status?: number) => void; } type ServerAction = (...args: any[]) => Promise; interface RouteSegment { segment: string; isDynamic: boolean; isOptional: boolean; isCatchAll: boolean; } interface ParsedRoute { segments: RouteSegment[]; filePath: string; type: "page" | "layout" | "loading" | "error" | "not-found"; } interface BuildOptions { mode: "development" | "production"; ssr: boolean; minify: boolean; sourcemap: boolean; } /** * Represents a page to be pre-rendered at build time (SSG) */ interface SSGPage { /** The URL path for this page */ urlPath: string; /** The file path to the page module */ filePath: string; /** Route parameters for dynamic routes */ params: Record; /** Revalidation interval in seconds (ISR) */ revalidate?: number; } /** * Result of SSG page collection */ interface SSGCollectionResult { /** Pages to pre-render at build time */ ssg: SSGPage[]; /** Routes that will be server-rendered on each request */ ssr: string[]; } export { type BuildOptions as $, type AppRoutePattern as A, type BundleResultPayload as B, type FarmContextFactoryInput as C, type FarmIsolatedClientHydrationMode as D, type LoadingProps as E, type FarmRouteRuntimeConfig as F, type ErrorProps as G, type PagePropsWithMiddleware as H, type MetadataProps as I, type LayoutMetadataProps as J, type Page as K, type LayoutProps as L, type Metadata as M, type NitroPreset as N, type Layout as O, type ParsedRoute as P, type Loading as Q, type RouteSegment as R, type ErrorBoundary as S, type StaticPathPrimitive as T, type StaticPathParams as U, type StaticRouteParams as V, type GenerateStaticParams as W, type LayoutModule as X, type FarmRequest as Y, type FarmResponse as Z, type ServerAction as _, type FarmPlugin as a, type FarmPluginLifecycle as a$, type SSGPage as a0, type SSGCollectionResult as a1, type FarmLayerEntry as a2, type ResolvedFarmLayer as a3, type FarmSourceRoot as a4, type ResolveFarmLayersOptions as a5, type FarmLayerResolution as a6, resolveFarmLayers as a7, getFarmSourceRoots as a8, getFarmAppDirectories as a9, resolveConfig as aA, loadConfig as aB, resolveDeployConfig as aC, resolveMigrationsConfig as aD, resolveDeployOutputPath as aE, normalizeDeployTarget as aF, getDeployTargetForPreset as aG, getPresetForDeployTarget as aH, type FarmLayerConfig as aI, type FarmPerformanceConfig as aJ, type FarmPreloadMode as aK, type FarmPreloadUserConfig as aL, type ResolvedFarmPreloadConfig as aM, type FarmCspConfig as aN, type FarmCspDirectives as aO, type FarmCspDirectiveValue as aP, type FarmCspOptions as aQ, type FarmSecurityConfig as aR, type ResolvedFarmCspConfig as aS, type FarmAuthConfig as aT, type FarmAuthDatabaseConfig as aU, type FarmAuthEmailAndPasswordConfig as aV, type FarmAuthSessionConfig as aW, type FarmAuthUserConfig as aX, type PluginRequestContext as aY, type FarmPluginContext as aZ, type FarmPluginIntegrationContext as a_, getFarmLayerAliases as aa, createFarmConfigResolutionPlugin as ab, loadFarmConfigFile as ac, type ReadonlyMiddlewareStore as ad, type FarmMiddlewareConfig as ae, type MiddlewareModule as af, type MiddlewareConfig$1 as ag, type MiddlewareContext as ah, type FarmAgentJsonLd as ai, type ResolvedFarmRouteRuntimeConfig as aj, type ResolvedFarmAPIConfig as ak, type ResolvedFarmDevtoolsConfig as al, type ResolvedFarmDevIndicatorsConfig as am, type ResolvedFarmAuthConfig as an, type ResolvedFarmPerformanceConfig as ao, type ResolvedFarmSecurityConfig as ap, type APIRequestRuntime as aq, manageFarmDocumentPreloads as ar, manageFarmHtmlPreloads as as, manageFarmLinkHeaderPreloads as at, reportFarmPreloadWarnings as au, type OpenAPIConfig as av, type FarmAgentUserConfig as aw, definePlugin as ax, FarmRuntimeShutdownError as ay, PluginManager as az, type FarmRouteRuntime as b, forwardIntegrationSetCookies as b$, type FarmRequestPluginContext as b0, type FarmRequestStore as b1, type FarmPluginRuntimeKind as b2, type FarmPluginRouteRuntimePayload as b3, type FarmPluginSetupContext as b4, type FarmPluginStateContext as b5, type FarmPluginRuntimeBaseEvent as b6, type FarmPluginRuntimeContextEvent as b7, type FarmPluginRuntimeBeforeEvent as b8, type FarmPluginRuntimeAfterEvent as b9, type ResolvedFarmConfig as bA, type RedirectConfig as bB, type HeaderConfig as bC, type RewriteConfig as bD, type ImageConfig as bE, type I18nConfig as bF, type MiddlewareConfig as bG, type FarmDeployConfig as bH, type ResolvedFarmDeployConfig as bI, type FarmDeployTarget as bJ, type FarmIntegrationCategory as bK, type FarmIntegrationSlot as bL, type FarmIntegrationRouteParamValue as bM, type FarmIntegrationRouteParams as bN, type FarmIntegrationRouteMethod as bO, type FarmIntegrationRouteInputSource as bP, type FarmIntegrationValidationPathSegment as bQ, type FarmIntegrationRouteInput as bR, type FarmIntegrationValidationIssue as bS, type FarmIntegrationValidationErrorLike as bT, type FarmIntegrationValidationResult as bU, type FarmIntegrationStandardValidationResult as bV, type FarmIntegrationInputSchema as bW, type FarmIntegrationRouteInputSchemas as bX, type FarmIntegrationRequestContextStore as bY, FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY as bZ, FARM_INTEGRATION_SET_COOKIES_KEY as b_, type FarmPluginRuntimeErrorEvent as ba, type FarmPluginRuntimeStartEvent as bb, type FarmPluginRuntimeCloseEvent as bc, type FarmPluginRuntimeHooks as bd, type FarmPluginRuntimeRequestOptions as be, type FarmPluginRuntimeRequestHandler as bf, type FarmPluginRuntimeSession as bg, type FarmPluginDiscoveredRoute as bh, type FarmPluginRouterHooks as bi, type FarmPluginRenderHooks as bj, type FarmPluginBuildHooks as bk, type FarmPluginDevHooks as bl, type FarmPluginClientConfig as bm, type RouteDiscoveredPayload as bn, type RoutesGeneratedPayload as bo, type MiddlewareDiscoveredPayload as bp, type APIRouteDiscoveredPayload as bq, type RouteMatchPayload as br, type RouteMatchResultPayload as bs, type RenderLifecyclePayload as bt, type APIHandlerLifecyclePayload as bu, type ErrorLifecyclePayload as bv, type HMRUpdatePayload as bw, type BundleLifecyclePayload as bx, type NitroBuildLifecyclePayload as by, type ShutdownPayload as bz, type FarmRouteRegions as c, describeIntegrationOriginRejection as c$, type FarmIntegrationRouteDb as c0, type FarmIntegrationRouteStorageArgs as c1, type FarmIntegrationRouteArgs as c2, type FarmIntegrationConfigContext as c3, type FarmIntegrationConfigDefinition as c4, type FarmIntegrationConfigInput as c5, type FarmIntegrationLifecycleLogLevel as c6, type FarmIntegrationLifecycleLogger as c7, type FarmIntegrationLifecycleContext as c8, type FarmIntegrationLifecycleHook as c9, type FarmIntegrationsUserConfig as cA, getFarmIntegrationPluginServerRuntime as cB, getFarmIntegrationPluginOwner as cC, type FarmIntegrationRouteFactory as cD, type FarmIntegrationRoutesFactoryContext as cE, type FarmIntegrationRoutesFactory as cF, type FarmIntegrationEndpointValue as cG, type FarmIntegrationEndpoints as cH, type FarmIntegrationEndpointsFactoryContext as cI, type FarmIntegrationEndpointsFactory as cJ, createIntegrationRoute as cK, integrationRoute as cL, type DefinedIntegration as cM, defineIntegration as cN, isFarmIntegration as cO, resolveIntegrationPlugins as cP, getIntegrationProviders as cQ, isFarmIntegrationProviderComponentReference as cR, getIntegrationDocumentNavigationMatchers as cS, getIntegrationSchemas as cT, getRegisteredIntegrationRuntime as cU, getRegisteredIntegrations as cV, getRegisteredIntegrationSchemas as cW, matchIntegrationRoute as cX, matchRegisteredIntegrationRoute as cY, getRegisteredIntegrationAPIManifest as cZ, dispatchIntegrationRequest as c_, type FarmIntegrationData as ca, type FarmIntegrationHandlerContext as cb, type FarmIntegrationRouteHookContext as cc, type FarmIntegrationRouteHook as cd, type FarmIntegrationRoute as ce, type FarmTypedIntegrationRoute as cf, type FarmIntegrationRouteMiddleware as cg, type FarmIntegrationMiddleware as ch, type FarmIntegrationProviderProps as ci, type FarmIntegrationProviderComponentReference as cj, type FarmIntegrationProvider as ck, type FarmIntegrationDocumentNavigation as cl, type FarmIntegrationSchemaFieldType as cm, type FarmIntegrationSchemaReference as cn, type FarmIntegrationSchemaField as co, type FarmIntegrationSchemaConstraint as cp, type FarmIntegrationSchemaModel as cq, type FarmIntegrationSchemaModelExtension as cr, type FarmIntegrationSchemaModelOverride as cs, type FarmIntegrationSchema as ct, defineIntegrationSchema as cu, type FarmIntegrationLogPhase as cv, type FarmIntegrationLogEvent as cw, type FarmIntegrationLogger as cx, type FarmIntegrationPluginOwner as cy, type FarmIntegrationContributedPlugin as cz, type FarmRouteMaxDuration as d, FARM_DEVTOOLS_LAUNCH_PARAM as d$, resolveIntegrationAllowedOrigins as d0, validateIntegrationRequestOrigin as d1, type IntegrationOriginPolicy as d2, type IntegrationOriginRejection as d3, type IntegrationOriginResult as d4, type FarmIntegrationOrmSchema as d5, type FarmIntegrationOrmClient as d6, type InferFarmIntegrationOrmField as d7, type InferFarmIntegrationOrmFields as d8, type InferFarmIntegrationOrmSchema as d9, type RateLimitStatus as dA, type MemoryRateLimitStorageOptions as dB, type NextFunction as dC, type MiddlewareResult as dD, type FarmRouteRuleRenderMode as dE, type FarmRouteRuleRedirect as dF, type FarmRouteRuleCors as dG, type FarmRouteRule as dH, type FarmRouteRules as dI, normalizeRouteRules as dJ, routeRulesToRedirects as dK, routeRulesToHeaders as dL, routeRulesToNitroRouteRules as dM, type FarmRouteRuntimeEntryKind as dN, type FarmRouteRenderingMode as dO, type FarmRouteRuntimeManifestEntry as dP, type FarmRouteRuntimeManifest as dQ, normalizeFarmRouteRuntimeConfig as dR, mergeFarmRouteRuntimeConfigs as dS, resolveFarmRouteRuntimeConfig as dT, hasFarmRouteRuntimeControls as dU, getFarmRouteRuntimeConfig as dV, createFarmRouteRuntimeKey as dW, resolveFarmRouteRuleRuntimeConfig as dX, farmRouteRuleMatches as dY, DEFAULT_FARM_DEVTOOLS_SHORTCUT as dZ, FARM_DEVTOOLS_PATH as d_, type InferFarmIntegrationOrmClient as da, type CreateIntegrationOrmOptions as db, createIntegrationOrm as dc, resolveIntegrationOrmRuntimeClient as dd, farmIntegrationSchemaToOrmSchema as de, type IntegrationOrmModelNames as df, DEFAULT_FARM_API_BASE_PATH as dg, type FarmAPIConfigResolverContext as dh, type FarmAPIConfigValue as di, type FarmAPIConfig as dj, resolveFarmAPIConfig as dk, normalizeFarmAPIConfig as dl, normalizeFarmAPIBasePath as dm, getFarmAPIBaseURL as dn, resolveFarmAPIRequestURL as dp, type MiddlewareFunction as dq, type RequestMiddleware as dr, type RequestMiddlewareContext as ds, type MiddlewareStore as dt, type MiddlewareChain as du, type CookieJar as dv, type CookieOptions as dw, type RateLimitConfig as dx, type RateLimitIncrementResult as dy, type RateLimitStorage as dz, type FarmAppContext as e, type FarmDevtoolsConfig as e0, type FarmDevtoolsUserConfig as e1, resolveFarmDevtoolsConfig as e2, type FarmBuildActivityPosition as e3, type FarmDevIndicatorsConfig as e4, resolveFarmDevIndicatorsConfig as e5, generateFarmDevIndicatorsClientRuntime as e6, farmI18nClientBridgePlugin as e7, withFarmRequestTracing as e8, rewriteEarlySsrRelativeImports as e9, transformIsolatedClientBoundaryModule as ea, shouldEmitFarmClientRootHmr as eb, generateClientCachePersistenceCode as ec, resolveFarmClientCacheAdapterEntry as ed, type ClientCachePersistenceEntryCode as ee, FARM_NODE_RESPONSE_END_PENDING as ef, type PageProps as f, type PluginContextProps as g, type RouteModule as h, type FarmMdxComponents as i, type FarmMdxResolvedConfig as j, type FarmMdxComponent as k, type FarmMdxUserConfig as l, type FarmUserConfig as m, type FarmContextFactory as n, type MiddlewareProps as o, type FarmIntegration as p, type FarmConfig as q, resolveMdxConfig as r, farmPlugin as s, defineConfig as t, type FarmComponentType as u, type PageRouteParams as v, type FarmMigrationCommand as w, type FarmMigrationsConfig as x, type FarmMigrationsUserConfig as y, type ResolvedFarmMigrationsConfig as z };