import { PersistedMessageUploadContext } from "./file-upload.js";
import { AttachmentArtifactRef } from "./attachment-artifacts.js";
import { MessageContent, Part } from "@inkeep/agents-core";

//#region src/domains/run/services/blob-storage/file-upload-helpers.d.ts

/**
 * Fetches each remote `application/pdf` file part (http(s) `uri`), replaces it with an inline
 * base64 `bytes` part. Full response bodies are buffered in memory up to the same limit as
 * `downloadExternalFile` (see `MAX_FILE_BYTES`); streaming ingestion is not supported yet.
 */
declare function inlineExternalPdfUrlParts(parts: Part[]): Promise<Part[]>;
/**
 * Stamp each uploaded file part with the matching artifact's `artifactId` + `toolCallId`
 * (correlated by blob URI) so downstream persistence and history rebuilds can emit a
 * self-describing `<attached_file ... artifact_id="..." tool_call_id="..." />` marker that
 * carries everything needed to fetch the artifact.
 */
declare function attachArtifactRefsToFileParts(parts: Part[], refs: AttachmentArtifactRef[]): Part[];
declare function expandTextFilePartsWithDecodedText(parts: Part[]): Promise<Part[]>;
declare function buildPersistedMessageContent(text: string, parts: Part[], ctx: PersistedMessageUploadContext & {
  skipArtifactCreation?: boolean;
}): Promise<MessageContent>;
//#endregion
export { attachArtifactRefsToFileParts, buildPersistedMessageContent, expandTextFilePartsWithDecodedText, inlineExternalPdfUrlParts };