/**
 * ContinueDevIdeAdapter -- Continue.dev IDE adapter.
 *
 * Implements the IdeAdapter contract for Continue.dev, an open-source
 * AI code assistant (https://continue.dev). Enforcement fires via the
 * Continue.dev core SDK extension-point surface:
 *
 *   IExtensionPoint.onToolCallStart   -- PreToolUse equivalent
 *   IExtensionPoint.onToolCallEnd     -- PostToolUse equivalent
 *   IExtensionPoint.onChatRequest     -- chat-level interception
 *
 * The adapter exposes a factory method `buildContinueExtension()` that
 * produces a Continue.dev extension object the customer adds to their
 * config.ts `extensions` array. The extension hooks wire governance
 * enforcement into every tool call.
 *
 * TESTED_API_VERSION is pinned to '0.8'. Continue.dev is pre-1.0 and
 * the extension API may shift. If the upstream version reported at
 * dispatch time is below this minimum, the adapter emits
 * `ide:api-version-mismatch` WARN on first dispatch.
 *
 * DEFERRED-CONTINUE-API-VERSION: Once Continue.dev publishes a stable
 * SDK version (1.0+), update TESTED_API_VERSION and remove this flag.
 * Add a KANBAN task to track.
 *
 * User identity: resolved from the Continue config's `userId` field.
 * If missing and allowAnonymousIdeSessions is not explicitly true,
 * initialize() throws IdeAttributionError (fail-closed per AC 22).
 *
 * Privileged actions (filesystem writes outside project root, shell
 * commands, git mutations) are routed to the configured reviewer tier.
 *
 * Destructive-command denial and sensitive-path protection reuse the
 * shared patterns from src/ide-adapters/shared.ts.
 *
 * Spec: P3-IDE-01 AC 13-14, Section 2.5
 *
 * @connexum/ai-governance
 */
import { BaseIdeAdapter } from './base';
import { type IdeAdapterConfig, type IdeAdapterCapabilities, type IdeSessionContext, type ToolInvocationContext, type ToolInvocationDecision, type UserIdentity, type ReviewerTier } from './index';
/**
 * Minimum Continue.dev SDK version this adapter is tested against.
 * Emit ide:api-version-mismatch WARN at first dispatch if the upstream
 * version falls below this.
 *
 * DEFERRED-CONTINUE-API-VERSION: Verify and update once Continue.dev
 * publishes a stable SDK (1.0+).
 */
export declare const CONTINUE_TESTED_API_VERSION = "0.8";
export interface ContinueDevAdapterConfig extends IdeAdapterConfig {
    /** Minimum Continue.dev SDK version string (default: CONTINUE_TESTED_API_VERSION) */
    continueApiVersion?: string;
    /**
     * Reviewer tier for privileged actions (filesystem writes outside project
     * root, shell commands, git mutations). Default: 'T2_LEAD'.
     */
    privilegedActionReviewerTier?: ReviewerTier;
    /** Project root path; writes outside this path are treated as privileged. */
    projectRoot?: string;
}
/** Minimal shape of a Continue.dev tool-call event passed to hooks. */
export interface ContinueToolCallEvent {
    tool: string;
    input: Record<string, unknown>;
    sessionId?: string;
    userId?: string;
    /** Upstream SDK version string (may be missing in older versions) */
    sdkVersion?: string;
}
/** Minimal shape of a Continue.dev chat request event. */
export interface ContinueChatRequestEvent {
    sessionId?: string;
    userId?: string;
    message?: string;
    sdkVersion?: string;
}
/**
 * The extension object shape the customer places in their Continue.dev
 * config.ts `extensions` array.
 *
 * Continue.dev calls these hooks synchronously within its event dispatch.
 * A DENY decision must cause the tool call to be cancelled. Whether that
 * cancellation is enforced at the SDK level (throw) or returned as a
 * decision object depends on the Continue.dev version. The adapter
 * returns a decision object; throwing is done by the wrapper in
 * `buildContinueExtension()` when the decision is DENY.
 */
export interface ContinueGovernanceExtension {
    name: string;
    onToolCallStart: (event: ContinueToolCallEvent) => Promise<{
        allow: boolean;
        reason: string;
    }>;
    onToolCallEnd: (event: ContinueToolCallEvent, result: unknown) => Promise<void>;
    onChatRequest: (event: ContinueChatRequestEvent) => Promise<void>;
}
export declare class ContinueDevIdeAdapter extends BaseIdeAdapter {
    readonly adapterId = "continue-dev";
    readonly ideId = "continue-dev";
    private continueConfig;
    private versionWarnEmitted;
    initialize(config: IdeAdapterConfig): void;
    resolveUserIdentity(session: IdeSessionContext): Promise<UserIdentity>;
    interceptToolInvocation(ctx: ToolInvocationContext): Promise<ToolInvocationDecision>;
    buildContinueExtension(sessionHandle: import('./index').IdeSessionHandle, identity: UserIdentity): ContinueGovernanceExtension;
    getIdeCapabilities(): IdeAdapterCapabilities;
    private _extractUserId;
    /**
     * True if `reported` is at or above `minimum` (semver major.minor comparison).
     * Handles versions like '0.8', '0.9.1', '1.0.0'.
     */
    private _meetsMinVersion;
    /**
     * Returns true if the tool invocation is considered privileged and should
     * be routed for reviewer approval before execution.
     */
    private _isPrivilegedAction;
}
//# sourceMappingURL=continue-dev.d.ts.map