import { r as ClientOptions, g as APIResult } from './api-client-C1YzJu3J.js'; export { t as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, v as ApiClients, J as ClientHeaders, K as ClientLifecycleHooks, L as ClientRequestEvent, M as ClientResponseEvent, a7 as InferIntegrationOperationBody, a8 as InferIntegrationOperationQuery, a9 as InferIntegrationOperationResponse, a3 as IntegrationAPI, _ as IntegrationClient, $ as IntegrationClientAliases, a5 as IntegrationClientData, P as IntegrationClientError, a1 as IntegrationClientOptions, a2 as IntegrationClientRequestOptions, a0 as IntegrationClientRoot, a4 as IntegrationClients, a6 as IntegrationOperationResult, aa as IntegrationServerClient, ab as IntegrationServerClientAliases, ac as IntegrationServerClientOptions, ad as IntegrationServerClientRequestOptions, ae as IntegrationServerClientRoot, af as IntegrationServerRequestLike, s as RouteAPIClient, u as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, x as createAPIClient, w as createApiClients, Q as createIntegrationApi, N as createIntegrationClient, T as createIntegrationClients, V as createIntegrationServerClient, U as createIntegrations, B as createServerAPIClient, W as getIntegrationAPIManifest, X as integrationClients, Y as integrationsClient, Z as integrationsServer } from './api-client-C1YzJu3J.js'; export { y as FarmAPIStream } from './route-CZkTBD-s.js'; import React__default, { ComponentType, FormHTMLAttributes, FormEvent, AnchorHTMLAttributes, RefObject } from 'react'; export { RouteActionTarget, UseActionFormProps, UseActionReturn, UseServerFnOptions, useAction } from './server-fn-client.js'; export { UseServerQueryOptions, UseServerQueryResult, useServerQuery } from './server-query-client.js'; export { a as FarmClientCacheEntry, b as FarmClientCacheKey, F as FarmClientCacheStatus, g as getFarmClientDataCache, n as normalizeFarmClientCacheKey } from './client-cache-BwNdIy9R.js'; export { F as FarmIntegrationAPI, c as FarmIntegrationAPIBodyFormat, e as FarmIntegrationAPIMethod, f as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, a as api, d as defineIntegrationAPI, b as defineIntegrationAPIOperation, i as endpoint } from './integration-api-BbaiokCC.js'; export { UseThemeResult, useTheme } from './theme/client.js'; import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.js'; import { i as FarmViewTransitionMode, e as FarmNavigationBlockerContext, F as FarmNavigationState } from './spa-router-CqSJjuIQ.js'; export { a as FarmNavigateOptions, d as FarmNavigationBlocker, f as FarmNavigationListener, h as FarmNavigationLocation, S as SPARouter, g as getRouter, n as navigateTo, p as prefetch, b as pushState, r as readPageState, c as replaceState } from './spa-router-CqSJjuIQ.js'; import { b as FarmI18nLocale } from './types-CnH8DOqo.js'; export { F as FarmChunkRecoveryOptions, i as installChunkErrorRecovery, a as isChunkLoadError } from './chunk-recovery-lnQFzcQP.js'; export { a as FarmClientHydrationCompleteEvent, b as FarmClientHydrationEvent, d as FarmClientHydrationMode, e as FarmClientHydrationSession, f as FarmClientLocation, g as FarmClientNavigationAction, h as FarmClientNavigationErrorEvent, i as FarmClientNavigationEvent, j as FarmClientNavigationLoadedEvent, k as FarmClientNavigationResolvedEvent, l as FarmClientNavigationSession, m as FarmClientPerformanceEvent, n as FarmClientPlugin, o as FarmClientPluginCloseEvent, p as FarmClientPluginEnforce, q as FarmClientPluginErrorEvent, r as FarmClientPluginErrorPhase, F as FarmClientPluginManager, s as FarmClientPluginManagerOptions, t as FarmClientPluginMetadata, u as FarmClientPluginRegistration, v as FarmClientPluginRouter, w as FarmClientPluginSetupEvent, x as FarmClientPluginStateEvent, c as createClientPluginManager } from './lifecycle-De0vQG45.js'; export { S as ServerQueryFetchOptions, f as fetchServerQuery, p as prefetchServerQuery } from './server-query-runtime-DXRNhX_3.js'; export { getTheme, setTheme, toggleTheme } from './theme/runtime.js'; import './cache.js'; import './server-fn.js'; import './server-fn-error-DDh14a0V.js'; import './server-query.js'; import './types-DQnyD3VD.js'; import './client-plugins-IR4yJ6w3.js'; import './renderer.js'; import 'http'; import './types-Cc8l9IqS.js'; import 'db0'; import 'unstorage'; import './schema.js'; import '@farming-labs/orm'; import './types-CKwggz9n.js'; import '@farming-labs/docs'; import './markdown.js'; import './observability.js'; import '@opentelemetry/api'; import 'vite'; import './workflows-BantWytQ.js'; import './cron.js'; import './env.js'; import './navigation-errors-Dvwpzaer.js'; import './server-action-security.js'; import 'esbuild'; import './image-config-Duob7wER.js'; import './font.js'; import './after.js'; import 'node:http'; import './island-CfGru1MO.js'; import './render-plan-CWfyp4ZG.js'; type MutationStatus = "idle" | "pending" | "success" | "error"; type AnyMutationTarget = (...args: any[]) => Promise; type InferMutationVariables = Parameters extends [] ? undefined : Parameters[0]; type InferMutationData = TTarget extends { readonly __farmRouteData: infer TData; } ? TData : Awaited>; type InferMutationError = TTarget extends { readonly __farmServerFnError: infer TError; } ? TError : TTarget extends (...args: any[]) => Promise> ? TError : Error; type MutationOptimisticContext = { variables: TVariables | undefined; current: TData | null; }; type MutationNetworkMode = "always" | "online"; type UseMutationOptions = { initialData?: TData | null; resetOnMutate?: boolean; /** * `"always"` (default) dispatches regardless of connectivity, preserving * existing behavior. `"online"` pauses a submission while the browser is * offline — including one whose dispatch failed while offline — and resumes * it on the `online` event instead of failing it. */ networkMode?: MutationNetworkMode; optimistic?: (context: MutationOptimisticContext) => TData | null | undefined; rollbackOnError?: boolean; /** * Options forwarded to generated `api.route.method` clients. * Server-function targets honor `request.retry`, key-targeted * `request.optimistic` updates, and key-targeted `request.invalidate`; * the remaining request options apply to API routes only. */ request?: ClientOptions; onSuccess?: (data: TData, variables: TVariables | undefined) => void; onError?: (error: TError, variables: TVariables | undefined) => void; onSettled?: (data: TData | null, error: TError | null, variables: TVariables | undefined) => void; }; type MutationInput = InferMutationVariables; type MutationData = InferMutationData; type MutationError = InferMutationError; type MutationAsync> = [ ] extends Parameters ? (variables?: MutationInput) => Promise : (variables: MutationInput) => Promise; type MutationTrigger = [ ] extends Parameters ? (variables?: MutationInput) => void : (variables: MutationInput) => void; type UseMutationReturn, TError = MutationError> = { pending: boolean; /** True while a submission is waiting for the browser to come back online. */ paused: boolean; status: MutationStatus; data: TData | null; error: TError | null; variables: MutationInput | undefined; mutate: MutationTrigger; mutateAsync: MutationAsync; reset: () => void; }; /** * Track a generated API route mutation or a Farm server function with one * React lifecycle. * * API routes keep using their existing fetch transport and request options. * Server functions keep using their configured server-function transport. */ declare function useMutation(target: TTarget, options?: UseMutationOptions, MutationData, MutationError>): UseMutationReturn; type FetcherState = "idle" | "submitting"; /** Local form conversion failed before the target was called. */ declare class FetcherInputError extends Error { readonly name: "FetcherInputError"; readonly code: "input_error"; readonly status: 0; readonly data: undefined; readonly cause: unknown; constructor(cause: unknown); } type FetcherFormDataContext = { form: HTMLFormElement | null; submitter: HTMLElement | null; }; type UseFetcherOptions = Omit, InferMutationData, InferMutationError | FetcherInputError>, "request"> & { request?: UseMutationOptions, InferMutationData, InferMutationError>["request"]; /** * Convert browser FormData into the target's typed variables. * * Generated API routes preserve multipart forms and file values as a FormData * body; text-only submissions default to a JSON object (or query for GET/HEAD). * Server functions receive FormData directly. This mapper overrides defaults. */ mapFormData?: (formData: FormData, context: FetcherFormDataContext) => InferMutationVariables; }; type FetcherFormProps = Omit, "action" | "onSubmit"> & { /** * Override the native form fallback. By default server functions remain the * action and generated GET/POST API routes use their real URL. */ action?: string | ((formData: FormData) => void | Promise); onSubmit?: (event: FormEvent) => void; }; type FetcherInput = InferMutationVariables | FormData; type FetcherSubmitAsync = [ ] extends Parameters ? (input?: FetcherInput) => Promise> : (input: FetcherInput) => Promise>; type FetcherSubmit = [ ] extends Parameters ? (input?: FetcherInput) => void : (input: FetcherInput) => void; type UseFetcherReturn = { state: FetcherState; status: MutationStatus; pending: boolean; /** True while a submission is waiting for the browser to come back online. */ paused: boolean; data: InferMutationData | null; error: InferMutationError | FetcherInputError | null; variables: InferMutationVariables | undefined; formData: FormData | null; submit: FetcherSubmit; submitAsync: FetcherSubmitAsync; Form: ComponentType; reset: () => void; }; /** * Run a typed server function or generated API operation without navigating. * * `fetcher.Form` progressively keeps a server function as the native form * action, while hydration intercepts submissions into this fetcher lifecycle. */ declare function useFetcher(target: TTarget, options?: UseFetcherOptions): UseFetcherReturn; declare const FARM_CACHE_INVALIDATION_CHANNEL = "farm:cache-invalidation"; type CrossTabCacheInvalidationOptions = { /** Override the BroadcastChannel name, e.g. to isolate multiple apps on one origin. */ channelName?: string; }; /** * Bridge the cache invalidation bus across tabs of the same origin. * * Local invalidations are posted to a BroadcastChannel and applied in every * other tab through the normal invalidation path, so mounted stale queries * there refetch on their own. Only invalidation keys cross the channel, never * cached data, which keeps private and credentialed cache scoping untouched. * * Opt-in and idempotent. Returns a disposer; a no-op where BroadcastChannel * is unavailable (server rendering, older browsers). */ declare function enableCrossTabCacheInvalidation(options?: CrossTabCacheInvalidationOptions): () => void; /** * Protocol version stamped into every persisted entry. Bump when the * persisted shape changes; mismatched entries are dropped on load. */ declare const FARM_CLIENT_CACHE_PERSIST_VERSION = "1"; /** Snapshot of a confirmed cache entry as stored by an adapter. */ type PersistedEntry = { data: unknown; updatedAt: number; staleAt: number; gcAt?: number; version: string; }; /** * Storage contract for client cache persistence. Implement these callbacks * over any storage: IndexedDB, localStorage, OPFS, a native bridge. Farm owns * every policy decision (what, when, and whether to persist); the adapter is * plain keyed storage. `set` is an upsert. */ type FarmClientCacheAdapter = { keys(): Promise; get(key: string): Promise; set(key: string, entry: PersistedEntry): Promise; delete(key: string): Promise; clear(): Promise; /** Optional batch fast paths; the engine prefers them when present. */ getMany?(keys: string[]): Promise>; setMany?(entries: Array<[string, PersistedEntry]>): Promise; }; /** Key-value client shape accepted by {@link storageClientCacheAdapter}. */ type FarmClientCacheStorage = { getItem(key: string): Promise; setItem(key: string, value: T): Promise; removeItem(key: string): Promise; getKeys?(base?: string): Promise; keys?(base?: string): Promise; clear?(base?: string): Promise; }; type ClientCachePersistenceOptions = { /** * Extra version salt, typically an app build or deploy id. Entries written * under a different value are dropped on load. */ version?: string; /** Coarse additional filter on top of per-declaration `persist: true`. */ persistKey?: (key: string) => boolean; /** Debounce for write-behind flushes. */ flushDelayMs?: number; }; /** * Validate and type an adapter definition. Identity at runtime beyond shape * checking, mirroring `defineConfig`-style helpers. */ declare function defineClientCacheAdapter(adapter: FarmClientCacheAdapter): FarmClientCacheAdapter; /** * Adapt any Farm/unstorage-compatible key-value client to the client cache * adapter contract, mirroring the server's `storageCacheAdapter`. Without a * key enumeration method the adapter still persists but cannot warm-start. */ declare function storageClientCacheAdapter(storage: FarmClientCacheStorage, options?: { base?: string; }): FarmClientCacheAdapter; /** * @internal Wire an adapter to the shared client cache. Called by the * generated client entry from the `cache.client.adapter` configuration; not * part of the public API. Returns a disposer. */ declare function initPersistedClientCache(adapter: FarmClientCacheAdapter, options?: ClientCachePersistenceOptions): () => void; /** * @internal Entry point used by the generated client entries for the * `cache.client.adapter` configuration. Accepts the imported module namespace * and reports a misconfigured adapter without breaking application startup: * persistence is optional capability and must never block hydration. */ declare function initConfiguredClientCachePersistence(adapterModule: unknown, options?: ClientCachePersistenceOptions): void; /** * Remove every persisted cache entry. Call on logout or any session change so * the next visitor on this device cannot warm-start into another user's data. * Safe to call when persistence is not configured. */ declare function clearPersistedCache(): Promise; type StoreState = Record; type StoreValueUpdater = T | ((previous: T) => T); type StorePatch = Partial | ((state: T) => Partial); type StoreListener = (state: T, previousState: T) => void; type StoreKeyListener = (value: T[K], previousValue: T[K]) => void; type StoreKeysListener = (value: Pick, previousValue: Pick) => void; type FieldAccessor = { (): T[K]; get(): T[K]; set(value: StoreValueUpdater): T[K]; subscribe(listener: StoreKeyListener): () => void; }; type StoreFields = { [K in keyof T]: FieldAccessor; }; interface StoreApi { use(): T; use(key: K): T[K]; use(keys: readonly K[]): Pick; get(): T; get(key: K): T[K]; set(key: K, value: StoreValueUpdater): T[K]; set(patch: StorePatch): T; replace(nextState: T | ((state: T) => T)): T; reset(): T; subscribe(listener: StoreListener): () => void; subscribe(key: K, listener: StoreKeyListener): () => void; subscribe(keys: readonly K[], listener: StoreKeysListener): () => void; } type Store = {}> = StoreApi & StoreFields & TMethods; declare function createStore = {}>(initialState: T, extend?: (store: Store) => TMethods): Store; /** * Prefetch strategy (TanStack Router–style): * - "intent": prefetch on hover and touchstart (with prefetchDelay) * - "viewport": prefetch when link enters viewport (IntersectionObserver) * - "render": prefetch as soon as the link is mounted * - "none" | false: no prefetch */ type PrefetchBehavior = false | "intent" | "viewport" | "render" | "none"; /** @internal Legacy prefetch mode for backward compatibility */ type PrefetchLegacy = boolean | "hover" | "viewport" | "none"; /** * Augment this interface via the generated farm.d.ts so Link href is typed * without passing a generic. Defaults to string when not augmented. */ interface LinkDefaultRoute { } type DefaultRoutePath = LinkDefaultRoute extends { _: infer TRoute extends string; } ? TRoute : string; type DefaultRoutePattern = LinkDefaultRoute extends { pattern: infer TRoute extends string; } ? TRoute : DefaultRoutePath; type DefaultRouteHref = DefaultRoutePath | DefaultRoutePattern; type RouteHref = TRoute | `${TRoute}?${string}` | `${TRoute}#${string}` | `${TRoute}?${string}#${string}`; type RouteParamValue = Exclude; type RouteOptionalParamValue = FarmRouterPathParam; type RouteParams = string extends TRoute ? FarmRouterPathParams : ExtractRouteParams>; /** URI schemes recognized as typed external Link targets. Apps may augment this interface. */ interface LinkExternalUriSchemes { about: true; blob: true; data: true; file: true; ftp: true; ftps: true; geo: true; git: true; http: true; https: true; im: true; intent: true; irc: true; ircs: true; magnet: true; mailto: true; market: true; sms: true; ssh: true; tel: true; urn: true; vscode: true; webcal: true; ws: true; wss: true; } type ExternalUriScheme = Extract; type UriSchemeLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"; type UriSchemeStart = UriSchemeLetter | Uppercase; type UriSchemeCharacter = UriSchemeStart | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "+" | "-" | "."; type IsUriSchemeTail = TValue extends "" ? true : TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeCharacter ? IsUriSchemeTail : false : false; type IsUriScheme = TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeStart ? IsUriSchemeTail : false : false; type KnownExternalHref = `//${string}` | `${ExternalUriScheme}:${string}`; /** External URLs; these are never type-checked as routes. */ type ExternalHref = string extends THref ? KnownExternalHref : THref extends `//${string}` ? THref : THref extends `${infer Scheme}:${string}` ? IsUriScheme extends true ? THref : never : never; type StripRouteSuffix = TRoute extends `${infer Path}?${string}` ? StripRouteSuffix : TRoute extends `${infer Path}#${string}` ? StripRouteSuffix : TRoute; type ExtractRouteParams = Simplify & ExtractCatchAllParams & ExtractDynamicParams>; type ExtractOptionalCatchAllParams = TRoute extends `${string}[[...${infer Param}]]${infer Rest}` ? { [Key in Param]?: RouteOptionalParamValue; } & ExtractOptionalCatchAllParams : {}; type ExtractCatchAllParams = TRoute extends `${string}[...${infer Param}]${infer Rest}` ? Param extends `[...${string}` ? ExtractCatchAllParams : { [Key in Param]: RouteParamValue; } & ExtractCatchAllParams : {}; type ExtractDynamicParams = TRoute extends `${string}[${infer Param}]${infer Rest}` ? Param extends `...${string}` | `[...${string}` ? ExtractDynamicParams : { [Key in Param]: RouteParamValue; } & ExtractDynamicParams : {}; type Simplify = { [Key in keyof T]: T[Key]; } & {}; type HasRouteParams = keyof RouteParams extends never ? false : true; type RoutesWithRequiredParams = TRoute extends string ? HasRouteParams extends true ? TRoute : never : never; type LinkRouteParamsProps = string extends TRoute ? { params?: FarmRouterPathParams; } : HasRouteParams extends true ? { params: RouteParams; } : { params?: FarmRouterPathParams; }; type LinkRouteTargetProps = [RoutesWithRequiredParams] extends [ never ] ? { /** Internal route path with all params already resolved. */ href: RouteHref; params?: FarmRouterPathParams; } : TRoute extends string ? { /** Internal route path or route pattern. */ href: RouteHref; } & LinkRouteParamsProps : never; type LinkExternalTargetProps = { /** External URL; these are never type-checked as app routes. */ href: ExternalHref; params?: never; }; type LinkTargetProps = LinkExternalTargetProps | LinkRouteTargetProps; type LinkProps = Omit, "href"> & LinkTargetProps & { /** * When to prefetch. TanStack-style: "intent" (hover+touch), "viewport", "render", or "none". * Legacy: true (intent+viewport), "hover" (intent), "viewport", false/"none". */ prefetch?: PrefetchBehavior | PrefetchLegacy; /** Search params appended after route params are resolved. */ query?: FarmRouterBuildOptions["query"]; /** Hash appended after route params and search params are resolved. */ hash?: string; /** Add a trailing slash to the generated internal href. */ trailingSlash?: boolean; /** Delay in ms before intent-based prefetch (hover/touch). Default 50. */ prefetchDelay?: number; /** Replace current history entry instead of pushing */ replace?: boolean; /** Scroll to top after navigation (default: true) */ scroll?: boolean; /** Wrap this SPA navigation in a browser View Transition when supported. */ viewTransition?: FarmViewTransitionMode; /** Preserve the active locale by default, or navigate using this locale. */ locale?: FarmI18nLocale; }; type LinkComponentType = (props: LinkProps & { ref?: React__default.ForwardedRef; }) => React__default.ReactElement; declare const Link: LinkComponentType; interface UseRouterOptions { basePath?: string; routes?: FarmRouterRouteInput[]; } interface UseBlockerOptions { when: boolean | ((context: FarmNavigationBlockerContext) => boolean); message?: string; shouldBlock?: (context: FarmNavigationBlockerContext) => boolean | Promise; } interface UseBlockerReturn { active: boolean; } declare function useRouter(options?: UseRouterOptions): { push: (href: string) => void; replace: (href: string) => void; pushState: (pageState: TState, href?: string) => void; replaceState: (pageState: TState, href?: string) => void; back: () => void; forward: () => void; pathname: string; searchParams: URLSearchParams; params: Record; pageState: unknown; }; declare function usePageState(): TState | null; declare function useNavigation(): FarmNavigationState; declare function useBlocker(options: UseBlockerOptions): UseBlockerReturn; declare function useScrollRestoration(key: string): RefObject; export { type AnyMutationTarget, type ClientCachePersistenceOptions, type CrossTabCacheInvalidationOptions, type DefaultRouteHref, type DefaultRoutePath, type DefaultRoutePattern, type ExternalHref, FARM_CACHE_INVALIDATION_CHANNEL, FARM_CLIENT_CACHE_PERSIST_VERSION, type FarmClientCacheAdapter, type FarmClientCacheStorage, FarmNavigationBlockerContext, FarmNavigationState, FarmViewTransitionMode, type FetcherFormDataContext, type FetcherFormProps, FetcherInputError, type FetcherState, type FetcherSubmit, type FetcherSubmitAsync, type InferMutationData, type InferMutationError, type InferMutationVariables, Link, type LinkDefaultRoute, type LinkExternalUriSchemes, type LinkProps, type MutationAsync, type MutationNetworkMode, type MutationOptimisticContext, type MutationStatus, type MutationTrigger, type PersistedEntry, type PrefetchBehavior, type RouteHref, type RouteOptionalParamValue, type RouteParamValue, type RouteParams, type Store, type StoreApi, type StoreFields, type StoreKeyListener, type StoreKeysListener, type StoreListener, type StorePatch, type StoreState, type StoreValueUpdater, type UseBlockerOptions, type UseBlockerReturn, type UseFetcherOptions, type UseFetcherReturn, type UseMutationOptions, type UseMutationReturn, type UseRouterOptions, clearPersistedCache, createStore, defineClientCacheAdapter, enableCrossTabCacheInvalidation, initConfiguredClientCachePersistence, initPersistedClientCache, storageClientCacheAdapter, useBlocker, useFetcher, useMutation, useNavigation, usePageState, useRouter, useScrollRestoration };