/**
 * Registry Type Definitions
 *
 * Types for interacting with the SpecVerse Registry API for instance factory metadata.
 *
 * @module registry/types/registry
 * @version 2.0.0
 */
/**
 * Type guard to check if source is npm
 */
export function isNpmSource(source) {
    return source.type === 'npm' && typeof source.package === 'string' && typeof source.version === 'string';
}
/**
 * Type guard to check if source is git
 */
export function isGitSource(source) {
    return source.type === 'git' && typeof source.url === 'string';
}
/**
 * Type guard to check if source is URL
 */
export function isUrlSource(source) {
    return source.type === 'url' && typeof source.url === 'string';
}
/**
 * Type guard to check if factory is deprecated
 */
export function isDeprecated(factory) {
    return factory.deprecated === true;
}
/**
 * Helper to get npm install command for a factory
 */
export function getInstallCommand(factory) {
    if (isNpmSource(factory.source)) {
        return `npm install ${factory.source.package}@${factory.source.version}`;
    }
    return null;
}
/**
 * Helper to check if factory provides a specific capability
 */
export function providesCapability(factory, capability) {
    return factory.capabilities.includes(capability);
}
/**
 * Helper to check if factory supports a specific framework
 */
export function supportsFramework(factory, framework) {
    // Framework-agnostic factories (null) support all frameworks
    return factory.framework === null || factory.framework === framework;
}
//# sourceMappingURL=registry.js.map