import { BosConfig, BosConfigInput, BosPluginRef } from "../../types.cjs";
import { AppDescriptor } from "../../descriptor/schema.cjs";
import { BosEnv } from "./merge.cjs";
import { Schema } from "effect";
//#region src/services/resolution/load.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";
/**
 * @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 resolveConfigComposableEntries(config: BosConfig, baseDir: string, env: BosEnv): Promise<BosConfig>;
/**
 * @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>;
//#endregion
export { CircularExtendsError, ConfigExtendsError, ConfigLoadError, ConfigNotfoundError, ConfigVersionManifestError, DEV_OVERLAY_FILENAME, DevOverlayError, LOCAL_PREFIX, MISSING_CONFIG_MESSAGE, ResolvedComposableReference, defaultConfigEnv, findConfigPath, getConfigBaseDir, isAppDescriptorPath, loadAppDescriptorConfig, localConfigEntryPath, parseAppDescriptorModule, parseDevOverlayModule, parseExtendsTarget, readAuthoredConfigInput, readLocalAuthoredConfigInput, resetConfigPathCache, resolveComposableReference, resolveConfigComposableEntries, runWithConfigWarningSink };
//# sourceMappingURL=load.d.cts.map