import type { string_html, string_markdown } from '../../../types/string_markdown'; /** * Attribute marking a client action generated for an inline-reference menu. * * @private utility shared with `MarkdownContent` */ export declare const MARKDOWN_INLINE_REFERENCE_MENU_ACTION_ATTRIBUTE = "data-promptbook-inline-reference-menu-action"; /** * Attribute identifying the inline reference which owns a client menu action. * * @private utility shared with `MarkdownContent` */ export declare const MARKDOWN_INLINE_REFERENCE_MENU_ACTION_REFERENCE_ATTRIBUTE = "data-promptbook-inline-reference-menu-action-reference"; /** * Attribute marking a favicon rendered inside an inline-reference chip. * * @private utility shared with `MarkdownContent` */ export declare const MARKDOWN_INLINE_REFERENCE_ICON_ATTRIBUTE = "data-promptbook-inline-reference-icon"; /** * Options for markdown rendering. */ type RenderMarkdownOptions = { readonly citationReferenceClassName?: string; readonly inlineReferences?: ReadonlyArray; readonly inlineReferenceClassName?: string; }; /** * One inline markdown reference converted from `[[reference]]` into a safe link chip. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReference = { /** * Raw reference text between `[[` and `]]`. */ readonly reference: string; /** * Optional text aliases which should render as this reference when an agent mentions them in markdown. * * They are also accepted inside a `[[reference]]` token. This lets application code use a stable * technical reference while recognizing a human-facing name in older messages. */ readonly sourceTextAliases?: ReadonlyArray; /** * Human-readable label rendered inside the link chip. */ readonly label: string; /** * Link target for the rendered reference. */ readonly href: string; /** * Optional URL prefixes which also identify this reference in the authored markdown. * * A markdown link or a bare URL pointing to one of these prefixes is rendered as the same chip * as the `[[reference]]` token. Both absolute URLs (for example `https://project.example.com`) * and application paths (for example `/agents/agent/projects/website`) are supported; a path * prefix matches on any host so that both relative and absolute links are recognized. */ readonly sourceHrefPrefixes?: ReadonlyArray; /** * Optional hover title for the rendered reference. */ readonly title?: string; /** * Optional favicon and text fallback rendered before the reference label. */ readonly icon?: MarkdownInlineReferenceIcon; /** * Optional expandable menu shown when the reference chip is clicked. */ readonly menu?: MarkdownInlineReferenceMenu; }; /** * Visual identity rendered inside one markdown inline-reference chip. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReferenceIcon = { /** * Optional image URL. The fallback remains visible when the image is unavailable. */ readonly src?: string | null; /** * Short text rendered when the image is missing or broken. */ readonly fallbackText: string; }; /** * Status displayed alongside an expandable markdown inline reference. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReferenceMenuStatus = { /** * Accessible text describing the current reference status. */ readonly label: string; /** * Whether the status should be rendered as active. */ readonly isActive: boolean; }; /** * One destination in an expandable markdown inline reference menu. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReferenceMenuOption = { /** * Text rendered for the option. */ readonly label: string; /** * New-tab destination, or `null` while the option is unavailable. */ readonly href: string | null; /** * Optional hover text for the option. */ readonly title?: string; /** * Optional client action rendered as a button instead of a link. */ readonly action?: MarkdownInlineReferenceMenuAction; }; /** * Client-side action exposed by an expandable markdown inline-reference menu. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReferenceMenuAction = { /** * Stable identifier unique within the owning reference menu. */ readonly id: string; /** * Callback invoked when the menu button is selected. */ readonly onSelect: () => void | Promise; }; /** * Expandable menu configuration for a markdown inline reference. * * @public exported from `@promptbook/components` */ export type MarkdownInlineReferenceMenu = { /** * Current reference status shown in the chip and menu. */ readonly status: MarkdownInlineReferenceMenuStatus; /** * New-tab actions listed in the expanded menu. */ readonly options: ReadonlyArray; }; /** * Convert markdown content to HTML. * * @param markdown - The markdown content to convert. * @returns HTML string ready for rendering. * * @private internal utility of chat components and exports */ export declare function renderMarkdown(markdown: string_markdown, options?: RenderMarkdownOptions): string_html; /** * Detects whether text appears to contain markdown syntax. * * @param markdown - The text to inspect. * @returns Whether the text contains known markdown markers. * * @private internal utility of chat components and exports */ export declare function isMarkdownContent(markdown: string_markdown): boolean; export {};