import { OnDestroy, OnInit } from '@angular/core';
import { CompositeKey } from '@memberjunction/core';
import type { UserInfo } from '@memberjunction/core';
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
import type { MJConversationEntity, MJTaskEntity } from '@memberjunction/core-entities';
import type { AppContextSnapshot } from '@memberjunction/ai-core-plus';
import type { NavigationRequest, PendingAttachment } from '@memberjunction/ng-conversations';
import { ComponentStudioStateService } from '../../services/component-studio-state.service';
import * as i0 from "@angular/core";
/**
 * Quick-action shortcut surfaced above the embedded chat. Clicking a
 * shortcut prefills the chat input via the pendingMessage handoff — the
 * same mechanism the empty-state uses to send the first message.
 */
interface QuickAction {
    Label: string;
    Icon: string;
    Prompt: string;
    /** When true, the button is disabled unless `state.CurrentError` is set. */
    RequiresError: boolean;
}
/**
 * Component Studio's right-pane AI assistant.
 *
 * Previously this was a 880-line bespoke chat stub that emitted "AI
 * assistant coming soon" — no agent was actually called. This version
 * thin-wraps `<mj-conversation-chat-area>` (the same primitive the main
 * Chat app and the Form Builder cockpit use) so the assistant becomes
 * fully functional with zero duplicated chat plumbing.
 *
 * Domain integration preserved from the old stub:
 *   - **Quick-actions bar** (Fix Errors / Improve / Generate / Explain)
 *     above the chat — clicking sets `PendingMessage` which the chat-area
 *     consumes on the next render, mirroring the empty-state handoff.
 *   - **`SendErrorToAI` channel** — when the runtime preview throws, the
 *     state service emits a `ComponentError`. We listen and shove a
 *     "Fix this error: …" message into the same pendingMessage pipe so
 *     the user doesn't have to copy/paste error text.
 *
 * Scoping:
 *   - `[applicationScope]="'Application'"` + Component Studio app ID →
 *     conversations stay out of main chat (per the migration scoping work).
 *   - `[defaultAgentId]` → Codesmith Agent so messages route to the code
 *     specialist instead of Sage by default. User can still @mention any
 *     agent, override via the per-conversation pin, or pick a different
 *     agent through the chat header's picker.
 */
export declare class AIAssistantPanelComponent extends BaseAngularComponent implements OnInit, OnDestroy {
    State: ComponentStudioStateService;
    /** Quick actions surfaced as buttons above the embedded chat. */
    QuickActions: QuickAction[];
    /** Embedded chat state — same shape the Form Builder cockpit uses. */
    ChatConversation: MJConversationEntity | null;
    ChatConversationId: string | null;
    ChatIsNewConversation: boolean;
    PendingMessage: string | null;
    PendingAttachments: PendingAttachment[] | null;
    ChatThreadId: string | null;
    ChatPendingArtifactId: string | null;
    ChatPendingArtifactVersionNumber: number | null;
    /** Snapshot from NavigationService — drives the agent's app context. */
    ChatAppContext: AppContextSnapshot | null;
    /** Codesmith Agent ID resolved from AIEngineBase cache (no RunView). */
    CodesmithAgentId: string | null;
    /** Component Studio's Application ID — resolved from Metadata cache. */
    CockpitApplicationId: string | null;
    /**
     * EntityID for `MJ: Components`. Stamped on every conversation
     * created from this panel as the `LinkedEntityID`, paired with the
     * currently-selected Component's ID. Enables "show prior conversations
     * about THIS component" later. In-memory Metadata lookup; no RunView.
     */
    ComponentsEntityID: string | null;
    /**
     * The DB-backed Component ID currently selected — null when the
     * panel has nothing selected, or when the selection is a
     * file-loaded (transient) component that has no persistent DB row
     * to link conversations to. Used as `[linkedRecordId]` on the
     * embedded chat-area. Pairs with {@link ComponentsEntityID}.
     */
    get LinkedComponentID(): string | null;
    private static readonly CODESMITH_AGENT_NAME;
    private static readonly COCKPIT_APP_NAME;
    private readonly destroy$;
    private appContextSubscription;
    private readonly cdr;
    private readonly navigationService;
    constructor(State: ComponentStudioStateService);
    get EnvironmentId(): string;
    get CurrentUser(): UserInfo | null;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    /** Collapse the right pane (delegated to the parent dashboard). */
    OnCollapsePanel(): void;
    /** Quick-action click — prefill the chat with the canned prompt. */
    OnQuickAction(action: QuickAction): void;
    IsQuickActionEnabled(action: QuickAction): boolean;
    /** Runtime preview surfaced an error — auto-send "Fix this error: …". */
    private handleIncomingError;
    OnConversationCreated(event: {
        conversation: MJConversationEntity;
        pendingMessage?: string;
        pendingAttachments?: PendingAttachment[];
    }): void;
    OnPendingMessageConsumed(): void;
    OnOpenEntityRecord(event: {
        entityName: string;
        compositeKey: CompositeKey;
    }): void;
    OnNavigationRequest(event: NavigationRequest): void;
    OnTaskClicked(task: MJTaskEntity): void;
    OnArtifactLinkClicked(event: {
        type: 'conversation' | 'collection';
        id: string;
    }): void;
    OnConversationRenamed(event: {
        conversationId: string;
        name: string;
        description: string;
    }): void;
    OnThreadOpened(threadId: string): void;
    OnThreadClosed(): void;
    OnPendingArtifactConsumed(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AIAssistantPanelComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AIAssistantPanelComponent, "mj-ai-assistant-panel", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=ai-assistant-panel.component.d.ts.map