import * as react from 'react'; import { ReactNode } from 'react'; /** * PromptInput — the chat composer every AI app rebuilds. Auto-growing * multi-line input with: * * • slash-command picker (`/` triggers a filtered command palette, * ↑/↓ navigate, Enter inserts) * • mention picker (`@` triggers, filtered against `mentions`) * • drop-to-attach (drag files anywhere on the surface), paste-to-attach * (a pasted screenshot becomes an attachment) + chip bar * • submit on ⌘/Ctrl+Enter (plain Enter inserts a newline) * • live token-budget meter (green → amber → red as headroom drops) * * Wire it up: * * sendToAgent(text, attachments)} * /> */ type PromptCmd = { name: string; hint: string; }; type PromptMention = { id: string; name: string; kind: "agent" | "file" | "person" | string; }; type PromptAttachment = { id: string; name: string; bytes: number; /** * The file the user actually attached. * * Optional because an attachment restored from a server has no File — but for * anything the user dropped or picked it is always present. Without it a host * can render a chip and nothing else: no POST, no FormData, no send-to-model. */ file?: File; /** MIME type. Hosts branch on this to decide whether a file can be sent as-is. */ type?: string; }; interface PromptInputProps { /** Token budget for the meter. */ budgetTokens: number; /** Slash-commands. Names must start with `/`. */ commands?: PromptCmd[]; /** @-mentions. */ mentions?: PromptMention[]; /** Show the keyboard hint ("⌘ + Enter to send"). */ showHint?: boolean; /** Called on ⌘/Ctrl+Enter or send button. */ onSubmit: (text: string, attachments: PromptAttachment[]) => void; /** Placeholder text. */ placeholder?: string; /** Rough estimator: chars-per-token. Defaults to 4. */ charsPerToken?: number; /** Color → CSS chip mapping for mention kinds. */ mentionColor?: Record; /** Optional max textarea height in px. Defaults to 280. */ maxHeight?: number; /** * Rendered INSIDE the rounded shell, ABOVE the attachments bar and * textarea. Use this slot for a drawer of tools/files/prompts/etc. so * the drawer and composer share one visual panel. See {@link ChatDrawer}. */ aboveInput?: ReactNode; } declare function PromptInput({ budgetTokens, commands, mentions, showHint, onSubmit, placeholder, charsPerToken, mentionColor, maxHeight, aboveInput, }: PromptInputProps): react.JSX.Element; export { type PromptAttachment, type PromptCmd, PromptInput, type PromptInputProps, type PromptMention };