import { CallToolResult } from "@modelcontextprotocol/sdk/types"; import { ImageMetadataBlock } from "./shared/types"; /** * Represents a ClickUp text item which can be plain text or an image */ export interface ClickUpTextItem { text?: string; type?: string; task_mention?: { task_id?: string; }; image?: { id?: string; name?: string; title?: string; type?: string; extension?: string; thumbnail_large?: string; thumbnail_medium?: string; thumbnail_small?: string; url: string; uploaded?: boolean; }; attributes?: any; } /** * Represents a ClickUp attachment */ export interface ClickUpAttachment { thumbnail_large?: string; thumbnail_medium?: string; thumbnail_small?: string; url: string; [key: string]: any; } /** * Process an array of ClickUp text items into a structured content format * that includes both text and images in their original sequence * * @param textItems Array of text items from ClickUp API * @returns Promise resolving to an array of content blocks (text and images) */ export declare function convertClickUpTextItemsToToolCallResult(textItems: ClickUpTextItem[]): Promise<(CallToolResult["content"][number] | ImageMetadataBlock)[]>; /** * Splits markdown text at image references and converts them to image blocks * @param markdownText The markdown text to process * @param attachments Array of attachments from the Clickup API * @returns Array of content blocks (text and images) */ export declare function convertMarkdownToToolCallResult(markdownText: string, attachments: ClickUpAttachment[] | null | undefined): (CallToolResult["content"][number] | ImageMetadataBlock)[]; /** * Represents a ClickUp comment block with formatting */ export interface ClickUpCommentBlock { text?: string; type?: string; attributes?: { bold?: boolean; italic?: boolean; strike?: boolean; code?: boolean; link?: string; 'code-block'?: { 'code-block': string; }; header?: number; blockquote?: {}; 'blockquote-size'?: 'large'; list?: { list: 'bullet' | 'ordered' | 'unchecked' | 'checked'; }; indent?: number; 'block-id'?: string; alt?: string; }; list?: { list: 'bullet' | 'ordered' | 'unchecked' | 'checked'; }; /** * Present on task mention fragments. ClickUp renders these as live task references * showing the current task name, status and assignee. */ task_mention?: { task_id: string; }; /** * Present on image fragments. ClickUp only renders a preview when this holds the * complete attachment object from the upload response - a bare URL string produces * an empty placeholder tile. */ image?: { id?: string; name?: string; title?: string; extension?: string; url: string; thumbnail_small?: string; thumbnail_medium?: string; thumbnail_large?: string; width?: number; height?: number; }; } /** * Minimal shape needed to embed an already-uploaded attachment as an image fragment */ export interface EmbeddableAttachment { id?: string; name?: string; title?: string; extension?: string; url: string; thumbnail_small?: string; thumbnail_medium?: string; thumbnail_large?: string; width?: number; height?: number; [key: string]: any; } /** * Build the image fragment ClickUp needs to render an inline image in a comment. * `title`/`text` carry the caption; the rest is copied straight from the upload response. */ export declare function buildImageFragment(attachment: EmbeddableAttachment, caption: string): ClickUpCommentBlock; /** * Extract the task ID from a ClickUp task URL, or null if it is not one. */ export declare function parseClickUpTaskUrl(url: string): string | null; /** * Wrap image destinations that contain spaces in angle brackets. * * CommonMark rejects a bare destination with spaces, so `![x](/tmp/Screen Shot.png)` * is not an image at all - it would silently stay literal text and never be uploaded. * Screenshot filenames have spaces constantly ("Screenshot 2026-07-27 at 14.30.png"), * so normalising to the `<...>` form is what makes the obvious thing work. */ export declare function normalizeImageDestinations(markdown: string): string; /** * Collect every image reference in a markdown document, in document order. * Callers use this to know what needs uploading before converting. */ export declare function collectMarkdownImageSources(markdown: string): { src: string; alt: string; }[]; /** * Replace image sources in markdown with their uploaded ClickUp URLs. * * Used for task descriptions: `markdown_description` renders `![alt](url)` directly, * so descriptions need no fragment handling - only the URL has to be swapped. * Images without an upload keep their original source untouched. */ export declare function rewriteMarkdownImageUrls(markdown: string, attachmentsBySrc: Map): string; /** * Convert markdown text to ClickUp comment blocks format using remark * Supports: headers, bold, italic, code, links, lists, blockquotes, code blocks, images * * @param markdown The markdown text to convert * @param attachmentsBySrc Uploaded attachments keyed by the markdown `src` they came from. * Images without an entry degrade to a link so their information is not lost. * @returns Array of ClickUp comment blocks */ export declare function convertMarkdownToClickUpBlocks(markdown: string, attachmentsBySrc?: Map): ClickUpCommentBlock[]; //# sourceMappingURL=clickup-text.d.ts.map