import { BosConfig, BosConfigInput, BosConfigSchema, BosPluginRef, JsonValue, RuntimeConfig, RuntimePluginConfig } from "./types.cjs";
import { AppDescriptor } from "./descriptor/schema.cjs";
import { BOS_CONFIG_ORDER, BosEnv, mergeBosConfigWithExtends, rebuildOrderedConfig, resolveExtendsRef } from "./merge.cjs";
import { Effect, Schema } from "effect";
//#region src/config.d.ts
declare const LOCAL_PREFIX = "local:";
declare const MISSING_CONFIG_MESSAGE = "No config found (bos.app.ts or bos.config.json)";
declare const DEV_OVERLAY_FILENAME = "bos.dev.ts";
type RuntimeOverrideTarget = "ui" | "api" | "plugins" | `plugins.${string}`;
/**
 * @internal — runs `fn` with config warnings captured into `sink` instead of
 * the console. Plumbing for the resolution session; not part of the public
 * config surface.
 */
declare function runWithConfigWarningSink<T>(sink: string[], fn: () => T): T;
/**
 * @internal — clears the findConfigPath memo. Plumbing for tests and the
 * resolution session; not part of the public config surface.
 */
declare function resetConfigPathCache(): void;
/**
 * Reads the local authored config without resolving the extends chain or
 * touching the network — the build-surface factories (generated rsbuild
 * configs) consume it for their APP_NAME/APP_ACCOUNT defines.
 */
declare function readAuthoredConfigInput(cwd?: string): Promise<BosConfigInput | null>;
/**
 * The authored config entry inside exactly `dir` — no upward walk. Unlike
 * `findConfigPath` this never escapes the given directory, for write targets
 * and nested-local-path resolution where a parent's config must not be
 * picked up. Prefers the authored `bos.app.ts` descriptor (the canonical
 * form) over a legacy `bos.config.json`.
 */
declare function localConfigEntryPath(dir: string): string | null;
/** `localConfigEntryPath` + the form-aware read (`BosConfigInput`). */
declare function readLocalAuthoredConfigInput(dir: string): Promise<BosConfigInput | null>;
/**
 * The authored `bos.app.ts` descriptor is the canonical form — when both
 * forms coexist (e.g. a generated `bos.config.json` write-back beside the
 * authored descriptor), the authored file wins. JSON-form-only children are
 * unaffected: with no `bos.app.ts`, the JSON file is the entry.
 */
declare function findConfigPath(cwd?: string): string | null;
declare function isAppDescriptorPath(configPath: string): boolean;
/**
 * Materialize an authored bos.app.ts descriptor into the authoring-shape
 * `BosConfigInput` the config pipeline consumes. Import-extends is honored
 * two ways: the parent descriptor value can be imported directly (an
 * inlined parent, resolved through `resolveApp`), or `extends` can name a
 * published config (`bos://…`) / a local file, which flows into the JSON
 * extends chain unchanged.
 */
declare function loadAppDescriptorConfig(resolvedPath: string): Promise<BosConfigInput>;
/**
 * @internal — parses an already-imported app descriptor module into the
 * authoring-shape `BosConfigInput`. Plumbing for the resolution session's
 * injectable module loader; not part of the public config surface.
 */
declare function parseAppDescriptorModule(mod: Record<string, unknown>, sourcePath?: string): BosConfigInput;
/**
 * @internal — validates an already-imported `bos.dev.ts` module as a
 * `Partial<AppDescriptor>` dev overlay. Plumbing for the resolution session's
 * injectable module loader; not part of the public config surface.
 */
