import type { AgentChatAttachment } from "../agent/types.js"; export interface PreUploadedImageAttachment { name?: string; url: string; provider: string; contentType?: string; } /** * A file/non-image attachment that was successfully uploaded to a hosted URL. * Consumers can use the URL in place of the base64 data to avoid persisting * large blobs in the thread repo and SQL. */ export interface PreUploadedFileAttachment { name?: string; url: string; provider: string; contentType?: string; sizeBytes?: number; referenceOnly?: boolean; securityNote?: string; } export interface PreUploadAttachmentsResult { /** Same array reference. Each image attachment that was uploaded also gets a * `url` property attached (non-breaking; consumers that don't read it are * unaffected). */ attachments: AgentChatAttachment[]; /** Set when at least one image was uploaded. List of hosted URLs the agent * can embed in HTML, slide content, documents, etc. */ uploaded: PreUploadedImageAttachment[]; /** Uploaded non-image files (PDF, generic binary). Parallel to `uploaded` * but for the file/document attachment type. */ uploadedFiles: PreUploadedFileAttachment[]; /** True if at least one image attachment failed to upload because no * file-upload provider is configured. Templates use this to render a * "Connect Builder.io" suggestion. */ providerMissing: boolean; /** A pre-formatted block to inject into the user message text so the agent * has each hosted URL inline. Null when nothing was uploaded or no provider * is configured. */ injectedText: string | null; } /** * Returns true when a file-upload provider is currently configured. * Used to decide whether to attempt upload-first or fall back to base64. */ export declare function isFileUploadProviderConfigured(): boolean; /** * Pre-upload chat image attachments through the active file-upload provider * (Builder.io by default) so the agent can embed hosted URLs in HTML, slide * content, and outbound messages. Keeps the original base64 data URL on the * attachment so multimodal vision still works — only adds a hosted `url`. * * Safe to call when no provider is configured: it returns the attachments * untouched with `providerMissing: true` so callers can surface a connect- * Builder.io hint to the agent. */ export declare function preUploadImageAttachments(opts: { attachments: AgentChatAttachment[] | undefined; ownerEmail: string | null | undefined; }): Promise; /** * Pre-upload ALL chat attachments (images AND files/PDFs) through the active * file-upload provider. When a provider is configured, each attachment gets a * `url` property injected so downstream code can store/send URLs instead of * base64. The base64 data is kept in-memory for the current turn so vision and * file-reading still work; callers that persist the attachment can drop the * data when a URL exists. * * Falls back gracefully when no provider is configured: returns untouched * attachments with `providerMissing: true` for image-type failures. */ export declare function preUploadAttachments(opts: { attachments: AgentChatAttachment[] | undefined; ownerEmail: string | null | undefined; /** When false, only images are uploaded (legacy behaviour). Default: true */ includeFiles?: boolean; }): Promise; //# sourceMappingURL=pre-upload-attachments.d.ts.map