/** * License Key Validation for GitMem Pro Tier * * Detection chain: * 1. GITMEM_TIER env var (explicit override — testing/dev) * 2. api_key in config.json or GITMEM_API_KEY env var: * a. Check license-cache.json → if valid + not expired (72h) → return cached tier * b. No cache → optimistic "pro" (validated async in runServer) * 3. No key + no SUPABASE_URL + no config.supabase_url → free * 4. No key + SUPABASE_URL set (env var) → pro (backward compat for us) * * Async validation (validateLicense()): * - Called in runServer() startup (non-blocking) * - POST to hardcoded validation endpoint with api_key + install_id * - Success: cache to ~/.gitmem/license-cache.json (72h TTL) * - Failure: downgrade _tier to free, log warning * - Network error: honor existing cache if valid, else downgrade */ export interface LicenseValidationResult { valid: boolean; tier: string | null; message: string; } /** * Get license key from env var or config.json */ export declare function getLicenseKey(): string | null; /** * Get Pro config (Supabase + OpenRouter credentials) from config.json * Env vars override config.json values. */ export declare function getProConfig(): { supabaseUrl: string; supabaseKey: string; openrouterKey: string; }; /** * Delete license cache (used by deactivate) */ export declare function clearLicenseCache(): void; /** * Check if license key has a valid cached result (non-async, for tier detection) */ export declare function getCachedLicenseTier(): string | null; /** * Validate license key against GitMem's Supabase RPC endpoint. * Calls gitmem_validate_license() via PostgREST using the anon key. * Returns the validation result. * * This is async and should be called non-blocking during startup. */ export declare function validateLicense(apiKey: string, installId: string): Promise; /** * Get the validation URL (for diagnostics/testing) */ export declare function getValidationUrl(): string; //# sourceMappingURL=license.d.ts.map