import type { ExecutionArtifact } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/artifact_pb";
import { type ApplyResourceResult } from "../library/useApplyResource";
/** Props for {@link ArtifactPreviewContent}. */
export interface ArtifactPreviewContentProps {
    /** The execution artifact to preview. */
    readonly artifact: ExecutionArtifact;
    /** ID of the execution that produced this artifact. */
    readonly executionId: string;
    /** Organization slug for the "Apply to [org]" / "Push Skill to [org]" CTA. */
    readonly org: string;
    /**
     * Whether the execution is in a terminal phase (completed, failed,
     * cancelled, terminated). Controls Apply/Push CTA availability:
     *
     * - `true` — CTA renders as an enabled primary button
     * - `false` — CTA renders as a disabled secondary button
     */
    readonly isTerminal: boolean;
    /** Called when the close button is clicked. */
    readonly onClose: () => void;
    /**
     * Called after a resource is successfully applied or a skill package
     * is pushed. The consumer can use this for post-apply behavior such
     * as showing a toast or navigating to the Library.
     */
    readonly onApplied?: (result: ApplyResourceResult) => void;
    /** Additional CSS classes for the root container. */
    readonly className?: string;
}
/**
 * Artifact preview content with detection pipeline and Apply/Push CTA.
 *
 * Renders the header (name, size, detection badge, close button),
 * content body (file content or directory listing), and action bar
 * (copy, download, Apply/Push). The parent is responsible for rendering
 * it inside a `<dialog>`, modal, sheet, overlay, or inline context as
 * needed.
 *
 * Orchestrates the same detection pipeline as {@link ArtifactCard}:
 *
 * - **FILE artifacts**: Fetches text content via {@link useArtifactContent},
 *   renders via {@link ArtifactContentRenderer} (markdown, YAML, JSON, or
 *   plain text based on file type), and detects Agent/McpServer resources
 *   via {@link useDetectStigmerResource}.
 *
 * - **DIRECTORY artifacts**: Shows the file listing from
 *   `artifact.entries` and detects skill packages via
 *   {@link useDetectSkillPackage}.
 *
 * Content fetching begins immediately on mount. Unmounting the component
 * resets all internal state (detection, apply result, clipboard). For
 * gated rendering (e.g. only when a dialog is open), conditionally
 * mount this component rather than passing an `active` flag.
 *
 * @example
 * ```tsx
 * // Inside a dialog, modal, or overlay:
 * <ArtifactPreviewContent
 *   artifact={artifact}
 *   executionId={execution.id}
 *   org={activeOrg}
 *   isTerminal={isTerminalPhase(execution.status?.phase)}
 *   onClose={() => setOpen(false)}
 *   onApplied={(result) => toast(`${result.kind} applied`)}
 * />
 * ```
 *
 * @see {@link ArtifactPreviewModal} — wraps this component in a native `<dialog>`
 * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
 * @see {@link useArtifactContent} — content-fetching hook (headless alternative)
 * @see {@link useDetectStigmerResource} — YAML resource detection (headless)
 * @see {@link useDetectSkillPackage} — skill package detection (headless)
 * @see {@link useApplyResource} — apply/push behavior hook (headless)
 */
export declare function ArtifactPreviewContent({ artifact, executionId, org, isTerminal, onClose, onApplied, className, }: ArtifactPreviewContentProps): import("react/jsx-runtime").JSX.Element;
/** Props for {@link ArtifactPreviewModal}. */
export interface ArtifactPreviewModalProps {
    /** The execution artifact to preview. */
    readonly artifact: ExecutionArtifact;
    /** ID of the execution that produced this artifact. */
    readonly executionId: string;
    /** Organization slug for the "Apply to [org]" / "Push Skill to [org]" CTA. */
    readonly org: string;
    /**
     * Whether the execution is in a terminal phase (completed, failed,
     * cancelled, terminated). Controls Apply/Push CTA availability:
     *
     * - `true` — CTA renders as an enabled primary button
     * - `false` — CTA renders as a disabled secondary button
     */
    readonly isTerminal: boolean;
    /** Controls modal visibility. `true` opens the dialog via `showModal()`. */
    readonly open: boolean;
    /** Called when the modal should close (Escape key or close button). */
    readonly onClose: () => void;
    /**
     * Called after a resource is successfully applied or a skill package
     * is pushed. The consumer can use this for post-apply behavior such
     * as showing a toast or navigating to the Library.
     */
    readonly onApplied?: (result: ApplyResourceResult) => void;
    /** Additional CSS classes for the dialog element. */
    readonly className?: string;
}
/**
 * Full preview modal for execution artifacts using a native `<dialog>`.
 *
 * Thin shell around {@link ArtifactPreviewContent} that adds
 * `showModal()` / `close()` lifecycle, `::backdrop` overlay, focus
 * trap, and Escape key handling — with no dependency on
 * `@base-ui/react`.
 *
 * The content component is conditionally mounted when `open` is true,
 * so all internal state (detection, apply result, clipboard) resets
 * automatically when the dialog closes.
 *
 * @example
 * ```tsx
 * const [previewArtifact, setPreviewArtifact] =
 *   useState<ExecutionArtifact | null>(null);
 *
 * {previewArtifact && (
 *   <ArtifactPreviewModal
 *     artifact={previewArtifact}
 *     executionId={execution.id}
 *     org={activeOrg}
 *     isTerminal={isTerminalPhase(execution.status?.phase)}
 *     open
 *     onClose={() => setPreviewArtifact(null)}
 *     onApplied={(result) => toast(`${result.kind} applied`)}
 *   />
 * )}
 * ```
 *
 * @see {@link ArtifactPreviewContent} — the content component (use directly for non-dialog contexts)
 * @see {@link ArtifactCard} — compact card that triggers preview via `onPreview`
 */
export declare function ArtifactPreviewModal({ artifact, executionId, org, isTerminal, open, onClose, onApplied, className, }: ArtifactPreviewModalProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=ArtifactPreviewModal.d.ts.map