/**
 * Graph Federation (ADR-031 Phase 4)
 *
 * Supports splitting the monolithic ecosystem.graph.json into per-capability
 * fragment files under docs/ecosystem.fragments/. The loader detects the
 * graph format and uses either monolithic or federated loading.
 *
 * Fragment format: Each file declares a single capability with an owner field.
 * Root graph in v2.0 format contains metadata, stages, compositions, and
 * a fragments_dir pointer instead of inline capabilities.
 */
import type { StageName } from './graph-loader.js';
import type { AgentInput } from './weighted-resolver.js';
import type { CompositionRule } from './composition-engine.js';
export interface CapabilityFragment {
    readonly capability: string;
    readonly description?: string;
    readonly owner?: string;
    readonly repos: readonly string[];
    readonly agents: readonly AgentInput[];
    readonly stage?: StageName;
    readonly depends_on?: readonly string[];
    readonly tags?: readonly string[];
}
export interface FederatedRootGraph {
    readonly version: string;
    readonly description?: string;
    readonly stages?: readonly StageName[];
    readonly fragments_dir: string;
    readonly compositions?: readonly CompositionRule[];
    readonly overrides?: Readonly<Record<string, FragmentOverride>>;
}
export interface FragmentOverride {
    readonly max_agents?: number;
    readonly stage?: StageName;
}
export interface FederationResult {
    readonly fragments: readonly CapabilityFragment[];
    readonly root: FederatedRootGraph;
    readonly errors: readonly string[];
    readonly warnings: readonly string[];
}
/**
 * Detect whether a parsed graph root uses federated mode (v2.0+).
 * Federated graphs have a `fragments_dir` field instead of `capabilities`.
 */
export declare function isFederatedGraph(data: Record<string, unknown>): boolean;
/**
 * Load all capability fragments from the fragments directory.
 * Returns the merged result with fragments, warnings, and errors.
 */
export declare function loadFragments(rootGraphPath: string, fragmentsDir: string): FederationResult;
/**
 * Split a monolithic graph into capability fragments.
 * Used by the `graph federate` CLI command.
 *
 * @param graphPath - Path to the monolithic ecosystem.graph.json
 * @param outputDir - Directory to write fragments to
 * @returns Summary of the federation operation
 */
export declare function federateGraph(graphPath: string, outputDir: string): {
    fragmentsCreated: number;
    rootUpdated: boolean;
    errors: string[];
};
/**
 * Convert a capability fragment back to the monolithic format.
 * Used internally by the graph loader to unify fragment and inline formats.
 */
export declare function fragmentToCapabilityEntry(fragment: CapabilityFragment): Record<string, unknown>;
//# sourceMappingURL=graph-federation.d.ts.map