import { Result } from "better-result"; import { type ComputeFramework } from "./types.ts"; export interface ComputeDeployTargetBuild { /** Build command, null to skip the build step, undefined when not configured. */ command: string | null | undefined; /** Normalized output path relative to the app root, undefined when not configured. */ outputDirectory: string | undefined; } export interface ComputeDeployTarget { /** `apps` map key, or null for a single-app `app` config. */ key: string | null; name: string | null; /** Normalized app directory relative to the config file, or null for the config directory. */ root: string | null; framework: ComputeFramework | null; entry: string | null; httpPort: number | null; /** Env inputs in deploy order: dotenv file paths first, then NAME=VALUE assignments. */ envInputs: string[]; /** Build settings; non-null means the config owns build configuration. */ build: ComputeDeployTargetBuild | null; } export interface LoadedComputeConfig { configPath: string; /** Directory containing the config file. Config-relative paths resolve from here. */ configDir: string; relativeConfigPath: string; kind: "single" | "multi"; targets: ComputeDeployTarget[]; } declare const ComputeConfigInvalidError_base: import("better-result").TaggedErrorClass<"ComputeConfigInvalidError", { message: string; configPath: string; issues: string[]; }>; export declare class ComputeConfigInvalidError extends ComputeConfigInvalidError_base { constructor(configPath: string, issues: string[]); } declare const ComputeConfigTargetRequiredError_base: import("better-result").TaggedErrorClass<"ComputeConfigTargetRequiredError", { message: string; configPath: string; availableTargets: string[]; }>; export declare class ComputeConfigTargetRequiredError extends ComputeConfigTargetRequiredError_base { constructor(configPath: string, availableTargets: string[]); } declare const ComputeConfigTargetUnknownError_base: import("better-result").TaggedErrorClass<"ComputeConfigTargetUnknownError", { message: string; configPath: string; requestedTarget: string; availableTargets: string[]; }>; export declare class ComputeConfigTargetUnknownError extends ComputeConfigTargetUnknownError_base { constructor(configPath: string, requestedTarget: string, availableTargets: string[]); } export type ComputeConfigTargetError = ComputeConfigTargetRequiredError | ComputeConfigTargetUnknownError; /** * Validates and normalizes a config module's default export. Reports every * issue at once so authors fix the file in one pass. */ export declare function normalizeComputeConfig(exported: unknown, configPath: string): Result; /** Absolute app directory of a config target. */ export declare function computeTargetAppDir(config: LoadedComputeConfig, target: ComputeDeployTarget): string; /** * Selects a deploy target. Single-app configs return their app (a requested * target must then match the configured `name`); multi-app configs require a * matching key unless they hold exactly one target. */ export declare function selectComputeDeployTarget(config: LoadedComputeConfig, requestedTarget: string | undefined): Result; /** * Infers the deploy target whose app directory contains `cwd`, so commands * run from inside a target's root select it without a target argument. The * deepest matching root wins; an ambiguous tie infers nothing. */ export declare function inferComputeTargetFromCwd(config: LoadedComputeConfig, cwd: string): string | undefined; export {}; //# sourceMappingURL=normalize.d.ts.map