@hivetechs/hive-ai
Version:
Real-time streaming AI consensus platform with HTTP+SSE MCP integration for Claude Code, VS Code, Cursor, and Windsurf - powered by OpenRouter's unified API
121 lines • 4.54 kB
TypeScript
/**
* Database Interface - Unified Database Adapter
*
* This file now serves as a compatibility layer for the unified database.
* All database operations are routed through the unified-database.ts module.
*/
/**
* Initialize the database - delegates to unified database
*/
export declare function initializeDatabase(): Promise<boolean>;
export { createConversation } from './unified-database.js';
export { addMessage } from './unified-database.js';
export { addToPendingSync, markSyncComplete, recordSyncAttempt, getPendingSyncItems, clearPendingSyncData } from './unified-database.js';
/**
* Record a pipeline stage result (legacy compatibility)
*/
export declare function recordPipelineResult(id: string, messageId: string, stage: string, model: string, content: string): Promise<string>;
export { getConversationHistory } from './unified-database.js';
/**
* Check if any conversations exist in the database
* This is useful for determining if we're in a new database state
*/
export declare function checkForAnyConversations(): Promise<boolean>;
/**
* Check if a specific conversation exists in the database
*/
export declare function checkConversationExists(conversationId: string): Promise<boolean>;
/**
* List active conversations in the database (for debugging)
*/
export declare function listActiveConversations(limit?: number): Promise<any[]>;
/**
* Get pipeline results for a specific message
*/
export declare function getPipelineResults(messageId: string): Promise<any[]>;
/**
* Get recent conversations
*/
export declare function getRecentConversations(limit?: number): Promise<any[]>;
/**
* Get conversation metadata with topics
* This combines data from conversations and conversation_topics tables
*/
export declare function getConversationMetadata(conversationId: string): Promise<any>;
/**
* Search for conversations by topic using keyword and topic matching
*/
export declare function getConversationsByTopic(query: string, limit?: number): Promise<any[]>;
/**
* Close the database connection
*/
/**
* Record conversation usage for billing/limit tracking
*/
export declare function recordConversationUsage(conversationId: string): Promise<void>;
/**
* Get conversation usage count since a specific date
*/
export declare function getConversationUsageCount(sinceDate: Date): Promise<number>;
/**
* Get detailed usage statistics
*/
export declare function getUsageStatistics(days?: number): Promise<{
totalConversations: number;
dailyAverage: number;
last24Hours: number;
last7Days: number;
}>;
export { setConfig, getConfig } from './unified-database.js';
/**
* Delete a configuration value
*/
export declare function deleteConfig(key: string): Promise<void>;
/**
* Get all configuration keys
*/
export declare function getAllConfigKeys(): Promise<string[]>;
/**
* Store user license key and profile information
*/
export declare function setUserProfile(email: string, licenseKey: string, tier?: string): Promise<void>;
/**
* Get user profile by email
*/
export declare function getUserProfile(email: string): Promise<{
id: string;
email: string;
license_key: string;
tier: string;
created_at: string;
updated_at: string;
} | null>;
export { getLicenseKeyFromDB, saveLicenseKeyToDB, getUserTier } from './unified-database.js';
export { createConsensusProfile } from './unified-database.js';
/**
* Get a consensus profile by ID
*/
export declare function getConsensusProfile(profileId: string): Promise<{
id: string;
profile_name: string;
generator_model: string;
refiner_model: string;
validator_model: string;
curator_model: string;
created_at: string;
updated_at: string;
} | null>;
export { getAllConsensusProfiles } from './unified-database.js';
export { setActiveConsensusProfile, getActiveConsensusProfile } from './unified-database.js';
/**
* Delete a consensus profile
*/
export declare function deleteConsensusProfile(profileId: string): Promise<void>;
/**
* Update a consensus profile
*/
export declare function updateConsensusProfile(profileId: string, profileName: string, generatorModel: string, refinerModel: string, validatorModel: string, curatorModel: string): Promise<void>;
export { getOpenRouterApiKey, saveOpenRouterApiKey, validateOpenRouterApiKey } from './unified-database.js';
export { getTierLimits, checkDailyUsageLimit, recordCompletedConversation } from './unified-database.js';
export declare function closeDatabase(): Promise<void>;
//# sourceMappingURL=database.d.ts.map