/**
 * JetBrainsAiIdeAdapter -- JetBrains AI Assistant adapter.
 *
 * Covers the JetBrains AI Assistant across IntelliJ IDEA, PyCharm,
 * WebStorm, GoLand, Rider, DataGrip, and the full JetBrains IDE family.
 *
 * Hook surfaces:
 *   completionRequested(file, cursor, context) -- pre-completion gate.
 *   completionReceived(completion, context) -- post-completion ingress.
 *   chatRequested(prompt, context) -- pre-chat gate.
 *   chatReceived(response) -- post-chat ingress classification.
 *   suggestionAccepted(suggestion, targetFile) -- audit event on acceptance.
 *   suggestionRejected(suggestion, reason) -- optional audit event.
 *
 * JetBrains-specific surfaces:
 *   refactorRequested(targetSymbol, intent) -- JetBrains AI has native
 *     refactor-with-AI; pre-refactor gate catches PHI or secrets in the
 *     symbol's context. (PT-ADAPT-JBAI-1)
 *   commitMessageRequested(diff) -- AI-generated commit message; classify
 *     diff for secret leaks BEFORE the message generation. (PT-ADAPT-JBAI-2)
 *   testGenerationRequested(function, context) -- AI-generated tests;
 *     ensure no production-data fixtures leak into generated tests.
 *
 * JetBrains-specific considerations:
 *   - JetBrains AI uses the JetBrains AI Cloud by default but supports
 *     local Ollama + OpenAI + Anthropic as alternative backends.
 *     Adapter reads the backend choice per-request and routes through
 *     provider-compliance.
 *   - DataGrip workflows often touch production databases directly. When
 *     DataGrip is the host IDE, adapter applies stricter data-class rules
 *     for result-set classification. (PT-ADAPT-JBAI-3)
 *
 * Spec: P3-SUB-IDE-03
 *
 * @connexum/ai-governance
 */
import { BaseIdeAdapter } from './base';
import { type IdeAdapterConfig, type IdeAdapterCapabilities, type IdeSessionContext, type ToolInvocationContext, type ToolInvocationDecision, type UserIdentity, type ReviewerTier } from './index';
/**
 * JetBrains AI Assistant supports multiple backend providers.
 * 'jetbrains-cloud' is the default. Alternatives allow local or third-party
 * LLM deployment in air-gapped or privacy-sensitive environments.
 */
export type JetBrainsAiBackend = 'jetbrains-cloud' | 'ollama' | 'openai' | 'anthropic' | 'azure-openai';
/**
 * Backends that carry a JetBrains data-processing agreement meeting
 * HIPAA BAA requirements.
 *
 * JetBrains Cloud: JetBrains Inc. must have an active BAA in place.
 * OpenAI/Anthropic/Azure: customer must hold their own BAA with the provider.
 * Ollama: self-hosted -- no third-party BAA needed; customer controls data.
 *
 * For the purposes of this adapter, only the backends where JetBrains itself
 * would be the processor are explicitly gated. Self-hosted (Ollama) is
 * treated as BAA-compliant by default because the customer controls residency.
 */
export declare const JETBRAINS_BAA_ELIGIBLE_BACKENDS: JetBrainsAiBackend[];
/**
 * The specific JetBrains IDE is surfaced in the event context so that
 * DataGrip-specific rules can be applied.
 */
export type JetBrainsIdeVariant = 'intellij-idea' | 'pycharm' | 'webstorm' | 'goland' | 'rider' | 'datagrip' | 'rubymine' | 'clion' | 'phpstorm' | 'unknown';
export interface JetBrainsAiAdapterConfig extends IdeAdapterConfig {
    /**
     * The AI backend being used in this tenant's JetBrains AI configuration.
     * Default: 'jetbrains-cloud'
     */
    aiBackend?: JetBrainsAiBackend;
    /**
     * The specific JetBrains IDE variant.
     * Default: 'unknown' (no DataGrip-specific rules applied)
     */
    ideVariant?: JetBrainsIdeVariant;
    /** Reviewer tier for HIPAA-bound PHI violations. Default: T2_LEAD */
    hipaaReviewerTier?: ReviewerTier;
    /**
     * Reviewer tier for refactor and commit-message operations that may
     * touch regulated symbols or diffs. Default: T2_LEAD
     */
    refactorReviewerTier?: ReviewerTier;
}
export interface JetBrainsRefactorContext {
    targetSymbol: string;
    intent: string;
    surroundingContext?: string;
    filePath?: string;
    sessionId?: string;
}
export interface JetBrainsCommitDiffContext {
    diff: string;
    branchName?: string;
    sessionId?: string;
}
export interface JetBrainsTestGenContext {
    targetFunction: string;
    surroundingContext?: string;
    filePath?: string;
    sessionId?: string;
}
export interface JetBrainsDataGripResultSet {
    /** Column names from the query result */
    columns: string[];
    /** Optional: first row of data for PHI scan (never log full row sets) */
    sampleRow?: Record<string, unknown>;
    query?: string;
    sessionId?: string;
}
export declare class JetBrainsAiIdeAdapter extends BaseIdeAdapter {
    readonly adapterId = "jetbrains-ai";
    readonly ideId = "jetbrains-ai";
    private jbConfig;
    initialize(config: IdeAdapterConfig): void;
    resolveUserIdentity(session: IdeSessionContext): Promise<UserIdentity>;
    interceptToolInvocation(ctx: ToolInvocationContext): Promise<ToolInvocationDecision>;
    private _gateCompletionRequest;
    private _scanCompletionResponse;
    private _gateChatRequest;
    private _scanChatResponse;
    private _auditSuggestionAccepted;
    private _auditSuggestionRejected;
    refactorRequested(ctx: JetBrainsRefactorContext): Promise<ToolInvocationDecision>;
    commitMessageRequested(ctx: JetBrainsCommitDiffContext): Promise<ToolInvocationDecision>;
    testGenerationRequested(ctx: JetBrainsTestGenContext): Promise<ToolInvocationDecision>;
    dataGripResultSetRequested(ctx: JetBrainsDataGripResultSet): Promise<ToolInvocationDecision>;
    private _gateRefactorRequest;
    private _gateCommitMessageRequest;
    private _gateTestGenerationRequest;
    private _gateDataGripResultRequest;
    getIdeCapabilities(): IdeAdapterCapabilities;
    translateError(raw: unknown): import('./index').IdeAdapterError;
    private _scanForSecrets;
    private _scanForPhiIndicators;
    private _isHipaaBinding;
    /**
     * Scan a unified diff for secret patterns. Returns the first finding
     * or null. Only scans added lines (lines starting with '+').
     */
    private _scanDiffForSecrets;
    /**
     * Check backend-level compliance for the active pack binding.
     * Returns a DENY decision if the backend is not BAA-eligible under HIPAA,
     * or null if no issue.
     */
    private _checkBackendCompliance;
    /** Expose the resolved backend for diagnostics / tests. */
    getAiBackend(): JetBrainsAiBackend;
    /** Expose the IDE variant for diagnostics / tests. */
    getIdeVariant(): JetBrainsIdeVariant;
}
//# sourceMappingURL=jetbrains-ai.d.ts.map