import { DEFAULT_SITE_PROFILE, DOMAIN_CONFIG, SITE_PROFILES, getDomainConfig } from "./sites.js"; import type { ProfileCategory, ProfileResolutionResult, ResolvedSiteProfile } from "../types/index.js"; export { DEFAULT_SITE_PROFILE, DOMAIN_CONFIG, SITE_PROFILES, getDomainConfig }; /** * Resolves a named profile from SITE_PROFILES, handling inheritance and merging with the default profile to ensure all required properties are present. Inheritance * is resolved recursively, with child profile properties overriding parent properties. * * The resolution process: * * 1. Start with a copy of DEFAULT_SITE_PROFILE * 2. If the profile extends another, recursively resolve the parent and merge its properties * 3. Merge the current profile's properties, overriding any inherited values * 4. Return the fully-resolved profile with all flags set * * Metadata properties (description, extends) are stripped during resolution - they exist only for documentation and inheritance specification. * * @param profileName - The name of the profile to resolve. * @returns The merged site profile containing all behavior flags. */ export declare function resolveProfile(profileName: string | undefined): ResolvedSiteProfile; /** * Resolves the site profile for a given URL by looking it up in DOMAIN_CONFIG via getDomainConfig(), which tries the full hostname first for subdomain-specific * overrides before falling back to the concise domain. Falls back to the default profile if no matching domain is found or the matching domain has no profile * configured. * @param url - The URL to resolve a profile for. * @returns The site profile containing behavior flags. */ export declare function getProfileForUrl(url: string | undefined): ProfileResolutionResult; /** * Resolves the site profile for a channel. Channels can explicitly declare their profile by name, which takes precedence over URL-based detection. This is useful * when: * - A channel's URL domain doesn't match the expected behavior pattern * - The same domain serves multiple channel types needing different handling * - A channel needs a custom combination of flags not covered by existing profiles * * The special value "auto" triggers URL-based domain detection, equivalent to omitting the profile property. This allows channels to explicitly opt into domain * detection rather than relying on the implicit behavior of an absent property. * * Channel-specific properties like channelSelector are merged into the resolved profile, allowing channels to extend profiles with additional configuration. * * @param channel - The channel object with url and optional profile properties. * @returns The site profile containing behavior flags. */ export declare function getProfileForChannel(channel: { channelSelector?: string; profile?: string; scrollSelector?: string; scrollTarget?: string; scrollToBottom?: boolean; url?: string; } | undefined): ProfileResolutionResult; /** * Validates all profile configurations including inheritance chains, domain mappings, and channel references. Throws an error if any validation fails. This * function runs at startup before the server begins accepting connections. * * Validation checks: * * 1. Circular inheritance detection - walks the extends chain for each profile to detect cycles * 2. Invalid extends references - ensures all extends targets exist * 3. Domain mapping validation - ensures all domain profile references exist * 4. Channel profile validation - ensures all channel profile references exist * * @throws If any profile configuration is invalid. */ export declare function validateProfiles(): void; /** * Profile information for UI display, including name, description, category, and summary. */ export interface ProfileInfo { category: ProfileCategory; description: string; name: string; source: "builtin" | "user"; summary: string; } /** * Returns all profiles (built-in and user-defined) with their descriptions, categories, summaries, and source tags, sorted alphabetically by name. Used by the * channel configuration UI to populate the profile dropdown with tooltips and the profile reference section. * @returns Array of profile info objects. */ export declare function getProfiles(): ProfileInfo[];