/** * Turning a durable attachment reference into a URL the browser can paint. * * The official conversation service has its own image cache, but it does not * expose it on the outward `IConversation` face, and reaching past that face * into another plugin's implementation is exactly what the client boundary * forbids. So this owns a small cache of its own, over the PUBLIC session verb * (`readAttachment`) — the same authorization path chat history uses. * * Object URLs are revoked, never merely forgotten: an image that stays alive * after its row is gone pins the bytes for the life of the page, and reading a * 2000×1500 screenshot on every tool call adds up quickly. */ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'; import type { ISessions, SessionId } from '@deepseek-ai/dsh-client-runtime/client'; /** Loads one session-authorized durable image URL. */ export type ImageLoader = (attachment: ImageAttachmentRef) => Promise; /** * A per-page cache of resolved image URLs, keyed by session and attachment. * * One instance per plugin activation; `dispose` releases every URL it minted, * so a plugin reload does not strand them. */ export declare class SessionImageCache { #private; /** * @param sessions - accessor for the runtime's session registry (read per * call, so a cache built at activation still sees a later registry). */ constructor(sessions: () => ISessions); /** * Resolve one image, reusing an in-flight or completed load. * @param sessionId - the authorization scope the image is read under. * @param attachment - the durable reference from the tool result. * @returns a URL valid until this cache is disposed. */ resolve(sessionId: SessionId, attachment: ImageAttachmentRef): Promise; /** Release every URL this cache minted. */ dispose(): void; } //# sourceMappingURL=image-loader.d.ts.map