type OwnedUrlReadFailureCode = "invalid-url" | "ownership-check-failed" | "unowned-url" | "fetch-failed" | "redirect-rejected" | "response-rejected" | "request-candidate-limit" | "request-byte-limit" | "request-time-limit" | "empty-response"; export type OwnedImageReadFailureCode = OwnedUrlReadFailureCode | "image-too-large" | "invalid-image"; export type OwnedFileReadFailureCode = OwnedUrlReadFailureCode | "file-too-large" | "invalid-file"; export type OwnedAttachmentReadFailureCode = OwnedImageReadFailureCode | OwnedFileReadFailureCode; export type OwnedAttachmentReadFailure = { name: string; code: OwnedImageReadFailureCode; attachmentType: "image"; } | { name: string; code: OwnedFileReadFailureCode; attachmentType: "file"; }; export type OwnedImageHydrationResult = { kind: "hydrated"; dataUrl: string; mediaType: string; provider: string; } | { kind: "failed"; code: Exclude; } | { kind: "unowned"; code: "unowned-url"; }; export type OwnedFileHydrationResult = { kind: "hydrated"; dataUrl: string; mediaType: string; provider: string; } | { kind: "failed"; code: Exclude; } | { kind: "unowned"; code: "unowned-url"; }; export declare const MAX_OWNED_IMAGE_FETCH_BYTES: number; export declare const MAX_OWNED_INLINE_FILE_BYTES: number; export declare const MAX_OWNED_ATTACHMENT_HYDRATION_CANDIDATES = 6; export declare const MAX_OWNED_IMAGE_HYDRATION_CANDIDATES = 6; export declare const MAX_OWNED_ATTACHMENT_HYDRATION_BYTES: number; /** * Text and SVG are decoded and shown as a head plus a stored copy, never sent * whole, so they get their own per-file cap and request pool; sharing the * image/PDF pool would let one large text file starve its sibling images. * The composer's AGENT_PROMPT_MAX_TEXT_FILE_BYTES must match the per-file cap, * or its chip promises a read the server refuses. */ export declare const MAX_OWNED_TEXT_FILE_BYTES: number; export declare const MAX_OWNED_TEXT_HYDRATION_BYTES: number; export declare const MAX_OWNED_IMAGE_HYDRATION_BYTES: number; export declare const OWNED_ATTACHMENT_HYDRATION_TIMEOUT_MS = 20000; export declare const OWNED_IMAGE_HYDRATION_TIMEOUT_MS = 20000; export interface OwnedAttachmentHydrationBudget { deadlineAt: number; remainingCandidates: number; remainingBytes: number; remainingTextBytes: number; } export type OwnedAttachmentBytePool = "remainingBytes" | "remainingTextBytes"; export declare function ownedAttachmentBytePool(declaredMediaType: string | undefined): OwnedAttachmentBytePool; export type OwnedImageHydrationBudget = OwnedAttachmentHydrationBudget; export declare function createOwnedAttachmentHydrationBudget(now?: number): OwnedAttachmentHydrationBudget; export declare function claimOwnedAttachmentHydrationCandidate(budget: OwnedAttachmentHydrationBudget): boolean; export declare const createOwnedImageHydrationBudget: typeof createOwnedAttachmentHydrationBudget; /** * Hydrate only HTTPS URLs positively claimed by configured upload storage. * A public URL is still untrusted input: never follow redirects or send caller * credentials, and bound the streamed response before it reaches a model. */ export declare function hydrateOwnedImageUrl(value: string, declaredMediaType?: string, budget?: OwnedAttachmentHydrationBudget): Promise; export declare function hydrateOwnedFileUrl(value: string, declaredMediaType: string | undefined, fileName: string | undefined, budget?: OwnedAttachmentHydrationBudget): Promise; export declare function describeOwnedImageReadFailure(code: OwnedImageReadFailureCode): string; export declare function describeOwnedFileReadFailure(code: OwnedFileReadFailureCode): string; export {};