/** * Lighthouse Storage Integration for Playbook Registry * * This module provides integration with Lighthouse (IPFS) storage for: * - Uploading playbook YAML files to IPFS * - Retrieving playbooks from IPFS by CID * - Listing uploaded playbooks * - Managing decentralized playbook storage * * NOTE: Uses a default shared Lighthouse API key for the SuperAudit community. * Users can optionally provide their own API key via LIGHTHOUSE_API_KEY env var. */ /** * Configuration for Lighthouse storage */ export interface LighthouseConfig { apiKey: string; gatewayUrl?: string; } /** * Response from Lighthouse upload */ export interface LighthouseUploadResponse { data: { Name: string; Hash: string; Size: string; }; } /** * Metadata for a playbook stored on Lighthouse */ export interface LighthousePlaybookMetadata { cid: string; name: string; author: string; description?: string; tags?: string[]; version?: string; uploadedAt: string; size: number; lighthouseUrl: string; encrypted?: boolean; publicKey?: string; } /** * Lighthouse Storage Manager for Playbooks */ export declare class LighthouseStorageManager { private apiKey; private gatewayUrl; private cacheDir; constructor(config: LighthouseConfig); /** * Upload a playbook YAML file to Lighthouse/IPFS */ uploadPlaybook(filePath: string, progressCallback?: (progress: any) => void): Promise; /** * Sign authentication message for encrypted uploads */ private signAuthMessage; /** * Sign authentication message for decryption (using Lighthouse API directly) */ private signAuthMessageForDecrypt; /** * Upload a playbook YAML file to Lighthouse/IPFS with encryption */ uploadPlaybookEncrypted(filePath: string, publicKey: string, privateKey: string, progressCallback?: (progress: any) => void): Promise; /** * Share an encrypted file with another user (using platform's keys) */ shareEncryptedFile(cid: string, userPublicKey: string): Promise; /** * Download and decrypt an encrypted playbook */ downloadEncryptedPlaybook(cid: string, userPublicKey: string, userPrivateKey: string): Promise; /** * Upload a playbook from YAML string content */ uploadPlaybookFromString(yamlContent: string, filename: string, progressCallback?: (progress: any) => void): Promise; /** * Download a playbook from Lighthouse/IPFS by CID */ downloadPlaybook(cid: string): Promise; /** * Get playbook metadata from CID without downloading full content */ getPlaybookMetadata(cid: string): Promise>; /** * Get uploads associated with the API key * Note: This requires the Lighthouse API endpoint to list user uploads */ listUploads(): Promise; /** * Check if a CID is accessible */ isCIDAccessible(cid: string): Promise; /** * Get the gateway URL for a CID */ getGatewayUrl(cid: string): string; /** * Clear the local cache */ clearCache(): void; /** * Extract metadata from YAML content * Simple parser that looks for the meta section */ private extractMetadataFromYaml; } /** * Initialize the Lighthouse storage manager */ export declare function initializeLighthouse(apiKey: string): LighthouseStorageManager; /** * Get the Lighthouse storage manager instance */ export declare function getLighthouse(): LighthouseStorageManager; /** * Check if Lighthouse is initialized */ export declare function isLighthouseInitialized(): boolean; /** * Initialize Lighthouse from environment variable or use default shared API key * * This function will: * 1. Check for user's own LIGHTHOUSE_API_KEY in environment * 2. Fall back to the default shared SuperAudit community API key * * This ensures users can upload/download playbooks without needing their own API key. */ export declare function initializeLighthouseFromEnv(): LighthouseStorageManager; //# sourceMappingURL=lighthouse-storage.d.ts.map