/** * Wall-clock ceiling for one `nix path-info` invocation. * * `--offline` means the only unbounded wait is the store's SQLite lock held by a * concurrent nix operation. A recipe that has not resolved within this is not * going to; failing here surfaces `RecipeUnavailableError` to the requester * instead of stalling session build indefinitely. */ export declare const DEFAULT_NIX_TIMEOUT_MS = 30000; /** Env override for {@link DEFAULT_NIX_TIMEOUT_MS}, in milliseconds. */ export declare const NIX_TIMEOUT_ENV_VAR = "SKAILE_NIX_TIMEOUT_MS"; export declare class RecipeUnavailableError extends Error { readonly flakeRef: string; readonly attr: string; constructor(flakeRef: string, attr: string, cause?: unknown); } /** * Per-resolve-pass cache. Created fresh by each call to * `loadMcpServerDeclarations` integration so values don't go stale across * sessions but multiple recipes within one pass dedupe. */ export type RecipeResolutionCache = Map; export declare function createRecipeCache(): RecipeResolutionCache; /** Test-only: clears the (path, mtime) recipe-map memo so module-level state does not leak between cases. */ export declare function __resetRecipeMapMemoForTest(): void; /** A pluggable strategy mapping a flake/asset ref + attr to an absolute store path. */ export interface RecipeProducer { /** * Returns the resolved store path, or `null` to defer to the next producer. * A producer may instead THROW (e.g. `NixRecipeProducer` throws * `RecipeUnavailableError`) to signal a terminal failure — `resolveViaProducers` * does not catch mid-chain, so a throw skips any producers registered after it. * Put deferring producers (those that return `null` on a miss) BEFORE any * throwing producer in the chain. * * Async since #454 — every producer does I/O (a file read, a subprocess) that * must not block the event loop. */ resolve(ref: string, attr: string): Promise; readonly kind: string; } /** Content-addressed store-path map producer. Nix is one PRODUCER of this map, * not the only one. Generic; no nix knowledge. */ export declare class MapRecipeProducer implements RecipeProducer { private readonly load; readonly kind = "map"; constructor(load?: () => Promise | null>); resolve(_ref: string, attr: string): Promise; } /** Nix flake producer — locates/builds the closure via `nix path-info --offline`. */ export declare class NixRecipeProducer implements RecipeProducer { readonly kind = "nix"; resolve(ref: string, attr: string): Promise; } /** Default chain: content-addressed map first, then nix build. */ export declare function defaultRecipeProducers(): RecipeProducer[]; /** Try each producer in order; cache the first non-null by `ref#attr`. */ export declare function resolveViaProducers(ref: string, attr: string, cache: RecipeResolutionCache, producers?: RecipeProducer[]): Promise; /** * Resolves a flake attribute to its /nix/store out-path. * Throws RecipeUnavailableError on missing closure / nix failure. * * Thin back-compat wrapper over the default producer chain (map → nix). */ export declare function resolveRecipePath(flakeRef: string, attr: string, cache: RecipeResolutionCache): Promise; //# sourceMappingURL=recipe-resolver.d.ts.map