import { type Plugin, type PluginExecutionVersions, type PluginRegistry, type PluginType } from "@superblocksteam/shared";
import type { OpenApiSpec } from "../../util/open-api.js";
import type { EditorClient } from "../types.js";
import type { PromptContextIntegration } from "@superblocksteam/library-shared/types";
export type IntegrationId = string;
export type PluginId = string;
export type Integration = IntegrationHeader & {
    metadata: IntegrationMetadataRecord;
};
export type IntegrationHeader = {
    id: IntegrationId;
    name: string;
    plugin: PluginHeader;
    type: string;
    displayName?: string;
};
export type PluginHeader = {
    id: PluginId;
    type: PluginType;
    openApiSpecRef?: string;
    isBuiltIn: boolean;
};
export type IntegrationMetadataRecord = Record<string, any> & {
    openApiSpec?: OpenApiSpec;
    openApiSpecRef?: string;
};
/**
 * Options for fetching integration metadata.
 */
export interface MetadataFetchOptions {
    /**
     * Force refresh - bypass cache and fetch fresh metadata from server.
     * Use when user indicates they've updated the integration configuration.
     */
    forceRefresh?: boolean;
    /**
     * Override the default TTL for this fetch. Useful for testing.
     */
    ttl?: number;
}
/**
 * TTL (Time To Live) configuration for metadata cache.
 */
export declare const METADATA_TTL: {
    /** Default TTL: 10 minutes - balances freshness with load */
    readonly DEFAULT: number;
    /** Minimum TTL: 1 minute - for testing or high-frequency updates */
    readonly MIN: number;
    /** Maximum TTL: 1 hour - for very stable metadata */
    readonly MAX: number;
};
export declare const DEFAULT_METADATA_CACHE_CONFIG: {
    maxCacheSizeMb: number;
    maxFileSizeMb: number;
};
export declare class IntegrationStore {
    private openApiSpecs;
    private pluginRegistry;
    private integrations;
    private metadataStorage;
    private pendingMetadataFetches;
    private _pluginExecutionVersions?;
    private superblocksBaseUrl?;
    private applicationId?;
    private getJwt?;
    constructor(pluginRegistry?: PluginRegistry, rootDir?: string, maxCacheSizeMB?: number, maxFileSizeMB?: number, pluginExecutionVersions?: PluginExecutionVersions, superblocksBaseUrl?: string, applicationId?: string, getJwt?: () => string | undefined);
    /**
     * Get the plugin execution versions from the organization.
     * This can be used to determine which version of a plugin to use.
     */
    get pluginExecutionVersions(): PluginExecutionVersions | undefined;
    /**
     * Get the execution version for a specific plugin.
     * @param pluginId The plugin ID to get the version for
     * @returns The version string, or undefined if not available
     */
    getPluginExecutionVersion(pluginId: string): string | undefined;
    initialize(): Promise<void>;
    removeIntegrationCache(): Promise<void>;
    availableIntegrations(): Promise<IntegrationHeader[]>;
    getPlugin(pluginId: PluginId): Plugin | undefined;
    fetchIntegrations(editorClient: EditorClient, mentionedIntegrations: PromptContextIntegration[]): Promise<void>;
    getHeader(id: IntegrationId): IntegrationHeader | undefined;
    getMetadata(id: IntegrationId, editorClient?: EditorClient, options?: MetadataFetchOptions): Promise<IntegrationMetadataRecord | undefined>;
    private _fetchMetadata;
    getIntegration(id: IntegrationId, editorClient?: EditorClient, options?: MetadataFetchOptions): Promise<Integration | undefined>;
    getOpenApiSpec(integrationId: IntegrationId, editorClient?: EditorClient, specRef?: string): Promise<OpenApiSpec | undefined>;
    private fetchOpenApiSpecDirectly;
    /**
     * Get the entity tag for the integration
     * eg @SuperblocksGithub[id=2ce0985a-342b-445d-b897-d17d80a26b8b]
     */
    getEntityTag(id: IntegrationId): string | undefined;
}
export declare function isOpenApiIntegration(header: IntegrationHeader): boolean;
export declare function isDatabricksIntegration(header: IntegrationHeader): boolean;
export declare function isGraphQlIntegration(header: IntegrationHeader): boolean;
//# sourceMappingURL=store.d.ts.map