/** Classification of capability types. */
import type { DocBlock } from '../docs/types';
import type { OwnerShipMeta } from '../ownership';
import type { VersionedSpecRef } from '../versioning';
export type CapabilityKind = 'api' | 'event' | 'data' | 'ui' | 'integration';
/** Surfaces where capabilities can be exposed or consumed. */
export type CapabilitySurface = 'operation' | 'event' | 'workflow' | 'presentation' | 'resource';
/**
 * Reference to a capability on a specific surface.
 * Extends VersionedSpecRef with surface and description context.
 */
export interface CapabilitySurfaceRef {
    /** The surface type where this capability is exposed. */
    surface: CapabilitySurface;
    /** Unique key identifying the spec on that surface (e.g., operation key). */
    key: string;
    /** Semantic version of the spec on that surface. */
    version?: string;
    /** Optional description of what this capability provides. */
    description?: string;
}
/** Metadata for a capability spec, extending ownership with kind. */
export interface CapabilityMeta extends OwnerShipMeta {
    /** The kind/category of this capability. */
    kind: CapabilityKind;
}
/**
 * Requirement for a capability dependency.
 * Used to declare what capabilities a spec needs.
 */
export interface CapabilityRequirement {
    /** Unique key of the required capability. */
    key: string;
    /** Optional specific version required. */
    version?: string;
    /** Optional kind filter for the requirement. */
    kind?: CapabilityKind;
    /** If true, the requirement is optional and won't block if missing. */
    optional?: boolean;
    /** Human-readable reason why this capability is required. */
    reason?: string;
}
/**
 * Reference to a capability spec.
 * Uses key and version to identify a specific capability.
 */
export type CapabilityRef = VersionedSpecRef;
export interface CapabilitySpec {
    meta: CapabilityMeta;
    /** Capabilities this capability extends (inherits requirements from). */
    extends?: CapabilityRef;
    /** Surfaces (operations, events, presentations, etc.) this capability provides. */
    provides?: CapabilitySurfaceRef[];
    /** Capabilities that must be present for this capability to function. */
    requires?: CapabilityRequirement[];
}
export declare class CapabilityRegistry {
    private readonly items;
    /** Reverse index: surface key -> capability key (built lazily) */
    private surfaceIndex;
    register(spec: CapabilitySpec): this;
    list(): CapabilitySpec[];
    get(key: string, version?: string): CapabilitySpec | undefined;
    satisfies(requirement: CapabilityRequirement, additional?: CapabilityRef[] | undefined): boolean;
    /** Build reverse index from surface specs to capabilities. */
    private buildSurfaceIndex;
    /** Get all operation keys provided by a capability. */
    getOperationsFor(capabilityKey: string, version?: string): string[];
    /** Get all event keys provided by a capability. */
    getEventsFor(capabilityKey: string, version?: string): string[];
    /** Get all presentation keys provided by a capability. */
    getPresentationsFor(capabilityKey: string, version?: string): string[];
    /** Get all workflow keys provided by a capability. */
    getWorkflowsFor(capabilityKey: string, version?: string): string[];
    /** Get all resource keys provided by a capability. */
    getResourcesFor(capabilityKey: string, version?: string): string[];
    /** Get capability refs that provide a specific operation. */
    getCapabilitiesForOperation(operationKey: string): CapabilityRef[];
    /** Get capability refs that provide a specific event. */
    getCapabilitiesForEvent(eventKey: string): CapabilityRef[];
    /** Get capability refs that provide a specific presentation. */
    getCapabilitiesForPresentation(presentationKey: string): CapabilityRef[];
    /** Get the ancestor chain for a capability (from immediate parent to root). */
    getAncestors(capabilityKey: string, version?: string): CapabilitySpec[];
    /**
     * Get effective requirements for a capability, including inherited ones.
     * Requirements from ancestors are included, with child requirements taking
     * precedence over parent requirements for the same key.
     */
    getEffectiveRequirements(capabilityKey: string, version?: string): CapabilityRequirement[];
    /**
     * Get all surfaces provided by a capability, including inherited ones.
     */
    getEffectiveSurfaces(capabilityKey: string, version?: string): CapabilitySurfaceRef[];
}
export declare function capabilityKey(spec: CapabilitySpec): string;
export declare function defineCapability(spec: CapabilitySpec): CapabilitySpec;
export declare const tech_contracts_capabilities_DocBlocks: DocBlock[];
