import type { Context } from '@deepseek-ai/cordis'; import type { ImageAttachmentRef, StoredImageAttachment } from '@deepseek-ai/dsh-attachment'; import { LlmAdapter, type GenerateOptions, type LlmModelInfo, type LlmResolvedModelInfo, type StreamChunk, type UserMessage } from '@deepseek-ai/dsh-llm'; import type { SessionId } from '@deepseek-ai/dsh-session'; import type { VisionAnalyzeResult, VisionBackend } from './backend.ts'; import { type ResolvedConfig } from './config.ts'; import { CallId, type VisionCallRecord } from './history.ts'; /** Hook that can finish a preprocessing-only Mix step before base-model delegation. */ export type DeferBaseModel = (options: GenerateOptions) => Promise; interface AttachmentReader { readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise; } interface HistoryWriter { append(record: VisionCallRecord): Promise; } /** Dependencies kept explicit so message and tool-image processing are independently testable. */ export interface TransformDependencies { backend: VisionBackend; attachments: AttachmentReader; history: HistoryWriter; now?: () => number; createCallId?: () => CallId; } /** One image-analysis request owned by a live session. */ export interface AnalyzeAttachmentRequest { sessionId: SessionId; origin: VisionCallRecord['origin']; attachment: ImageAttachmentRef; prompt: string; signal?: AbortSignal; } /** One pre-step transformation request owned by a live session. */ export interface TransformRequest { sessionId: SessionId; messages: readonly UserMessage[]; signal?: AbortSignal; } /** Render the exact text sent beside an image to the selected image model. */ export declare function renderVisionPrompt(request: string): string; /** Return the text portion of one user message. */ export declare function requestText(message: UserMessage): string; /** Return the text supplied by the current claimed user-message batch. */ export declare function requestBatchText(messages: readonly UserMessage[]): string; /** Whether a text request explicitly points back to an image in the session. */ export declare function explicitlyReferencesImage(request: string): boolean; /** Parse the strict JSON response requested from the image-reference classifier. */ export declare function parseImageReferenceDecision(value: string): boolean; /** Stable logical locator for one opaque DSH attachment id. */ export declare function attachmentLocator(attachment: ImageAttachmentRef): string; /** Replace image bytes with an actionable, model-readable attachment reference. */ export declare function renderAttachmentReference(attachment: ImageAttachmentRef): string; /** Build the durable plugin context that represents image pixels to a text-only model. */ export declare function createAnalysisContext(title: string, result: string, attachment: ImageAttachmentRef): UserMessage; /** Analyze and record one attachment through the configured backend. */ export declare function analyzeAttachment(request: AnalyzeAttachmentRequest, dependencies: TransformDependencies): Promise; /** Analyze only the new messages supplied for one pre-step and return text contexts for their images. */ export declare function analyzeMessageImages(request: TransformRequest, dependencies: TransformDependencies): Promise; /** Image-admitting Mix route that delegates only text-safe content to the selected base model. */ export declare class MixedAdapter extends LlmAdapter { private readonly ctx; private readonly current; private readonly deferBaseModel?; constructor(ctx: Context, current: () => ResolvedConfig, deferBaseModel?: DeferBaseModel | undefined); providerInfo(provider: string): { id: string; name: string; }; listModels(provider: string): Promise; resolveModel(provider: string, model: string): Promise; stream(options: GenerateOptions): AsyncIterable; } export {}; //# sourceMappingURL=bridge.d.ts.map