/** Metadata for a published spec in the registry. */
export interface RegistrySpecMeta {
    /** Unique name in org/name format. */
    name: string;
    /** Organization or user that published the spec. */
    org: string;
    /** Semver version string. */
    version: string;
    /** Short description of what the spec does. */
    description: string;
    /** Category ID from registry-categories.json. */
    category: string;
    /** Technology stack tags (e.g. ["next.js", "prisma"]). */
    stack: string[];
    /** Difficulty level 1-5. */
    difficulty: number;
    /** Estimated implementation hours. */
    estimatedHours: number;
    /** Searchable tags. */
    tags: string[];
    /** Total download count. */
    downloads: number;
    /** Average rating (0-5). */
    rating: number;
    /** Number of ratings received. */
    ratingCount: number;
    /** ISO 8601 creation timestamp. */
    createdAt: string;
    /** ISO 8601 last update timestamp. */
    updatedAt: string;
    /** Whether this spec is deprecated. */
    deprecated?: boolean;
    /** Message explaining why the spec was deprecated. */
    deprecationMessage?: string;
}
/** A single item in search results, extends meta with completeness score. */
export interface RegistrySearchItem extends RegistrySpecMeta {
    /** Completeness score 0-100 based on spec quality metrics. */
    completenessScore: number;
}
/** Paginated search result from the registry. */
export interface RegistrySearchResult {
    /** Array of matching specs. */
    data: RegistrySearchItem[];
    /** Pagination metadata. */
    meta: {
        page: number;
        limit: number;
        total: number;
    };
}
/** Result of installing a spec from the registry. */
export interface RegistryInstallResult {
    /** Local spec ID assigned after install. */
    specId: string;
    /** Slug used for the local spec directory. */
    slug: string;
    /** Absolute path to the installed spec directory. */
    specDir: string;
    /** Source identifier (org/name). */
    source: string;
    /** Installed version. */
    version: string;
    /** Whether stack adaptation was applied. */
    adapted: boolean;
    /** Number of file adaptations applied (present when adapted is true). */
    adaptations?: number;
}
/** Result of publishing a spec to the registry. */
export interface RegistryPublishResult {
    /** Whether the publish succeeded. */
    success: boolean;
    /** Organization the spec was published under. */
    org: string;
    /** Spec name in the registry. */
    name: string;
    /** Published version. */
    version: string;
    /** URL to view the published spec. */
    url: string;
}
/** Stored credentials for registry authentication. */
export interface RegistryCredentials {
    /** API token for registry access. */
    token: string;
    /** Username associated with the token. */
    user: string;
    /** Email associated with the account. */
    email: string;
    /** License plan level. */
    plan: 'free' | 'pro';
    /** ISO 8601 token expiration timestamp. */
    expiresAt: string;
}
/** Shape of the planu-registry.json manifest file included in published specs. */
export interface RegistryPackageManifest {
    /** Spec name (without org prefix). */
    name: string;
    /** Organization or user. */
    org: string;
    /** Semver version. */
    version: string;
    /** Short description. */
    description: string;
    /** Category ID. */
    category: string;
    /** Technology stack tags. */
    stack: string[];
    /** Difficulty level 1-5. */
    difficulty: number;
    /** Estimated implementation hours. */
    estimatedHours: number;
    /** Searchable tags. */
    tags: string[];
    /** Stack-specific adaptations: { marker: { targetValue: replacement } }. */
    adaptable?: Record<string, Record<string, string>>;
}
/** Filters for searching the registry. */
export interface RegistrySearchFilters {
    /** Free-text search query. */
    query?: string;
    /** Filter by stack (e.g. "next.js"). */
    stack?: string;
    /** Filter by category ID. */
    category?: string;
    /** Filter by difficulty range. */
    difficulty?: {
        min?: number;
        max?: number;
    };
    /** Sort order for results. */
    sort?: 'downloads' | 'rating' | 'recent';
    /** Page number (1-based). */
    page?: number;
    /** Results per page. */
    limit?: number;
}
/** Result of detecting the project's technology stack. */
export interface StackDetectionResult {
    /** Primary programming language. */
    language: string;
    /** Primary framework. */
    framework: string;
    /** ORM or database library, if detected. */
    orm?: string;
    /** Test runner, if detected. */
    testRunner?: string;
    /** Build tool, if detected. */
    buildTool?: string;
    /** Package manager, if detected. */
    packageManager?: string;
}
/** Options for creating a registry API client. */
export interface RegistryClientOptions {
    token?: string;
    baseUrl?: string;
}
/** Registry API client interface returned by createRegistryClient. */
export interface RegistryClient {
    searchSpecs(filters: RegistrySearchFilters): Promise<RegistrySearchResult>;
    getSpec(org: string, name: string, version?: string): Promise<RegistrySpecMeta>;
    downloadSpec(org: string, name: string, version: string): Promise<Buffer>;
    publishSpec(tarball: Buffer, meta: Record<string, unknown>): Promise<RegistryPublishResult>;
    rateSpec(org: string, name: string, rating: number): Promise<void>;
}
/** Internal archive format: JSON with file contents keyed by relative path. */
export interface SpecArchive {
    files: Record<string, string>;
}
/** A single file adaptation applied during spec install. */
export interface StackAdaptation {
    /** File path relative to spec directory. */
    file: string;
    /** Original content before adaptation. */
    original: string;
    /** Adapted content after stack replacement. */
    adapted: string;
    /** Adaptation marker that was matched. */
    marker?: string;
}
/** Breakdown of a spec's completeness score by category. */
export interface ScoreBreakdown {
    /** Score for acceptance criteria (0-20). */
    acceptanceCriteria: number;
    /** Score for risk documentation (0-15). */
    risksDocumented: number;
    /** Score for testing strategy (0-15). */
    testingStrategy: number;
    /** Score for key files listing (0-15). */
    keyFiles: number;
    /** Score for technical.md completeness (0-20). */
    technicalCompleteness: number;
    /** Score for frontmatter fields (0-15). */
    frontmatterFields: number;
}
//# sourceMappingURL=spec-registry.d.ts.map