/** Global registry of capability definitions, keyed by capability ID. */
const capabilityRegistry = new Map();
/** Registers a capability definition in the global registry. */
export function registerCapability(cap) {
    if (capabilityRegistry.has(cap.metadata.id)) {
        console.warn(`[CapabilityRegistry] Overwriting existing capability: ${cap.metadata.id}`);
    }
    capabilityRegistry.set(cap.metadata.id, cap);
}
/** Returns a registered capability by ID, or undefined if not found. */
export function getCapability(id) {
    return capabilityRegistry.get(id);
}
/** Returns all registered capability definitions. */
export function getAllCapabilities() {
    return Array.from(capabilityRegistry.values());
}
/** Returns serializable metadata for all registered capabilities. */
export function getAllCapabilityMetadata() {
    return Array.from(capabilityRegistry.values()).map((cap) => cap.metadata);
}
/** Returns metadata for a single capability by ID, or undefined if not found. */
export function getCapabilityMetadataById(id) {
    return capabilityRegistry.get(id)?.metadata;
}
//# sourceMappingURL=registry.js.map