/**
 * Attachments Store - manages user attachments through Context.
 *
 * Attachments are persisted through Context.setAttachments() which ensures
 * they are included in Context serialization (toRecord/fromRecord).
 */
import type { Attachment } from "@superblocksteam/library-shared/types";
import type { ContextV2 } from "../llm/context-v2/context.js";
type LoadedContext = ContextV2;
/** Common fields for all stored attachments */
interface StoredAttachmentBase {
    id: number;
    fileName?: string;
    label?: string;
    insight?: string;
    originalMessage?: string;
    createdAt: number;
    updatedAt: number;
}
/** Stored image attachment */
export interface StoredImageAttachment extends StoredAttachmentBase {
    type: "image";
    imageDataUrl: string;
}
/** Stored PDF attachment */
export interface StoredPdfAttachment extends StoredAttachmentBase {
    type: "pdf";
    data: string;
    size?: number;
}
/** Stored archive attachment (zip, tgz, gz) */
export interface StoredArchiveAttachment extends StoredAttachmentBase {
    type: "archive";
    data: string;
    size?: number;
}
/** Stored text attachment (CSV, JSON, YAML, CSS, TXT) */
export interface StoredTextAttachment extends StoredAttachmentBase {
    type: "csv" | "json" | "yaml" | "css" | "txt";
    content: string;
    mimeType: string;
    size?: number;
}
/** Stored uploaded attachment reference */
export interface StoredUploadedAttachment extends StoredAttachmentBase {
    type: "uploaded";
    url: string;
    signedUrl?: string;
    mediaType: string;
    storageKey?: string;
    signedUrlExpiresAt?: string;
    scopeType?: "org" | "app";
    applicationId?: string;
}
/** Stored attachment with allocated ID and timestamps - supports all attachment types */
export type StoredAttachment = StoredArchiveAttachment | StoredImageAttachment | StoredPdfAttachment | StoredTextAttachment | StoredUploadedAttachment;
/**
 * Attachments data stored within the context record.
 */
export type AttachmentsRecord = {
    /** Next attachment ID to allocate */
    nextId: number;
    /** Array of stored attachments */
    attachments: StoredAttachment[];
};
/** Compact attachment info returned by listAttachments (excludes base64/content) */
export interface AttachmentInfo {
    id: number;
    classification: "inline_native" | "reference_only";
    type: StoredAttachment["type"];
    fileName?: string;
    label?: string;
    insight?: string;
    mediaType: string;
    originalMessage?: string;
    scopeType?: "org" | "app";
    storageKey?: string;
}
export interface ListAttachmentsOptions {
    mediaType?: string;
    scopeType?: "org" | "app";
}
export declare class AttachmentsStore {
    private getAttachments;
    appendAttachments(context: LoadedContext, attachments: Attachment[], originalMessage?: string): StoredAttachment[];
    listAttachments(context: LoadedContext, options?: ListAttachmentsOptions): AttachmentInfo[];
    private getAttachmentMediaType;
    getAttachmentsByIds(context: LoadedContext, ids: number[]): StoredAttachment[];
    getUploadedAttachmentsByStorageKeys(context: LoadedContext, storageKeys: string[]): StoredUploadedAttachment[];
    static toAttachments(stored: StoredAttachment[]): Attachment[];
}
export {};
//# sourceMappingURL=store.d.ts.map