/**
 * Three-layer config resolution engine: builtin → server → project.
 *
 * Merges config items from embedded builtins, the server-level (default
 * project's config stores), and an optional project-level layer. Each
 * returned item carries an `origin` tag and an optional `overrides` field
 * indicating which lower layer it shadows.
 */
import type { Role, GrantPolicy } from "./role-store.js";
import type { Workflow } from "./workflow-store.js";
import type { ToolInfo } from "./tool-manager.js";
import type { BuiltinConfigProvider } from "./builtin-config.js";
import type { ProjectContextManager } from "./project-context-manager.js";
export type ConfigOrigin = "builtin" | "server" | "project";
export interface ResolvedItem<T> {
    item: T;
    origin: ConfigOrigin;
    /** Which layer this item shadows, if any. */
    overrides?: ConfigOrigin;
}
export interface ResolvedPolicy {
    policy: GrantPolicy;
    origin: ConfigOrigin;
    overrides?: ConfigOrigin;
}
/**
 * Explicit server-level store accessors.
 *
 * These wire the cascade's server layer to the standalone server stores
 * (backed by <server-cwd>/.bobbit/config/), independent of any project.
 * Zero-project installs still resolve system-scope config this way.
 */
export interface ServerStores {
    getRoles(): Role[];
    getTools(): ToolInfo[];
    getToolGroupPolicies(): Record<string, GrantPolicy>;
}
export declare class ConfigCascade {
    private builtins;
    private serverStores;
    private projectContextManager;
    constructor(builtins: BuiltinConfigProvider, serverStores: ServerStores, projectContextManager: ProjectContextManager);
    resolveRoles(projectId?: string): ResolvedItem<Role>[];
    resolveWorkflows(projectId?: string): ResolvedItem<Workflow>[];
    resolveTools(projectId?: string): ResolvedItem<ToolInfo>[];
    resolveToolGroupPolicies(projectId?: string): Record<string, ResolvedPolicy>;
    /**
     * Merge three layers of config items by a unique key.
     *
     * 1. Builtins (origin "builtin")
     * 2. Server-level = standalone server stores (origin "server")
     * 3. Project-level = specified project's store, if a projectId was given (origin "project")
     *
     * Later layers shadow earlier ones. The `overrides` field records what was shadowed.
     */
    private resolve;
}
//# sourceMappingURL=config-cascade.d.ts.map