declare function parseDevOverlayModule(mod: Record<string, unknown>, sourcePath?: string): Partial<AppDescriptor>;
interface ResolvedComposableReference {
  entry: BosPluginRef;
  providerBaseDir: string;
  targetPath: string;
  associatedUi?: Record<string, unknown>;
}
interface ParsedExtendsTarget {
  configPath: string;
  targetPath?: string;
}
declare const ConfigLoadError_base: Schema.Class<ConfigLoadError, Schema.TaggedStruct<"ConfigLoadError", {
  readonly path: Schema.String;
  readonly message: Schema.String;
  readonly cause: Schema.optional<Schema.Unknown>;
}>, import("effect/Cause").YieldableError>;
declare class ConfigLoadError extends ConfigLoadError_base {}
declare const CircularExtendsError_base: Schema.Class<CircularExtendsError, Schema.TaggedStruct<"CircularExtendsError", {
  readonly chain: Schema.$Array<Schema.String>;
  readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
declare class CircularExtendsError extends CircularExtendsError_base {}
declare const ConfigNotfoundError_base: Schema.Class<ConfigNotfoundError, Schema.TaggedStruct<"ConfigNotfoundError", {
  readonly message: Schema.String;
}>, import("effect/Cause").YieldableError>;
declare class ConfigNotfoundError extends ConfigNotfoundError_base {}
declare const ConfigExtendsError_base: Schema.Class<ConfigExtendsError, Schema.TaggedStruct<"ConfigExtendsError", {
  readonly message: Schema.String;
  readonly cause: Schema.optional<Schema.Unknown>;
}>, import("effect/Cause").YieldableError>;
declare class ConfigExtendsError extends ConfigExtendsError_base {}
declare const ConfigVersionManifestError_base: Schema.Class<ConfigVersionManifestError, Schema.TaggedStruct<"ConfigVersionManifestError", {
  readonly message: Schema.String;
  readonly cause: Schema.optional<Schema.Unknown>;
}>, import("effect/Cause").YieldableError>;
declare class ConfigVersionManifestError extends ConfigVersionManifestError_base {}
declare const DevOverlayError_base: Schema.Class<DevOverlayError, Schema.TaggedStruct<"DevOverlayError", {
  readonly path: Schema.String;
  readonly message: Schema.String;
  readonly cause: Schema.optional<Schema.Unknown>;
}>, import("effect/Cause").YieldableError>;
declare class DevOverlayError extends DevOverlayError_base {}
declare function defaultConfigEnv(): BosEnv;
declare function parseRuntimeOverrideTargets(value?: string | null): RuntimeOverrideTarget[];
declare function isRuntimeOverrideAllowed(allowedTargets: ReadonlyArray<RuntimeOverrideTarget>, target: "ui" | "api" | "plugins" | `plugins.${string}`): boolean;
declare function buildRuntimePluginsForConfig(config: BosConfig, baseDir: string, env: BosEnv, remotePlugins?: string[]): Promise<Record<string, RuntimePluginConfig> | undefined>;
declare function resolveConfigComposableEntries(config: BosConfig, baseDir: string, env: BosEnv): Promise<BosConfig>;
declare function getResolvedConfigPath(configDir: string): string;
declare function loadGeneratedResolvedConfig(configDir: string): BosConfig | null;
declare function writeResolvedConfig(configDir: string, config: BosConfig, env: BosEnv, extendsChain?: string[], source?: string): void;
declare function resolveBosConfigPath(configDir: string): string;
declare function readBosConfigForBuild(configDir: string): Promise<Record<string, unknown>>;
/**
 * @internal — splits an extends ref into its config path and optional
 * `#target` suffix. Plumbing for the resolution session; not part of the
 * public config surface.
 */
declare function parseExtendsTarget(ref: string): ParsedExtendsTarget;
/**
 * @internal — resolves the base directory a config path extends from.
 * Plumbing for the resolution session; not part of the public config surface.
 */
declare function getConfigBaseDir(configPath: string, baseDir: string): string;
declare function resolveComposableReference(source: BosPluginRef, baseDir: string, env: BosEnv, defaultTargetPath: string): Promise<ResolvedComposableReference>;
interface BuildRuntimeConfigOptions {
  plugins?: Record<string, RuntimePluginConfig>;
  hostSource?: "local" | "remote";
  uiSource?: "local" | "remote";
  apiSource?: "local" | "remote";
  authSource?: "local" | "remote";
  proxy?: string;
}
declare const buildRuntimeConfigEffect: (config: {
  account: string;
  extends?: string | {
    development?: string | undefined;
    production?: string | undefined;
    staging?: string | undefined;
  } | undefined;
  domain?: string | undefined;
  title?: string | undefined;
  description?: string | undefined;
  testnet?: string | undefined;
  staging?: {
    domain: string;
    account?: string | undefined;
  } | undefined;
  repository?: string | undefined;
  publish?: {
    auth?: "custody" | "key" | "session" | undefined;
  } | undefined;
  ci?: {
    image?: string | undefined;
    railway?: {
      service: string;
    } | undefined;
  } | undefined;
  cdn?: {
    origin?: string | undefined;
  } | undefined;
  rolledBackFrom?: string | undefined;
  starter?: {
    levels?: Record<string, {
      include?: string[] | undefined;
      exclude?: string[] | undefined;
    }> | undefined;
    exclude?: string[] | undefined;
  } | undefined;
  plugins?: Record<string, string | {
    extends?: string | {
      development?: string | undefined;
      production?: string | undefined;
      staging?: string | undefined;
    } | undefined;
    name?: string | undefined;
    development?: string | undefined;
    production?: string | undefined;
    integrity?: string | undefined;
    proxy?: string | undefined;
    variables?: Record<string, JsonValue> | undefined;
    secrets?: string[] | undefined;
    routes?: string[] | undefined;
    shared?: Record<string, {
      version: string;
      requiredVersion?: string | undefined;
      singleton?: boolean | undefined;
      eager?: boolean | undefined;
      strictVersion?: boolean | undefined;
      shareScope?: string | undefined;
    }> | undefined;
    connectSrc?: string[] | undefined;
    ui?: {
      name: string;
      development?: string | undefined;
      production?: string | undefined;
      publicUrl?: string | undefined;
      integrity?: string | undefined;
      ssr?: string | undefined;
      ssrIntegrity?: string | undefined;
      pin?: {
        manifest: string;
        integrity: string;
      } | undefined;
    } | undefined;
    pin?: {
      manifest: string;
      integrity: string;
    } | undefined;
    version?: string | undefined;
    app?: Record<string, unknown> | undefined;
    plugins?: Record<string, unknown> | undefined;
    dependsOn?: string[] | undefined;
  }> | undefined;
  app: {
    host: {
      development: string;
      production?: string | undefined;
      integrity?: string | undefined;
      secrets?: string[] | undefined;
      pin?: {
        manifest: string;
        integrity: string;
      } | undefined;
    };
    ui: {
      name?: string | undefined;
      development?: string | undefined;
      production?: string | undefined;
      publicUrl?: string | undefined;
      integrity?: string | undefined;
      ssr?: string | undefined;
      ssrIntegrity?: string | undefined;
      pin?: {
        manifest: string;
        integrity: string;
      } | undefined;
    };
    api: {
      extends?: string | {
        development?: string | undefined;
        production?: string | undefined;
        staging?: string | undefined;
      } | undefined;
      name?: string | undefined;
      development?: string | undefined;
      production?: string | undefined;
      integrity?: string | undefined;
      proxy?: string | undefined;
      variables?: Record<string, JsonValue> | undefined;
      secrets?: string[] | undefined;
      routes?: string[] | undefined;
      shared?: Record<string, {
        version: string;
        requiredVersion?: string | undefined;
        singleton?: boolean | undefined;
        eager?: boolean | undefined;
        strictVersion?: boolean | undefined;
        shareScope?: string | undefined;
      }> | undefined;
      connectSrc?: string[] | undefined;
      ui?: {
        name: string;
        development?: string | undefined;
        production?: string | undefined;
        publicUrl?: string | undefined;
        integrity?: string | undefined;
        ssr?: string | undefined;
        ssrIntegrity?: string | undefined;
        pin?: {
          manifest: string;
          integrity: string;
        } | undefined;
      } | undefined;
      pin?: {
        manifest: string;
        integrity: string;
      } | undefined;
      dependsOn?: string[] | undefined;
    };
    auth?: {
      extends?: string | {
        development?: string | undefined;
        production?: string | undefined;
        staging?: string | undefined;
      } | undefined;
      name?: string | undefined;
      development?: string | undefined;
      production?: string | undefined;
      integrity?: string | undefined;
      proxy?: string | undefined;
      variables?: Record<string, JsonValue> | undefined;
      secrets?: string[] | undefined;
      routes?: string[] | undefined;
      shared?: Record<string, {
        version: string;
        requiredVersion?: string | undefined;
        singleton?: boolean | undefined;
        eager?: boolean | undefined;
        strictVersion?: boolean | undefined;
        shareScope?: string | undefined;
      }> | undefined;
      connectSrc?: string[] | undefined;
      ui?: {
        name: string;
        development?: string | undefined;
        production?: string | undefined;
        publicUrl?: string | undefined;
        integrity?: string | undefined;
        ssr?: string | undefined;
        ssrIntegrity?: string | undefined;
        pin?: {
          manifest: string;
          integrity: string;
        } | undefined;
      } | undefined;
      pin?: {
        manifest: string;
        integrity: string;
      } | undefined;
    } | undefined;
  };
}, baseDir: string, env: BosEnv, options?: BuildRuntimeConfigOptions | undefined) => Effect.Effect<{
  env: "development" | "production" | "staging";
  account: string;
  domain?: string | undefined;
  networkId: "mainnet" | "testnet";
  deploymentFingerprint?: string | undefined;
  title?: string | undefined;
  description?: string | undefined;
  repository?: string | undefined;
  host: {
    name: string;
    url: string;
    entry: string;
    entryUrl?: string | undefined;
    source: "local" | "remote";
    integrity?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    secrets?: string[] | undefined;
    remoteUrl?: string | undefined;
  };
  ui: {
    name: string;
    url: string;
    entry: string;
    entryUrl?: string | undefined;
    source: "local" | "remote";
    integrity?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    publicUrl?: string | undefined;
    ssrUrl?: string | undefined;
    ssrIntegrity?: string | undefined;
    ssrEntryUrl?: string | undefined;
    browserManifestUrl?: string | undefined;
    dependsOn?: string[] | undefined;
  };
  api: {
    name: string;
    url: string;
    entry: string;
    entryUrl?: string | undefined;
    source: "local" | "remote";
    integrity?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    proxy?: string | undefined;
    variables?: Record<string, JsonValue> | undefined;
    secrets?: string[] | undefined;
    shared?: Record<string, {
      version: string;
      requiredVersion?: string | undefined;
      singleton?: boolean | undefined;
      eager?: boolean | undefined;
      strictVersion?: boolean | undefined;
      shareScope?: string | undefined;
    }> | undefined;
    dependsOn?: string[] | undefined;
  };
  auth?: {
    name: string;
    url: string;
    entry: string;
    entryUrl?: string | undefined;
    source: "local" | "remote";
    integrity?: string | undefined;
    extendsRef?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    proxy?: string | undefined;
    variables?: Record<string, JsonValue> | undefined;
    secrets?: string[] | undefined;
    shared?: Record<string, {
      version: string;
      requiredVersion?: string | undefined;
      singleton?: boolean | undefined;
      eager?: boolean | undefined;
      strictVersion?: boolean | undefined;
      shareScope?: string | undefined;
    }> | undefined;
    dependsOn?: string[] | undefined;
    ui?: {
      name: string;
      url: string;
      entry: string;
      source: "local" | "remote";
      publicUrl?: string | undefined;
      localPath?: string | undefined;
      port?: number | undefined;
      integrity?: string | undefined;
      ssrUrl?: string | undefined;
      ssrIntegrity?: string | undefined;
      entryUrl?: string | undefined;
      ssrEntryUrl?: string | undefined;
      browserManifestUrl?: string | undefined;
      dependsOn?: string[] | undefined;
    } | undefined;
  } | undefined;
  plugins?: Record<string, {
    name: string;
    url: string;
    entry: string;
    source: "local" | "remote";
    extendsRef?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    proxy?: string | undefined;
    variables?: Record<string, JsonValue> | undefined;
    secrets?: string[] | undefined;
    integrity?: string | undefined;
    entryUrl?: string | undefined;
    shared?: Record<string, {
      version: string;
      requiredVersion?: string | undefined;
      singleton?: boolean | undefined;
      eager?: boolean | undefined;
      strictVersion?: boolean | undefined;
      shareScope?: string | undefined;
    }> | undefined;
    connectSrc?: string[] | undefined;
    ui?: {
      name: string;
      url: string;
      entry: string;
      source: "local" | "remote";
      publicUrl?: string | undefined;
      localPath?: string | undefined;
      port?: number | undefined;
      integrity?: string | undefined;
      ssrUrl?: string | undefined;
      ssrIntegrity?: string | undefined;
      entryUrl?: string | undefined;
      ssrEntryUrl?: string | undefined;
      browserManifestUrl?: string | undefined;
      dependsOn?: string[] | undefined;
    } | undefined;
    routes?: string[] | undefined;
    dependsOn?: string[] | undefined;
  }> | undefined;
  nodes?: Record<string, {
    key: string;
    kind: "api" | "auth" | "plugin" | "ui";
    name: string;
    url: string;
    entry: string;
    source: "local" | "remote";
    dependsOn?: string[] | undefined;
    extendsRef?: string | undefined;
    localPath?: string | undefined;
    port?: number | undefined;
    proxy?: string | undefined;
    variables?: Record<string, JsonValue> | undefined;
    secrets?: string[] | undefined;
    integrity?: string | undefined;
    shared?: Record<string, {
      version: string;
      requiredVersion?: string | undefined;
      singleton?: boolean | undefined;
      eager?: boolean | undefined;
      strictVersion?: boolean | undefined;
      shareScope?: string | undefined;
    }> | undefined;
    connectSrc?: string[] | undefined;
    ui?: {
      name: string;
      url: string;
      entry: string;
      source: "local" | "remote";
      publicUrl?: string | undefined;
      localPath?: string | undefined;
      port?: number | undefined;
      integrity?: string | undefined;
      ssrUrl?: string | undefined;
      ssrIntegrity?: string | undefined;
      entryUrl?: string | undefined;
      ssrEntryUrl?: string | undefined;
      browserManifestUrl?: string | undefined;
      dependsOn?: string[] | undefined;
    } | undefined;
    routes?: string[] | undefined;
    sourceOrigin?: "config" | "manifest" | undefined;
    singletonKey?: string | undefined;
  }> | undefined;
}, ConfigExtendsError | ConfigVersionManifestError, never>;
declare function buildRuntimeConfig(config: BosConfig, baseDir: string, env: BosEnv, options?: BuildRuntimeConfigOptions): Promise<RuntimeConfig>;
/**
 * MF container identity must match the build: folder-form plugin ui sources
 * build under the sanitized plugin workspace package name (the generated
 * rsbuild config imports the plugin's package.json), so derive the same
 * value here — an authored `ui.name` is only a fallback, and can never
 * override what the container actually registers under.
 */
declare function resolveUiRuntimeName(uiConfig: Record<string, unknown> | undefined, localPath: string | undefined, apiName: string): string;
declare function resolvePluginRuntimeName(explicitName: string | undefined, localPath: string | undefined, fallback: string): string;
declare function isLocalDevelopmentTarget(value: string | undefined): value is `${typeof LOCAL_PREFIX}${string}`;
declare function resolveLocalDevelopmentPath(value: string | undefined, baseDir: string): string | null;
declare function resolveDevelopmentHostUrl(value: string | undefined): string;
declare function getHostDevelopmentPort(value: string | undefined): number;
declare function parsePort(url: string): number;
//#endregion
export { BOS_CONFIG_ORDER, type BosConfig, BosConfigSchema, type BosEnv, BuildRuntimeConfigOptions, CircularExtendsError, ConfigExtendsError, ConfigLoadError, ConfigNotfoundError, ConfigVersionManifestError, DEV_OVERLAY_FILENAME, DevOverlayError, MISSING_CONFIG_MESSAGE, ResolvedComposableReference, type RuntimeConfig, buildRuntimeConfig, buildRuntimeConfigEffect, buildRuntimePluginsForConfig, defaultConfigEnv, findConfigPath, getConfigBaseDir, getHostDevelopmentPort, getResolvedConfigPath, isAppDescriptorPath, isLocalDevelopmentTarget, isRuntimeOverrideAllowed, loadAppDescriptorConfig, loadGeneratedResolvedConfig, localConfigEntryPath, mergeBosConfigWithExtends, parseAppDescriptorModule, parseDevOverlayModule, parseExtendsTarget, parsePort, parseRuntimeOverrideTargets, readAuthoredConfigInput, readBosConfigForBuild, readLocalAuthoredConfigInput, rebuildOrderedConfig, resetConfigPathCache, resolveBosConfigPath, resolveComposableReference, resolveConfigComposableEntries, resolveDevelopmentHostUrl, resolveExtendsRef, resolveLocalDevelopmentPath, resolvePluginRuntimeName, resolveUiRuntimeName, runWithConfigWarningSink, writeResolvedConfig };
//# sourceMappingURL=config.d.cts.map