/** Modern DSH conversation node that keeps completed image artifacts outside Compact process folding. */ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'; export declare const IMAGE_RESULT_NODE_KIND = "dsh-image-result"; export interface ImageResultPresentation { readonly attachment: ImageAttachmentRef; readonly prompt: string; readonly provider: string; readonly model: string; readonly output: string; readonly savedTo?: string; /** Workflow seed reported by the ComfyUI provider, when available. */ readonly seed?: number; /** Attachment ids of the edit sources when this image came from edit_image; used to rebuild canvas edit chains. */ readonly sourceAttachmentIds?: readonly string[]; } interface ImageResultState { /** Owning conversation turn; PTC (run_code) sub-call results carry no turn. */ readonly turn?: number; readonly results: readonly (ImageResultPresentation & { readonly seq: number; })[]; readonly answerSeq?: number; readonly endSeq?: number; } interface EventLike { readonly type: string; readonly seq: number; readonly data: Record; } interface MatchLike { readonly event: EventLike; readonly location: unknown; } interface ContextLike { readonly key: string; readonly id: string; readonly matches: readonly MatchLike[]; readonly start?: MatchLike; readonly state?: State; } interface ConversationNodeDefinitionLike { readonly kind: string; readonly target: 'chat'; match(event: EventLike): { id: string; role: 'start' | 'update'; } | null; start(context: ContextLike, match: MatchLike, reader: unknown): State; update(context: ContextLike & { readonly state: State; }, match: MatchLike): State; buildViewNode(context: ContextLike): Record | null; } /** Options controlling where the artifact anchors as its Turn progresses. */ export interface ImageResultNodeOptions { /** * Whether the host transcript view folds completed-Turn process content * (Compact mode). Omission or a thrown/unavailable read falls back to * Compact-safe anchoring, which keeps the artifact always visible. */ readonly isCompactTranscript?: () => boolean; } /** Default definition: unknown transcript mode falls back to Compact-safe anchoring. */ export declare const imageResultDefinition: ConversationNodeDefinitionLike; /** * One image result row per Turn, anchored at its own tool/result position while * the Turn runs, then optionally re-anchored beside the final answer once the * Turn closes (only needed under the folding Compact transcript view). */ export declare function createImageResultDefinition(options?: ImageResultNodeOptions): ConversationNodeDefinitionLike; /** Parse the plugin-owned durable presentation metadata from a Tool result event. */ export declare function imageResultFromMeta(value: unknown): ImageResultPresentation | undefined; /** * Parse a plugin image result from a tool/ptc-dispatch event (#38). PTC * run_code sub-calls carry neither a turn nor presentationMeta, so the result * is rebuilt from the dispatch payload itself: the image content block for the * attachment, arguments for the prompt (and edit source ids), and the tool's * fixed-format summary text for provider/model/output. Returns undefined for * anything that is not a successful image result from our own image tools. */ export declare function imageResultFromPtcDispatch(event: EventLike): ImageResultPresentation | undefined; export {};