diff --git a/src/features/agent-attachments/core/domain/capabilities.ts b/src/features/agent-attachments/core/domain/capabilities.ts index d039587a..279e1560 100644 --- a/src/features/agent-attachments/core/domain/capabilities.ts +++ b/src/features/agent-attachments/core/domain/capabilities.ts @@ -1,7 +1,7 @@ import type { AgentAttachmentCapability, AgentAttachmentCapabilityTarget, - ProviderImageMimeType, + AgentImageMimeType, } from './types'; const DEFAULT_IMAGE_BYTES_PER_PROVIDER = 4 * 1024 * 1024; @@ -18,7 +18,7 @@ export const CLAUDE_IMAGE_MIME_TYPES = [ function supportedImagesOnly( displayText: string, - supportedImageMimeTypes: readonly ProviderImageMimeType[] = NATIVE_IMAGE_MIME_TYPES + supportedImageMimeTypes: readonly AgentImageMimeType[] = NATIVE_IMAGE_MIME_TYPES ): AgentAttachmentCapability { return { supportsImages: true, diff --git a/src/features/agent-attachments/core/domain/types.ts b/src/features/agent-attachments/core/domain/types.ts index cf30d3e6..1e0b3e09 100644 --- a/src/features/agent-attachments/core/domain/types.ts +++ b/src/features/agent-attachments/core/domain/types.ts @@ -3,7 +3,6 @@ export const AGENT_ATTACHMENT_SCHEMA_VERSION = 1 as const; export type AgentAttachmentKind = 'image' | 'file' | 'unsupported'; export type AgentImageMimeType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp'; -export type ProviderImageMimeType = AgentImageMimeType; export type ProviderFileMimeType = 'application/pdf' | 'text/*'; export type AttachmentDeliveryFailureCode = @@ -98,7 +97,7 @@ export interface AgentAttachmentCapabilityTarget { export interface AgentAttachmentCapability { supportsImages: boolean; supportsFiles: boolean; - supportedImageMimeTypes: ProviderImageMimeType[]; + supportedImageMimeTypes: AgentImageMimeType[]; supportedFileMimeTypes: ProviderFileMimeType[]; maxImages: number; maxFiles: number; diff --git a/src/features/agent-attachments/core/domain/validation.ts b/src/features/agent-attachments/core/domain/validation.ts index 74805ae3..6e63e6aa 100644 --- a/src/features/agent-attachments/core/domain/validation.ts +++ b/src/features/agent-attachments/core/domain/validation.ts @@ -7,7 +7,6 @@ import type { AgentImageMimeType, AttachmentValidationResult, ImageOptimizationBudget, - ProviderImageMimeType, } from './types'; const AGENT_IMAGE_MIME_TYPES = new Set([ @@ -23,7 +22,7 @@ const OPTIMIZABLE_AGENT_IMAGE_MIME_TYPES = new Set([ +const PROVIDER_IMAGE_MIME_TYPES = new Set([ 'image/png', 'image/jpeg', 'image/gif', @@ -34,8 +33,8 @@ export function isAgentImageMimeType(mimeType: string): mimeType is AgentImageMi return AGENT_IMAGE_MIME_TYPES.has(mimeType as AgentImageMimeType); } -export function isProviderImageMimeType(mimeType: string): mimeType is ProviderImageMimeType { - return PROVIDER_IMAGE_MIME_TYPES.has(mimeType as ProviderImageMimeType); +export function isProviderImageMimeType(mimeType: string): mimeType is AgentImageMimeType { + return PROVIDER_IMAGE_MIME_TYPES.has(mimeType as AgentImageMimeType); } function isOptimizableAgentImageMimeType( @@ -54,9 +53,9 @@ function isProviderFileMimeType(mimeType: string, supported: readonly string[]): function isCapabilityImageMimeType( mimeType: string, - supported: readonly ProviderImageMimeType[] + supported: readonly AgentImageMimeType[] ): boolean { - return supported.includes(mimeType as ProviderImageMimeType); + return supported.includes(mimeType as AgentImageMimeType); } export function classifyAttachmentMime(mimeType: string): AgentAttachmentKind {