export type IntegrationType = "webhook" | "api" | "plugin" | "extension" | "cli" | "ui"; export type IntegrationStatus = "active" | "inactive" | "error" | "pending"; export type IntegrationConfig = { id: string; name: string; type: IntegrationType; description?: string; version: string; status: IntegrationStatus; config: Record; metadata: IntegrationMetadata; createdAt: Date; updatedAt: Date; lastUsedAt?: Date; }; export type IntegrationMetadata = { author?: string; homepage?: string; repository?: string; license?: string; tags?: string[]; dependencies?: string[]; permissions?: string[]; }; export type WebhookIntegration = IntegrationConfig & { type: "webhook"; config: { url: string; method: "GET" | "POST" | "PUT" | "DELETE"; headers?: Record; secret?: string; events: string[]; retryPolicy?: RetryPolicy; }; }; export type ApiIntegration = IntegrationConfig & { type: "api"; config: { baseUrl: string; auth: ApiAuth; endpoints: ApiEndpoint[]; rateLimit?: RateLimit; timeout?: number; }; }; export type ApiAuth = { type: "none" | "basic" | "bearer" | "oauth2" | "api_key"; config?: Record; }; export type ApiEndpoint = { path: string; method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; description?: string; parameters?: ApiParameter[]; responseSchema?: Record; }; export type ApiParameter = { name: string; type: "query" | "path" | "body" | "header"; required: boolean; description?: string; schema?: Record; }; export type RateLimit = { requests: number; period: "second" | "minute" | "hour" | "day"; strategy: "fixed_window" | "sliding_window" | "token_bucket"; }; export type RetryPolicy = { maxAttempts: number; backoffStrategy: "fixed" | "exponential" | "linear"; baseDelayMs: number; maxDelayMs?: number; }; export type PluginIntegration = IntegrationConfig & { type: "plugin"; config: { entryPoint: string; hooks: PluginHook[]; commands?: PluginCommand[]; events?: PluginEvent[]; }; }; export type PluginHook = { name: string; description?: string; parameters?: Record; returnType?: string; }; export type PluginCommand = { name: string; description?: string; parameters?: PluginParameter[]; handler: string; }; export type PluginParameter = { name: string; type: string; required: boolean; description?: string; default?: unknown; }; export type PluginEvent = { name: string; description?: string; payloadSchema?: Record; }; export type ExtensionIntegration = IntegrationConfig & { type: "extension"; config: { activationEvents: string[]; contributes: ExtensionContribution; main: string; }; }; export type ExtensionContribution = { commands?: ExtensionCommand[]; menus?: Record; views?: ExtensionView[]; keybindings?: ExtensionKeybinding[]; }; export type ExtensionCommand = { command: string; title: string; category?: string; icon?: string; }; export type ExtensionMenuItem = { command: string; when?: string; group?: string; }; export type ExtensionView = { id: string; name: string; icon?: string; contextValue?: string; }; export type ExtensionKeybinding = { command: string; key: string; when?: string; mac?: string; linux?: string; win?: string; }; export type CliIntegration = IntegrationConfig & { type: "cli"; config: { commands: CliCommand[]; globalOptions?: CliOption[]; help?: string; }; }; export type CliCommand = { name: string; description?: string; options?: CliOption[]; arguments?: CliArgument[]; subcommands?: CliCommand[]; handler: string; }; export type CliOption = { name: string; short?: string; description?: string; type: "string" | "boolean" | "number"; required?: boolean; default?: unknown; }; export type CliArgument = { name: string; description?: string; type: "string" | "number"; required?: boolean; }; export type UiIntegration = IntegrationConfig & { type: "ui"; config: { components: UiComponent[]; routes?: UiRoute[]; themes?: UiTheme[]; locales?: Record>; }; }; export type UiComponent = { name: string; type: "page" | "modal" | "widget" | "form"; template: string; styles?: string; script?: string; props?: Record; }; export type UiRoute = { path: string; component: string; title?: string; icon?: string; requiresAuth?: boolean; }; export type UiTheme = { name: string; colors: Record; fonts?: Record; spacing?: Record; }; export type IntegrationProvider = { type: IntegrationType; validateConfig(config: Record): Promise; initialize(config: Record): Promise; execute(context: IntegrationContext): Promise; }; export type ValidationResult = { valid: boolean; errors?: string[]; warnings?: string[]; }; export type IntegrationInstance = { id: string; config: Record; state: Record; dispose(): Promise; }; export type IntegrationContext = { event?: string; payload?: unknown; environment?: string; user?: string; correlationId?: string; }; export type IntegrationResult = { success: boolean; data?: unknown; error?: string; logs?: string[]; }; export declare class IntegrationRegistry { private readonly providers; private readonly integrations; private readonly instances; registerProvider(type: IntegrationType, provider: IntegrationProvider): void; unregisterProvider(type: IntegrationType): boolean; getProvider(type: IntegrationType): IntegrationProvider | undefined; registerIntegration(config: Omit): Promise; getIntegration(id: string): IntegrationConfig | undefined; updateIntegration(id: string, updates: Partial): boolean; deleteIntegration(id: string): boolean; listIntegrations(type?: IntegrationType, status?: IntegrationStatus): IntegrationConfig[]; initializeIntegration(id: string): Promise; executeIntegration(id: string, context: IntegrationContext): Promise; disposeIntegration(id: string): Promise; getIntegrationStats(): IntegrationStats; } export type IntegrationStats = { total: number; byType: Record; byStatus: Record; activeInstances: number; }; export declare class WebhookProvider implements IntegrationProvider { readonly type: IntegrationType; validateConfig(config: Record): Promise; initialize(config: Record): Promise; execute(context: IntegrationContext): Promise; } export declare class ApiProvider implements IntegrationProvider { readonly type: IntegrationType; validateConfig(config: Record): Promise; initialize(config: Record): Promise; execute(_context: IntegrationContext): Promise; } //# sourceMappingURL=ecosystem.d.ts.map