import { ReactNode } from 'react'; interface AgentCustomMentionIdentity { entityId: string; label: string; scope?: Readonly>; } interface AgentCustomMentionPresentation { /** chip 第一行(缺省用链接 label)。 */ name: string; /** chip 第二行(可选,通用双行卡的次要文案)。 */ summary?: string; /** 所属 workspace(可选;custom kind 的 scope 键由注册方约定)。 */ workspaceId?: string; } interface AgentCustomMentionChipContext { href: string; name: string; summary?: string; isEditable: boolean; /** 可编辑态的移除按钮,由 NodeView 注入;自定义渲染需自行摆放。 */ removeAction?: ReactNode; } interface AgentCustomMentionKindDefinition { /** mention:///... 的 providerId(URL hostname,小写)。 */ kind: string; /** * 从 canonical mention 链接提取展示字段;返回 null 表示链接无效, * 退化为普通链接/字面文本。 */ present(mention: AgentCustomMentionIdentity, href: string): AgentCustomMentionPresentation | null; /** * Materializes this mention into provider-visible prompt text immediately * before the runtime send boundary. The canonical mention remains the * display prompt used by the composer and conversation timeline. */ materializePromptText?(mention: AgentCustomMentionIdentity, href: string): string | null; /** 自定义 chip 渲染;缺省用包内通用双行卡(name + summary)。 */ renderChip?(context: AgentCustomMentionChipContext): ReactNode; /** 点击是否上抛 open-custom-mention 链接动作;缺省 false(chip 只展示)。 */ clickable?: boolean; } declare function registerAgentCustomMentionKind(definition: AgentCustomMentionKindDefinition): void; declare function getAgentCustomMentionKind(kind: string): AgentCustomMentionKindDefinition | undefined; declare function resetAgentCustomMentionKindsForTests(): void; declare const AGENT_PASTED_TEXT_BLOCK_KIND = "pasted-text"; declare const AGENT_PASTED_TEXT_MENTION_KIND = "pasted-text"; export { AGENT_PASTED_TEXT_BLOCK_KIND, AGENT_PASTED_TEXT_MENTION_KIND, type AgentCustomMentionChipContext, type AgentCustomMentionIdentity, type AgentCustomMentionKindDefinition, type AgentCustomMentionPresentation, getAgentCustomMentionKind, registerAgentCustomMentionKind, resetAgentCustomMentionKindsForTests };