@elabs-ai/components-ai 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/_audio-player-media-chrome-KA5DY54G.js +81 -0
- package/dist/_audio-player-media-chrome-KA5DY54G.js.map +1 -0
- package/dist/_flow-boundary-D63PJ65S.js +186 -0
- package/dist/_flow-boundary-D63PJ65S.js.map +1 -0
- package/dist/_interactive-terminal-xterm-ATJ5EW3G.js +11 -0
- package/dist/_interactive-terminal-xterm-ATJ5EW3G.js.map +1 -0
- package/dist/_persona-rive-RFR2EUWP.js +164 -0
- package/dist/_persona-rive-RFR2EUWP.js.map +1 -0
- package/dist/index.d.ts +4079 -0
- package/dist/index.js +11770 -0
- package/dist/index.js.map +1 -0
- package/package.json +87 -0
- package/src/_audio-player-media-chrome.tsx +146 -0
- package/src/_chat-shell-rail.tsx +18 -0
- package/src/_code-block-theme.test.ts +134 -0
- package/src/_code-block-theme.ts +184 -0
- package/src/_flow-boundary.tsx +237 -0
- package/src/_flow-lazy.ts +34 -0
- package/src/_interactive-terminal-xterm.ts +32 -0
- package/src/_lazy-mermaid.test.ts +101 -0
- package/src/_lazy-mermaid.ts +117 -0
- package/src/_persona-rive.tsx +252 -0
- package/src/_streamdown-i18n.ts +119 -0
- package/src/agent-timeline.stories.tsx +66 -0
- package/src/agent-timeline.test.tsx +74 -0
- package/src/agent-timeline.tsx +106 -0
- package/src/agent.tsx +113 -0
- package/src/agentic-workspace.stories.tsx +1099 -0
- package/src/artifact.stories.tsx +62 -0
- package/src/artifact.test.tsx +112 -0
- package/src/artifact.tsx +167 -0
- package/src/asset-preview.stories.tsx +100 -0
- package/src/asset-preview.test.tsx +126 -0
- package/src/asset-preview.tsx +218 -0
- package/src/attachments.tsx +393 -0
- package/src/audio-player.stories.tsx +99 -0
- package/src/audio-player.tsx +170 -0
- package/src/blocks-ai-composer.stories.tsx +83 -0
- package/src/canvas.stories.tsx +142 -0
- package/src/canvas.tsx +29 -0
- package/src/chain-of-thought.tsx +193 -0
- package/src/chat-greeting.stories.tsx +96 -0
- package/src/chat-greeting.test.tsx +91 -0
- package/src/chat-greeting.tsx +91 -0
- package/src/chat-shell.stories.tsx +123 -0
- package/src/chat-shell.test.tsx +113 -0
- package/src/chat-shell.tsx +97 -0
- package/src/chat.stories.tsx +99 -0
- package/src/checkpoint.tsx +54 -0
- package/src/code-block.stories.tsx +81 -0
- package/src/code-block.test.tsx +191 -0
- package/src/code-block.tsx +673 -0
- package/src/commit.tsx +343 -0
- package/src/composer.stories.tsx +188 -0
- package/src/composer.test.tsx +182 -0
- package/src/composer.tsx +202 -0
- package/src/confirmation.stories.tsx +61 -0
- package/src/confirmation.test.tsx +136 -0
- package/src/confirmation.tsx +273 -0
- package/src/connection.tsx +23 -0
- package/src/context-panel.stories.tsx +137 -0
- package/src/context-panel.test.tsx +198 -0
- package/src/context-panel.tsx +609 -0
- package/src/context.stories.tsx +16 -0
- package/src/context.tsx +363 -0
- package/src/controls.tsx +20 -0
- package/src/conversation.stories.tsx +26 -0
- package/src/conversation.test.tsx +123 -0
- package/src/conversation.tsx +143 -0
- package/src/dark-theme-variant.test.ts +47 -0
- package/src/edge.tsx +33 -0
- package/src/environment-variables.tsx +304 -0
- package/src/file-tree.stories.tsx +55 -0
- package/src/file-tree.test.tsx +101 -0
- package/src/file-tree.tsx +390 -0
- package/src/gallery.stories.tsx +182 -0
- package/src/gallery.test.tsx +150 -0
- package/src/gallery.tsx +737 -0
- package/src/grouped-parts.stories.tsx +104 -0
- package/src/grouped-parts.test.tsx +167 -0
- package/src/grouped-parts.tsx +247 -0
- package/src/image.stories.tsx +67 -0
- package/src/image.test.tsx +105 -0
- package/src/image.tsx +115 -0
- package/src/index.ts +93 -0
- package/src/inline-citation.stories.tsx +91 -0
- package/src/inline-citation.test.tsx +96 -0
- package/src/inline-citation.tsx +314 -0
- package/src/interactive-terminal.stories.tsx +165 -0
- package/src/interactive-terminal.test.tsx +448 -0
- package/src/interactive-terminal.tsx +444 -0
- package/src/jsx-preview.stories.tsx +265 -0
- package/src/jsx-preview.test.tsx +75 -0
- package/src/jsx-preview.tsx +409 -0
- package/src/markdown-view.stories.tsx +57 -0
- package/src/markdown-view.test.tsx +36 -0
- package/src/markdown-view.tsx +113 -0
- package/src/message-edit.stories.tsx +150 -0
- package/src/message-edit.test.tsx +115 -0
- package/src/message-edit.tsx +336 -0
- package/src/message-feedback.stories.tsx +53 -0
- package/src/message-feedback.test.tsx +62 -0
- package/src/message-feedback.tsx +117 -0
- package/src/message-form-spec.ts +349 -0
- package/src/message-form.stories.tsx +182 -0
- package/src/message-form.test.tsx +227 -0
- package/src/message-form.tsx +845 -0
- package/src/message-table-spec.ts +281 -0
- package/src/message-table.stories.tsx +176 -0
- package/src/message-table.test.tsx +144 -0
- package/src/message-table.tsx +366 -0
- package/src/message.stories.tsx +262 -0
- package/src/message.test.tsx +508 -0
- package/src/message.tsx +619 -0
- package/src/mic-selector.tsx +339 -0
- package/src/microcopy.test.tsx +123 -0
- package/src/model-selector.stories.tsx +73 -0
- package/src/model-selector.test.tsx +55 -0
- package/src/model-selector.tsx +225 -0
- package/src/motion-config.tsx +49 -0
- package/src/node.tsx +71 -0
- package/src/open-in-chat.tsx +340 -0
- package/src/package-info.tsx +205 -0
- package/src/panel.tsx +20 -0
- package/src/part-groups.ts +258 -0
- package/src/persona-sources.ts +59 -0
- package/src/persona.stories.tsx +111 -0
- package/src/persona.test.tsx +67 -0
- package/src/persona.tsx +148 -0
- package/src/plan.tsx +135 -0
- package/src/prompt-input.stories.tsx +261 -0
- package/src/prompt-input.test.tsx +392 -0
- package/src/prompt-input.tsx +1668 -0
- package/src/queue.tsx +237 -0
- package/src/reasoning.stories.tsx +81 -0
- package/src/reasoning.test.tsx +50 -0
- package/src/reasoning.tsx +229 -0
- package/src/sandbox.stories.tsx +62 -0
- package/src/sandbox.test.tsx +42 -0
- package/src/sandbox.tsx +149 -0
- package/src/schema-display.tsx +412 -0
- package/src/selection-toolbar.stories.tsx +86 -0
- package/src/selection-toolbar.test.tsx +89 -0
- package/src/selection-toolbar.tsx +192 -0
- package/src/shimmer.stories.tsx +10 -0
- package/src/shimmer.tsx +81 -0
- package/src/snippet.stories.tsx +19 -0
- package/src/snippet.test.tsx +116 -0
- package/src/snippet.tsx +138 -0
- package/src/sources.stories.tsx +34 -0
- package/src/sources.test.tsx +129 -0
- package/src/sources.tsx +93 -0
- package/src/speech-input.tsx +312 -0
- package/src/stack-trace.tsx +479 -0
- package/src/streamdown-i18n.test.tsx +163 -0
- package/src/suggestion.stories.tsx +75 -0
- package/src/suggestion.test.tsx +72 -0
- package/src/suggestion.tsx +120 -0
- package/src/task.stories.tsx +22 -0
- package/src/task.test.tsx +36 -0
- package/src/task.tsx +89 -0
- package/src/templates-ai-assistant.stories.tsx +142 -0
- package/src/terminal.tsx +244 -0
- package/src/test-results.stories.tsx +177 -0
- package/src/test-results.test.tsx +241 -0
- package/src/test-results.tsx +408 -0
- package/src/tool-result-card.stories.tsx +143 -0
- package/src/tool-result-card.test.tsx +72 -0
- package/src/tool-result-card.tsx +86 -0
- package/src/tool.stories.tsx +60 -0
- package/src/tool.test.tsx +63 -0
- package/src/tool.tsx +235 -0
- package/src/toolbar.tsx +44 -0
- package/src/transcription.tsx +118 -0
- package/src/voice-selector.tsx +469 -0
- package/src/web-preview.stories.tsx +67 -0
- package/src/web-preview.test.tsx +117 -0
- package/src/web-preview.tsx +283 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4079 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, ReactNode, HTMLAttributes, RefObject, FormEvent, PropsWithChildren, ImgHTMLAttributes, FC, ElementType, JSX } from 'react';
|
|
3
|
+
import * as _elabs_ai_components_ui from '@elabs-ai/components-ui';
|
|
4
|
+
import { AccordionItem, Accordion, TimelineItemProps, Status, TimelineRootProps, Button, FileSource, HoverCard, HoverCardContent, HoverCardTrigger, CollapsibleContent, CollapsibleTrigger, Badge, HeadingLevel, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Collapsible, Avatar, InputGroupButton, DropdownMenuItem, DropdownMenu, DropdownMenuContent, TooltipContent, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, InputGroupAddon, InputGroupTextarea, Alert, AlertDescription, AlertTitle, Switch, Carousel, ProseHeadingLevel, ButtonGroup, Popover, PopoverContent, Dialog, DialogContent, CommandDialog, CommandShortcut, DialogTrigger, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, ScrollArea, TabsContent, Tabs, TabsList, TabsTrigger, InputGroup, InputGroupInput, InputGroupText, Input } from '@elabs-ai/components-ui';
|
|
5
|
+
import { Tool as Tool$1, FileUIPart, SourceDocumentUIPart, Experimental_SpeechResult, ChatStatus, ToolUIPart, LanguageModelUsage, UIMessage, Experimental_GeneratedImage, DynamicToolUIPart, Experimental_TranscriptionResult } from 'ai';
|
|
6
|
+
import { LucideIcon, LucideProps, FileIcon } from 'lucide-react';
|
|
7
|
+
import { MediaController, MediaControlBar, MediaDurationDisplay, MediaMuteButton, MediaPlayButton, MediaSeekBackwardButton, MediaSeekForwardButton, MediaTimeDisplay, MediaTimeRange, MediaVolumeRange } from 'media-chrome/react';
|
|
8
|
+
import { ReactFlowProps, ConnectionLineComponent, Controls as Controls$1, EdgeProps, Panel as Panel$1, NodeToolbar as NodeToolbar$1 } from '@xyflow/react';
|
|
9
|
+
import { BundledLanguage, ThemedToken } from 'shiki';
|
|
10
|
+
import { StickToBottom } from 'use-stick-to-bottom';
|
|
11
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
12
|
+
import { VariantProps } from 'class-variance-authority';
|
|
13
|
+
import { ITheme } from '@xterm/xterm';
|
|
14
|
+
import { TProps } from 'react-jsx-parser';
|
|
15
|
+
import { MermaidConfig, DiagramPlugin } from '@streamdown/mermaid';
|
|
16
|
+
import { Streamdown } from 'streamdown';
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { Transition } from 'motion/react';
|
|
19
|
+
import { RiveParameters } from '@rive-app/react-webgl2';
|
|
20
|
+
|
|
21
|
+
type AgentProps = ComponentProps<"div">;
|
|
22
|
+
declare const Agent: react.MemoExoticComponent<({ className, ...props }: AgentProps) => react.JSX.Element>;
|
|
23
|
+
type AgentHeaderProps = ComponentProps<"div"> & {
|
|
24
|
+
name: string;
|
|
25
|
+
model?: string;
|
|
26
|
+
};
|
|
27
|
+
declare const AgentHeader: react.MemoExoticComponent<({ className, name, model, ...props }: AgentHeaderProps) => react.JSX.Element>;
|
|
28
|
+
type AgentContentProps = ComponentProps<"div">;
|
|
29
|
+
declare const AgentContent: react.MemoExoticComponent<({ className, ...props }: AgentContentProps) => react.JSX.Element>;
|
|
30
|
+
type AgentInstructionsProps = ComponentProps<"div"> & {
|
|
31
|
+
children: string;
|
|
32
|
+
};
|
|
33
|
+
declare const AgentInstructions: react.MemoExoticComponent<({ className, children, ...props }: AgentInstructionsProps) => react.JSX.Element>;
|
|
34
|
+
type AgentToolsProps = ComponentProps<typeof Accordion>;
|
|
35
|
+
declare const AgentTools: react.MemoExoticComponent<({ className, ...props }: AgentToolsProps) => react.JSX.Element>;
|
|
36
|
+
type AgentToolProps = ComponentProps<typeof AccordionItem> & {
|
|
37
|
+
tool: Tool$1;
|
|
38
|
+
};
|
|
39
|
+
declare const AgentTool: react.MemoExoticComponent<({ className, tool, value, ...props }: AgentToolProps) => react.JSX.Element>;
|
|
40
|
+
type AgentOutputProps = ComponentProps<"div"> & {
|
|
41
|
+
schema: string;
|
|
42
|
+
};
|
|
43
|
+
declare const AgentOutput: react.MemoExoticComponent<({ className, schema, ...props }: AgentOutputProps) => react.JSX.Element>;
|
|
44
|
+
|
|
45
|
+
type AgentTimelineProps = TimelineRootProps;
|
|
46
|
+
/** The `<ol>` rail an agent run's steps sit on (canonical @elabs-ai/components-ui spine). */
|
|
47
|
+
declare const AgentTimeline: react.ForwardRefExoticComponent<TimelineRootProps & react.RefAttributes<HTMLOListElement>>;
|
|
48
|
+
interface AgentStepProps extends Omit<TimelineItemProps, "children" | "description"> {
|
|
49
|
+
/** Optional leading concept glyph on the title row (Lucide). */
|
|
50
|
+
icon?: LucideIcon;
|
|
51
|
+
/** What the agent did — the step's title (`text-body`). */
|
|
52
|
+
name: ReactNode;
|
|
53
|
+
/** The business summary line under the name (`text-meta`), not JSON. */
|
|
54
|
+
summary?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The canonical execution status (closed 7-state enum). Drives the rail
|
|
57
|
+
* node AND the `StatusBadge`. `skipped` is the agent-step-only state with
|
|
58
|
+
* no SDK source (research 10 §B.1).
|
|
59
|
+
*/
|
|
60
|
+
status?: Status;
|
|
61
|
+
/**
|
|
62
|
+
* Drop the inline `StatusBadge` (the rail node still carries the status
|
|
63
|
+
* color). For quiet prose rails — e.g. the `ChainOfThought` alias — where a
|
|
64
|
+
* badge per step would shout.
|
|
65
|
+
*/
|
|
66
|
+
hideBadge?: boolean;
|
|
67
|
+
/** Rich detail under the node (e.g. a `ToolDetails` disclosure, results). */
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One executed/executing step: icon + name + `StatusBadge` + business
|
|
72
|
+
* summary, with composed children for detail. Memoized for long transcripts
|
|
73
|
+
* (research 10 §G.6).
|
|
74
|
+
*/
|
|
75
|
+
declare const AgentStep: react.NamedExoticComponent<AgentStepProps & react.RefAttributes<HTMLLIElement>>;
|
|
76
|
+
|
|
77
|
+
type ArtifactProps = HTMLAttributes<HTMLDivElement> & {
|
|
78
|
+
/**
|
|
79
|
+
* The artifact body has not arrived yet (loading-states.md loading signal).
|
|
80
|
+
* ArtifactContent renders a layout-shaped skeleton instead of its
|
|
81
|
+
* children; ArtifactHeader/ArtifactTitle keep rendering as passed.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
loading?: boolean;
|
|
85
|
+
};
|
|
86
|
+
declare const Artifact: ({ className, loading, children, ...props }: ArtifactProps) => react.JSX.Element;
|
|
87
|
+
type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
88
|
+
declare const ArtifactHeader: ({ className, ...props }: ArtifactHeaderProps) => react.JSX.Element;
|
|
89
|
+
type ArtifactCloseProps = ComponentProps<typeof Button>;
|
|
90
|
+
declare const ArtifactClose: ({ className, children, size, variant, ...props }: ArtifactCloseProps) => react.JSX.Element;
|
|
91
|
+
type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
|
|
92
|
+
declare const ArtifactTitle: ({ className, ...props }: ArtifactTitleProps) => react.JSX.Element;
|
|
93
|
+
type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
94
|
+
declare const ArtifactDescription: ({ className, ...props }: ArtifactDescriptionProps) => react.JSX.Element;
|
|
95
|
+
type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
96
|
+
declare const ArtifactActions: ({ className, ...props }: ArtifactActionsProps) => react.JSX.Element;
|
|
97
|
+
type ArtifactActionProps = ComponentProps<typeof Button> & {
|
|
98
|
+
tooltip?: string;
|
|
99
|
+
label?: string;
|
|
100
|
+
icon?: LucideIcon;
|
|
101
|
+
};
|
|
102
|
+
declare const ArtifactAction: ({ tooltip, label, icon: Icon, children, className, size, variant, ...props }: ArtifactActionProps) => react.JSX.Element;
|
|
103
|
+
type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;
|
|
104
|
+
declare const ArtifactContent: ({ className, children, ...props }: ArtifactContentProps) => react.JSX.Element;
|
|
105
|
+
|
|
106
|
+
/** Closed asset-type enum shared by the tree (`ProducedAssetTree`) and the preview (`AssetPreview`). */
|
|
107
|
+
type ContextAssetType = "markdown" | "code" | "sql" | "csv" | "image";
|
|
108
|
+
/** One produced asset — the unit the drill-in focuses (research 09 §B.1). */
|
|
109
|
+
interface ContextAsset {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
path?: string;
|
|
113
|
+
type: ContextAssetType;
|
|
114
|
+
/** Inline content: source text — or, for `image`, the image src URL. */
|
|
115
|
+
content?: string;
|
|
116
|
+
/** Optional Shiki language for `code` assets (defaults to "typescript"). */
|
|
117
|
+
language?: string;
|
|
118
|
+
/**
|
|
119
|
+
* The file itself, when the asset IS one — a `File`, a `Blob`, a URL, a
|
|
120
|
+
* buffer. Carried so a `renderPreview` injection (below) can hand it to
|
|
121
|
+
* something that opens files, such as `@elabs-ai/components-viewer`'s
|
|
122
|
+
* `FileViewer`, without the asset first being turned into a string.
|
|
123
|
+
*
|
|
124
|
+
* `ContextAssetType` is deliberately NOT widened to cover PDFs, Office files
|
|
125
|
+
* or video: this union describes what THIS package can draw, and every format
|
|
126
|
+
* beyond it arrives through the injection seam rather than by growing a case
|
|
127
|
+
* per format here (ADR 0024 §6).
|
|
128
|
+
*/
|
|
129
|
+
source?: FileSource;
|
|
130
|
+
/** MIME type, when known — helps a renderer that detects by media type. */
|
|
131
|
+
mediaType?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Draw the body of an asset preview.
|
|
135
|
+
*
|
|
136
|
+
* Return `null` to decline and let `AssetPreview` fall through to its own
|
|
137
|
+
* type-keyed rendering, which is what makes this additive: an injection that
|
|
138
|
+
* handles PDFs only leaves markdown, code and CSV exactly as they were.
|
|
139
|
+
*/
|
|
140
|
+
type AssetPreviewRenderer = (asset: ContextAsset) => ReactNode | null;
|
|
141
|
+
type ContextPanelView = "root" | "detail";
|
|
142
|
+
interface ContextPanelContextValue {
|
|
143
|
+
/** Lifted state (doc-13 `state` / `actions` / `meta` interface). */
|
|
144
|
+
state: {
|
|
145
|
+
open: boolean;
|
|
146
|
+
view: ContextPanelView;
|
|
147
|
+
selectedAsset: ContextAsset | null;
|
|
148
|
+
};
|
|
149
|
+
actions: {
|
|
150
|
+
/** Toggle the panel (the inline collapse on desktop, the Sheet on mobile). */
|
|
151
|
+
toggle: () => void;
|
|
152
|
+
setOpen: (open: boolean | ((open: boolean) => boolean)) => void;
|
|
153
|
+
/** Drill into one asset (root → detail). Focus moves to the BACK control. */
|
|
154
|
+
openDetail: (asset: ContextAsset) => void;
|
|
155
|
+
/** Return to the root view; focus is restored to the originating row. */
|
|
156
|
+
back: () => void;
|
|
157
|
+
};
|
|
158
|
+
meta: {
|
|
159
|
+
isMobile: boolean;
|
|
160
|
+
openMobile: boolean;
|
|
161
|
+
setOpenMobile: (open: boolean) => void;
|
|
162
|
+
/**
|
|
163
|
+
* The injected preview renderer, if the provider was given one.
|
|
164
|
+
* `AssetPreview` reads it from here so a page can teach the whole rail a
|
|
165
|
+
* new format in one place instead of at every call site.
|
|
166
|
+
*/
|
|
167
|
+
renderPreview?: AssetPreviewRenderer;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
declare function useContextPanel(): ContextPanelContextValue;
|
|
171
|
+
/**
|
|
172
|
+
* The renderer injected into the surrounding `ContextPanelProvider`, if any.
|
|
173
|
+
*
|
|
174
|
+
* Unlike `useContextPanel()` this does NOT throw outside a provider:
|
|
175
|
+
* `AssetPreview` is usable on its own (a preview pane in a page, a story), and
|
|
176
|
+
* "no provider" simply means nobody injected anything.
|
|
177
|
+
*/
|
|
178
|
+
declare function useAssetPreviewRenderer(): AssetPreviewRenderer | undefined;
|
|
179
|
+
interface ContextPanelProviderProps {
|
|
180
|
+
children: ReactNode;
|
|
181
|
+
/** Uncontrolled initial open state. Default `true`. */
|
|
182
|
+
defaultOpen?: boolean;
|
|
183
|
+
/** Controlled open state (`isControlled = open !== undefined`, never flips). */
|
|
184
|
+
open?: boolean;
|
|
185
|
+
onOpenChange?: (open: boolean) => void;
|
|
186
|
+
/** Controlled view (root ↔ detail). */
|
|
187
|
+
view?: ContextPanelView;
|
|
188
|
+
onViewChange?: (view: ContextPanelView) => void;
|
|
189
|
+
/** Uncontrolled initial view. Default `"root"`. */
|
|
190
|
+
defaultView?: ContextPanelView;
|
|
191
|
+
/** Controlled selected asset. */
|
|
192
|
+
selectedAsset?: ContextAsset | null;
|
|
193
|
+
onSelectedAssetChange?: (asset: ContextAsset | null) => void;
|
|
194
|
+
/** Uncontrolled initial selected asset. Default `null`. */
|
|
195
|
+
defaultSelectedAsset?: ContextAsset | null;
|
|
196
|
+
/**
|
|
197
|
+
* Draw an asset's preview body yourself.
|
|
198
|
+
*
|
|
199
|
+
* The seam that lets this package show formats it cannot parse — a PDF, a
|
|
200
|
+
* spreadsheet, a video — without importing a domain sibling
|
|
201
|
+
* (`@elabs-ai/components-ai` and
|
|
202
|
+
* `@elabs-ai/components-viewer` are peers in the layer graph and
|
|
203
|
+
* may never import each other). The consuming app owns the edge:
|
|
204
|
+
*
|
|
205
|
+
* ```tsx
|
|
206
|
+
* <ContextPanelProvider
|
|
207
|
+
* renderPreview={(asset) =>
|
|
208
|
+
* asset.source ? <FileViewer source={asset.source} /> : null
|
|
209
|
+
* }
|
|
210
|
+
* >
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* Return `null` to decline, and the built-in type-keyed rendering runs
|
|
214
|
+
* exactly as before — so an injection is additive, never a replacement.
|
|
215
|
+
*/
|
|
216
|
+
renderPreview?: AssetPreviewRenderer;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Lifts the panel state above the workspace so siblings outside the panel's
|
|
220
|
+
* frame (the app-header trigger) can read/drive it — no prop-drilling, no
|
|
221
|
+
* page-level `useState`, no conditional mount (research 09 §B.1/§C.2).
|
|
222
|
+
*/
|
|
223
|
+
declare function ContextPanelProvider({ children, defaultOpen, open: openProp, onOpenChange, view: viewProp, onViewChange, defaultView, selectedAsset: selectedAssetProp, onSelectedAssetChange, defaultSelectedAsset, renderPreview, }: ContextPanelProviderProps): react.JSX.Element;
|
|
224
|
+
interface ContextPanelProps extends ComponentProps<"div"> {
|
|
225
|
+
/** Expanded panel width (any CSS length). Default `"20rem"`. */
|
|
226
|
+
width?: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The always-mounted shell. On desktop it animates its OWN width via the
|
|
230
|
+
* canonical `useCollapsiblePanel` two-element tween — bounded to the SHELL
|
|
231
|
+
* (a relative group + absolute container), not the viewport (09 §B.2). Below
|
|
232
|
+
* the mobile breakpoint it renders a `Sheet side="right"` with the same
|
|
233
|
+
* children, driven by the same provider (09 §B.4).
|
|
234
|
+
*/
|
|
235
|
+
declare const ContextPanel: react.ForwardRefExoticComponent<Omit<ContextPanelProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
236
|
+
type ContextPanelTriggerProps = ComponentProps<typeof Button>;
|
|
237
|
+
/** Toggle button — placeable ANYWHERE inside the provider (e.g. the app header). */
|
|
238
|
+
declare const ContextPanelTrigger: react.ForwardRefExoticComponent<Omit<_elabs_ai_components_ui.ButtonProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
239
|
+
interface ContextPanelHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
240
|
+
/** Root-view title. Default `"Context"`. */
|
|
241
|
+
title?: ReactNode;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Title row. In the detail view it hosts the BACK control (a real button —
|
|
245
|
+
* "tab-panel swap", not a breadcrumb) and shows the focused asset's name.
|
|
246
|
+
*/
|
|
247
|
+
declare const ContextPanelHeader: react.ForwardRefExoticComponent<ContextPanelHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
248
|
+
interface ContextPanelBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
249
|
+
/** Root view — the labelled sections (status / grounding / produced assets). */
|
|
250
|
+
root: ReactNode;
|
|
251
|
+
/** Detail view — typically `<ContextPanelDetail><AssetPreview …/></ContextPanelDetail>`. */
|
|
252
|
+
detail: ReactNode;
|
|
253
|
+
/** Accessible name of the region. Default `"Context"`. */
|
|
254
|
+
label?: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The two-view container that owns the drill-in. v1: a CSS-gated two-pane
|
|
258
|
+
* translateX track (both panes mounted, transform-only, `duration-base` +
|
|
259
|
+
* explicit `motion-reduce:` neutralizer). The off-screen pane is `aria-hidden`
|
|
260
|
+
* AND `inert` so Tab can't land in it mid-slide (09 §B.3/§B.5). The panes'
|
|
261
|
+
* `data-vt-pane` identities are the v2 `useViewTransition` seam.
|
|
262
|
+
*/
|
|
263
|
+
declare const ContextPanelBody: react.ForwardRefExoticComponent<ContextPanelBodyProps & react.RefAttributes<HTMLDivElement>>;
|
|
264
|
+
interface ContextPanelSectionProps extends HTMLAttributes<HTMLElement> {
|
|
265
|
+
/** Section label — a quiet `text-meta` heading, not a box (research 08). */
|
|
266
|
+
label?: ReactNode;
|
|
267
|
+
}
|
|
268
|
+
/** A labelled root-view section (status / grounding / produced assets). */
|
|
269
|
+
declare const ContextPanelSection: react.ForwardRefExoticComponent<ContextPanelSectionProps & react.RefAttributes<HTMLElement>>;
|
|
270
|
+
type ContextPanelDetailProps = HTMLAttributes<HTMLDivElement>;
|
|
271
|
+
/** The focused single-asset view — hosts `<AssetPreview>` (research 04 §5). */
|
|
272
|
+
declare const ContextPanelDetail: react.ForwardRefExoticComponent<ContextPanelDetailProps & react.RefAttributes<HTMLDivElement>>;
|
|
273
|
+
|
|
274
|
+
type AssetPreviewMode = "preview" | "raw";
|
|
275
|
+
interface AssetPreviewProps extends HTMLAttributes<HTMLDivElement> {
|
|
276
|
+
asset: ContextAsset;
|
|
277
|
+
/** Initial mode. Default `"preview"`. */
|
|
278
|
+
defaultMode?: AssetPreviewMode;
|
|
279
|
+
/**
|
|
280
|
+
* Draw this asset's preview body yourself; return `null` to decline and get
|
|
281
|
+
* the built-in rendering. Wins over a renderer injected on
|
|
282
|
+
* `ContextPanelProvider`, so one rail-wide default can still be overridden
|
|
283
|
+
* for a single preview.
|
|
284
|
+
*/
|
|
285
|
+
renderPreview?: AssetPreviewRenderer;
|
|
286
|
+
}
|
|
287
|
+
declare const AssetPreview: ({ asset, defaultMode, renderPreview, className, ...props }: AssetPreviewProps) => react.JSX.Element;
|
|
288
|
+
|
|
289
|
+
type AttachmentData = (FileUIPart & {
|
|
290
|
+
id: string;
|
|
291
|
+
}) | (SourceDocumentUIPart & {
|
|
292
|
+
id: string;
|
|
293
|
+
});
|
|
294
|
+
type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown";
|
|
295
|
+
type AttachmentVariant = "grid" | "inline" | "list";
|
|
296
|
+
declare const getMediaCategory: (data: AttachmentData) => AttachmentMediaCategory;
|
|
297
|
+
declare const getAttachmentLabel: (data: AttachmentData) => string;
|
|
298
|
+
interface AttachmentsContextValue {
|
|
299
|
+
variant: AttachmentVariant;
|
|
300
|
+
}
|
|
301
|
+
interface AttachmentContextValue {
|
|
302
|
+
data: AttachmentData;
|
|
303
|
+
mediaCategory: AttachmentMediaCategory;
|
|
304
|
+
onRemove?: () => void;
|
|
305
|
+
variant: AttachmentVariant;
|
|
306
|
+
}
|
|
307
|
+
declare const useAttachmentsContext: () => AttachmentsContextValue;
|
|
308
|
+
declare const useAttachmentContext: () => AttachmentContextValue;
|
|
309
|
+
type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {
|
|
310
|
+
variant?: AttachmentVariant;
|
|
311
|
+
};
|
|
312
|
+
declare const Attachments: ({ variant, className, children, ...props }: AttachmentsProps) => react.JSX.Element;
|
|
313
|
+
type AttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
314
|
+
data: AttachmentData;
|
|
315
|
+
onRemove?: () => void;
|
|
316
|
+
};
|
|
317
|
+
declare const Attachment: ({ data, onRemove, className, children, ...props }: AttachmentProps) => react.JSX.Element;
|
|
318
|
+
type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {
|
|
319
|
+
fallbackIcon?: ReactNode;
|
|
320
|
+
};
|
|
321
|
+
declare const AttachmentPreview: ({ fallbackIcon, className, ...props }: AttachmentPreviewProps) => react.JSX.Element;
|
|
322
|
+
type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {
|
|
323
|
+
showMediaType?: boolean;
|
|
324
|
+
};
|
|
325
|
+
declare const AttachmentInfo: ({ showMediaType, className, ...props }: AttachmentInfoProps) => react.JSX.Element | null;
|
|
326
|
+
type AttachmentRemoveProps = ComponentProps<typeof Button> & {
|
|
327
|
+
label?: string;
|
|
328
|
+
};
|
|
329
|
+
declare const AttachmentRemove: ({ label, className, children, ...props }: AttachmentRemoveProps) => react.JSX.Element | null;
|
|
330
|
+
type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;
|
|
331
|
+
declare const AttachmentHoverCard: ({ openDelay, closeDelay, ...props }: AttachmentHoverCardProps) => react.JSX.Element;
|
|
332
|
+
type AttachmentHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
|
|
333
|
+
declare const AttachmentHoverCardTrigger: (props: AttachmentHoverCardTriggerProps) => react.JSX.Element;
|
|
334
|
+
type AttachmentHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
|
|
335
|
+
declare const AttachmentHoverCardContent: ({ align, className, ...props }: AttachmentHoverCardContentProps) => react.JSX.Element;
|
|
336
|
+
type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;
|
|
337
|
+
declare const AttachmentEmpty: ({ className, children, ...props }: AttachmentEmptyProps) => react.JSX.Element;
|
|
338
|
+
|
|
339
|
+
type AudioPlayerProps = Omit<ComponentProps<typeof MediaController>, "audio">;
|
|
340
|
+
declare const AudioPlayer: ({ className, ...props }: AudioPlayerProps) => react.JSX.Element;
|
|
341
|
+
type AudioPlayerElementProps = Omit<ComponentProps<"audio">, "src"> & ({
|
|
342
|
+
data: Experimental_SpeechResult["audio"];
|
|
343
|
+
} | {
|
|
344
|
+
src: string;
|
|
345
|
+
});
|
|
346
|
+
declare const AudioPlayerElement: ({ ...props }: AudioPlayerElementProps) => react.JSX.Element;
|
|
347
|
+
type AudioPlayerControlBarProps = ComponentProps<typeof MediaControlBar>;
|
|
348
|
+
declare const AudioPlayerControlBar: (props: AudioPlayerControlBarProps) => react.JSX.Element;
|
|
349
|
+
type AudioPlayerPlayButtonProps = ComponentProps<typeof MediaPlayButton>;
|
|
350
|
+
declare const AudioPlayerPlayButton: (props: AudioPlayerPlayButtonProps) => react.JSX.Element;
|
|
351
|
+
type AudioPlayerSeekBackwardButtonProps = ComponentProps<typeof MediaSeekBackwardButton>;
|
|
352
|
+
declare const AudioPlayerSeekBackwardButton: (props: AudioPlayerSeekBackwardButtonProps) => react.JSX.Element;
|
|
353
|
+
type AudioPlayerSeekForwardButtonProps = ComponentProps<typeof MediaSeekForwardButton>;
|
|
354
|
+
declare const AudioPlayerSeekForwardButton: (props: AudioPlayerSeekForwardButtonProps) => react.JSX.Element;
|
|
355
|
+
type AudioPlayerTimeDisplayProps = ComponentProps<typeof MediaTimeDisplay>;
|
|
356
|
+
declare const AudioPlayerTimeDisplay: (props: AudioPlayerTimeDisplayProps) => react.JSX.Element;
|
|
357
|
+
type AudioPlayerTimeRangeProps = ComponentProps<typeof MediaTimeRange>;
|
|
358
|
+
declare const AudioPlayerTimeRange: (props: AudioPlayerTimeRangeProps) => react.JSX.Element;
|
|
359
|
+
type AudioPlayerDurationDisplayProps = ComponentProps<typeof MediaDurationDisplay>;
|
|
360
|
+
declare const AudioPlayerDurationDisplay: (props: AudioPlayerDurationDisplayProps) => react.JSX.Element;
|
|
361
|
+
type AudioPlayerMuteButtonProps = ComponentProps<typeof MediaMuteButton>;
|
|
362
|
+
declare const AudioPlayerMuteButton: (props: AudioPlayerMuteButtonProps) => react.JSX.Element;
|
|
363
|
+
type AudioPlayerVolumeRangeProps = ComponentProps<typeof MediaVolumeRange>;
|
|
364
|
+
declare const AudioPlayerVolumeRange: (props: AudioPlayerVolumeRangeProps) => react.JSX.Element;
|
|
365
|
+
|
|
366
|
+
type CanvasProps = ReactFlowProps & {
|
|
367
|
+
children?: ReactNode;
|
|
368
|
+
};
|
|
369
|
+
declare const Canvas: ({ className, ...props }: CanvasProps) => react.JSX.Element;
|
|
370
|
+
|
|
371
|
+
type ChainOfThoughtProps = ComponentProps<"div"> & {
|
|
372
|
+
open?: boolean;
|
|
373
|
+
defaultOpen?: boolean;
|
|
374
|
+
onOpenChange?: (open: boolean) => void;
|
|
375
|
+
};
|
|
376
|
+
declare const ChainOfThought: react.MemoExoticComponent<({ className, open, defaultOpen, onOpenChange, children, ...props }: ChainOfThoughtProps) => react.JSX.Element>;
|
|
377
|
+
type ChainOfThoughtHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
378
|
+
declare const ChainOfThoughtHeader: react.MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtHeaderProps) => react.JSX.Element>;
|
|
379
|
+
type ChainOfThoughtStepProps = Omit<AgentStepProps, "name" | "summary" | "status" | "hideBadge"> & {
|
|
380
|
+
label: ReactNode;
|
|
381
|
+
description?: ReactNode;
|
|
382
|
+
status?: "complete" | "active" | "pending";
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* @deprecated Compose `AgentStep` (agent-timeline.tsx) directly. Since #192
|
|
386
|
+
* this is a thin alias mapping the legacy `label`/`description`/3-state
|
|
387
|
+
* `status` props onto the canonical rail (`AgentTimeline` + `AgentStep`); the
|
|
388
|
+
* pre-#192 hand-rolled connector + text-opacity status idiom is gone
|
|
389
|
+
* (research 10 §B.3). The badge stays hidden here — the rail node carries the
|
|
390
|
+
* status — keeping the quiet prose-rail look.
|
|
391
|
+
*/
|
|
392
|
+
declare const ChainOfThoughtStep: react.MemoExoticComponent<({ label, description, status, ...props }: ChainOfThoughtStepProps) => react.JSX.Element>;
|
|
393
|
+
type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;
|
|
394
|
+
declare const ChainOfThoughtSearchResults: react.MemoExoticComponent<({ className, ...props }: ChainOfThoughtSearchResultsProps) => react.JSX.Element>;
|
|
395
|
+
type ChainOfThoughtSearchResultProps = ComponentProps<typeof Badge>;
|
|
396
|
+
declare const ChainOfThoughtSearchResult: react.MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtSearchResultProps) => react.JSX.Element>;
|
|
397
|
+
type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
398
|
+
declare const ChainOfThoughtContent: react.MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtContentProps) => react.JSX.Element>;
|
|
399
|
+
type ChainOfThoughtImageProps = ComponentProps<"div"> & {
|
|
400
|
+
caption?: string;
|
|
401
|
+
};
|
|
402
|
+
declare const ChainOfThoughtImage: react.MemoExoticComponent<({ className, children, caption, ...props }: ChainOfThoughtImageProps) => react.JSX.Element>;
|
|
403
|
+
|
|
404
|
+
interface ChatGreetingProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
405
|
+
/** Primary line, e.g. "Good morning, Avery". */
|
|
406
|
+
title: ReactNode;
|
|
407
|
+
/**
|
|
408
|
+
* Second line, rendered under `title` inside the same heading. Independent
|
|
409
|
+
* of `accent` — either may be passed alone.
|
|
410
|
+
*/
|
|
411
|
+
subtitle?: ReactNode;
|
|
412
|
+
/**
|
|
413
|
+
* Phrase rendered in `text-primary-text` with a bold underline, appended
|
|
414
|
+
* after `subtitle` (or alone). The underline + weight is a NON-hue channel
|
|
415
|
+
* deliberately layered on top of the color — a monochrome theme's `--primary`
|
|
416
|
+
* can be a near-white "pen" by design, in which case the accent colour alone
|
|
417
|
+
* is indistinguishable from the surrounding `--foreground` headline text. The
|
|
418
|
+
* underline/weight keep the phrase legible as an accent in EVERY theme,
|
|
419
|
+
* not only the two where hue alone would carry it.
|
|
420
|
+
*/
|
|
421
|
+
accent?: ReactNode;
|
|
422
|
+
/** Soft primary glow behind the headline. Default `true`; `false` for dense/embedded use. */
|
|
423
|
+
orb?: boolean;
|
|
424
|
+
/**
|
|
425
|
+
* Semantic heading level for `title`. Default `1` (a chat empty state is
|
|
426
|
+
* typically the only heading on the page). Override to `2`+ when ChatGreeting
|
|
427
|
+
* sits inside a page or route that already renders its own `<h1>` —
|
|
428
|
+
* `Heading` decouples `level` from `size`, so the visual display-scale rung
|
|
429
|
+
* stays put regardless of the level chosen.
|
|
430
|
+
*/
|
|
431
|
+
level?: HeadingLevel;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* ChatGreeting — the centered first-run greeting for an empty chat/composer scene.
|
|
435
|
+
*
|
|
436
|
+
* A display-scale headline (`title`, then `subtitle` with an `accent` phrase
|
|
437
|
+
* in `text-primary-text` + a bold underline, so the accent reads in every theme,
|
|
438
|
+
* including a monochrome one whose `--primary` is otherwise the same
|
|
439
|
+
* near-white as the headline) over an optional soft primary glow. Pair it
|
|
440
|
+
* with `<Composer />` for the standard empty/first-run chat state.
|
|
441
|
+
*
|
|
442
|
+
* Distinct from `ConversationEmptyState` (a generic centered "No messages yet"
|
|
443
|
+
* message panel) — this is the display-scale greeting anatomy, not a status
|
|
444
|
+
* message.
|
|
445
|
+
*/
|
|
446
|
+
declare const ChatGreeting: react.ForwardRefExoticComponent<ChatGreetingProps & react.RefAttributes<HTMLDivElement>>;
|
|
447
|
+
|
|
448
|
+
type CheckpointProps = HTMLAttributes<HTMLDivElement>;
|
|
449
|
+
declare const Checkpoint: ({ className, children, ...props }: CheckpointProps) => react.JSX.Element;
|
|
450
|
+
type CheckpointIconProps = LucideProps;
|
|
451
|
+
declare const CheckpointIcon: ({ className, children, ...props }: CheckpointIconProps) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element;
|
|
452
|
+
type CheckpointTriggerProps = ComponentProps<typeof Button> & {
|
|
453
|
+
tooltip?: string;
|
|
454
|
+
};
|
|
455
|
+
declare const CheckpointTrigger: ({ children, variant, size, tooltip, ...props }: CheckpointTriggerProps) => react.JSX.Element;
|
|
456
|
+
|
|
457
|
+
type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
|
|
458
|
+
code: string;
|
|
459
|
+
language: BundledLanguage;
|
|
460
|
+
showLineNumbers?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* Soft-wrap long lines instead of scrolling horizontally. Use in narrow embeds
|
|
463
|
+
* (e.g. a side rail) so content is not silently clipped. Default: false.
|
|
464
|
+
*/
|
|
465
|
+
wrap?: boolean;
|
|
466
|
+
/**
|
|
467
|
+
* code is arriving incrementally (loading-states.md isStreaming) — code
|
|
468
|
+
* keeps rendering progressively (build-up), NOT a skeleton, since a
|
|
469
|
+
* streaming code block is not fetch-then-show. Shows a Shimmer generating
|
|
470
|
+
* cue below the content as the in-progress affordance.
|
|
471
|
+
* @default false
|
|
472
|
+
*/
|
|
473
|
+
isStreaming?: boolean;
|
|
474
|
+
};
|
|
475
|
+
interface TokenizedCode {
|
|
476
|
+
tokens: ThemedToken[][];
|
|
477
|
+
fg: string;
|
|
478
|
+
bg: string;
|
|
479
|
+
}
|
|
480
|
+
declare const highlightCode: (code: string, language: BundledLanguage, callback?: (result: TokenizedCode) => void, el?: Element | null) => TokenizedCode | null;
|
|
481
|
+
declare const CodeBlockContainer: ({ className, language, style, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
482
|
+
language: string;
|
|
483
|
+
}) => react.JSX.Element;
|
|
484
|
+
declare const CodeBlockHeader: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
485
|
+
declare const CodeBlockTitle: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
486
|
+
declare const CodeBlockFilename: ({ children, className, ...props }: HTMLAttributes<HTMLSpanElement>) => react.JSX.Element;
|
|
487
|
+
declare const CodeBlockActions: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => react.JSX.Element;
|
|
488
|
+
declare const CodeBlockContent: ({ code, language, showLineNumbers, wrap, }: {
|
|
489
|
+
code: string;
|
|
490
|
+
language: BundledLanguage;
|
|
491
|
+
showLineNumbers?: boolean;
|
|
492
|
+
wrap?: boolean;
|
|
493
|
+
}) => react.JSX.Element;
|
|
494
|
+
declare const CodeBlock: ({ code, language, showLineNumbers, wrap, isStreaming, className, children, ...props }: CodeBlockProps) => react.JSX.Element;
|
|
495
|
+
type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
|
|
496
|
+
onCopy?: () => void;
|
|
497
|
+
onError?: (error: Error) => void;
|
|
498
|
+
timeout?: number;
|
|
499
|
+
};
|
|
500
|
+
declare const CodeBlockCopyButton: ({ onCopy, onError, timeout, children, className, ...props }: CodeBlockCopyButtonProps) => react.JSX.Element;
|
|
501
|
+
type CodeBlockLanguageSelectorProps = ComponentProps<typeof Select>;
|
|
502
|
+
declare const CodeBlockLanguageSelector: (props: CodeBlockLanguageSelectorProps) => react.JSX.Element;
|
|
503
|
+
type CodeBlockLanguageSelectorTriggerProps = ComponentProps<typeof SelectTrigger>;
|
|
504
|
+
declare const CodeBlockLanguageSelectorTrigger: ({ className, ...props }: CodeBlockLanguageSelectorTriggerProps) => react.JSX.Element;
|
|
505
|
+
type CodeBlockLanguageSelectorValueProps = ComponentProps<typeof SelectValue>;
|
|
506
|
+
declare const CodeBlockLanguageSelectorValue: (props: CodeBlockLanguageSelectorValueProps) => react.JSX.Element;
|
|
507
|
+
type CodeBlockLanguageSelectorContentProps = ComponentProps<typeof SelectContent>;
|
|
508
|
+
declare const CodeBlockLanguageSelectorContent: ({ align, ...props }: CodeBlockLanguageSelectorContentProps) => react.JSX.Element;
|
|
509
|
+
type CodeBlockLanguageSelectorItemProps = ComponentProps<typeof SelectItem>;
|
|
510
|
+
declare const CodeBlockLanguageSelectorItem: (props: CodeBlockLanguageSelectorItemProps) => react.JSX.Element;
|
|
511
|
+
|
|
512
|
+
type CommitProps = ComponentProps<typeof Collapsible>;
|
|
513
|
+
declare const Commit: ({ className, children, ...props }: CommitProps) => react.JSX.Element;
|
|
514
|
+
type CommitHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
515
|
+
declare const CommitHeader: ({ className, children, ...props }: CommitHeaderProps) => react.JSX.Element;
|
|
516
|
+
type CommitHashProps = HTMLAttributes<HTMLSpanElement>;
|
|
517
|
+
declare const CommitHash: ({ className, children, ...props }: CommitHashProps) => react.JSX.Element;
|
|
518
|
+
type CommitMessageProps = HTMLAttributes<HTMLSpanElement>;
|
|
519
|
+
declare const CommitMessage: ({ className, children, ...props }: CommitMessageProps) => react.JSX.Element;
|
|
520
|
+
type CommitMetadataProps = HTMLAttributes<HTMLDivElement>;
|
|
521
|
+
declare const CommitMetadata: ({ className, children, ...props }: CommitMetadataProps) => react.JSX.Element;
|
|
522
|
+
type CommitSeparatorProps = HTMLAttributes<HTMLSpanElement>;
|
|
523
|
+
declare const CommitSeparator: ({ className, children, ...props }: CommitSeparatorProps) => react.JSX.Element;
|
|
524
|
+
type CommitInfoProps = HTMLAttributes<HTMLDivElement>;
|
|
525
|
+
declare const CommitInfo: ({ className, children, ...props }: CommitInfoProps) => react.JSX.Element;
|
|
526
|
+
type CommitAuthorProps = HTMLAttributes<HTMLDivElement>;
|
|
527
|
+
declare const CommitAuthor: ({ className, children, ...props }: CommitAuthorProps) => react.JSX.Element;
|
|
528
|
+
type CommitAuthorAvatarProps = ComponentProps<typeof Avatar> & {
|
|
529
|
+
initials: string;
|
|
530
|
+
};
|
|
531
|
+
declare const CommitAuthorAvatar: ({ initials, className, ...props }: CommitAuthorAvatarProps) => react.JSX.Element;
|
|
532
|
+
type CommitTimestampProps = HTMLAttributes<HTMLTimeElement> & {
|
|
533
|
+
date: Date;
|
|
534
|
+
};
|
|
535
|
+
declare const CommitTimestamp: ({ date, className, children, ...props }: CommitTimestampProps) => react.JSX.Element;
|
|
536
|
+
type CommitActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
537
|
+
declare const CommitActions: ({ className, children, ...props }: CommitActionsProps) => react.JSX.Element;
|
|
538
|
+
type CommitCopyButtonProps = ComponentProps<typeof Button> & {
|
|
539
|
+
hash: string;
|
|
540
|
+
onCopy?: () => void;
|
|
541
|
+
onError?: (error: Error) => void;
|
|
542
|
+
timeout?: number;
|
|
543
|
+
};
|
|
544
|
+
declare const CommitCopyButton: ({ hash, onCopy, onError, timeout, children, className, ...props }: CommitCopyButtonProps) => react.JSX.Element;
|
|
545
|
+
type CommitContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
546
|
+
declare const CommitContent: ({ className, children, ...props }: CommitContentProps) => react.JSX.Element;
|
|
547
|
+
type CommitFilesProps = HTMLAttributes<HTMLDivElement>;
|
|
548
|
+
declare const CommitFiles: ({ className, children, ...props }: CommitFilesProps) => react.JSX.Element;
|
|
549
|
+
type CommitFileProps = HTMLAttributes<HTMLDivElement>;
|
|
550
|
+
declare const CommitFile: ({ className, children, ...props }: CommitFileProps) => react.JSX.Element;
|
|
551
|
+
type CommitFileInfoProps = HTMLAttributes<HTMLDivElement>;
|
|
552
|
+
declare const CommitFileInfo: ({ className, children, ...props }: CommitFileInfoProps) => react.JSX.Element;
|
|
553
|
+
type CommitFileStatusProps = HTMLAttributes<HTMLSpanElement> & {
|
|
554
|
+
status: "added" | "modified" | "deleted" | "renamed";
|
|
555
|
+
};
|
|
556
|
+
declare const CommitFileStatus: ({ status, className, children, ...props }: CommitFileStatusProps) => react.JSX.Element;
|
|
557
|
+
type CommitFileIconProps = ComponentProps<typeof FileIcon>;
|
|
558
|
+
declare const CommitFileIcon: ({ className, ...props }: CommitFileIconProps) => react.JSX.Element;
|
|
559
|
+
type CommitFilePathProps = HTMLAttributes<HTMLSpanElement>;
|
|
560
|
+
declare const CommitFilePath: ({ className, children, ...props }: CommitFilePathProps) => react.JSX.Element;
|
|
561
|
+
type CommitFileChangesProps = HTMLAttributes<HTMLDivElement>;
|
|
562
|
+
declare const CommitFileChanges: ({ className, children, ...props }: CommitFileChangesProps) => react.JSX.Element;
|
|
563
|
+
type CommitFileAdditionsProps = HTMLAttributes<HTMLSpanElement> & {
|
|
564
|
+
count: number;
|
|
565
|
+
};
|
|
566
|
+
declare const CommitFileAdditions: ({ count, className, children, ...props }: CommitFileAdditionsProps) => react.JSX.Element | null;
|
|
567
|
+
type CommitFileDeletionsProps = HTMLAttributes<HTMLSpanElement> & {
|
|
568
|
+
count: number;
|
|
569
|
+
};
|
|
570
|
+
declare const CommitFileDeletions: ({ count, className, children, ...props }: CommitFileDeletionsProps) => react.JSX.Element | null;
|
|
571
|
+
|
|
572
|
+
interface AttachmentsContext {
|
|
573
|
+
files: (FileUIPart & {
|
|
574
|
+
id: string;
|
|
575
|
+
})[];
|
|
576
|
+
add: (files: File[] | FileList) => void;
|
|
577
|
+
remove: (id: string) => void;
|
|
578
|
+
clear: () => void;
|
|
579
|
+
openFileDialog: () => void;
|
|
580
|
+
fileInputRef: RefObject<HTMLInputElement | null>;
|
|
581
|
+
}
|
|
582
|
+
interface TextInputContext {
|
|
583
|
+
value: string;
|
|
584
|
+
setInput: (v: string) => void;
|
|
585
|
+
clear: () => void;
|
|
586
|
+
}
|
|
587
|
+
interface PromptInputControllerProps {
|
|
588
|
+
textInput: TextInputContext;
|
|
589
|
+
attachments: AttachmentsContext;
|
|
590
|
+
/** INTERNAL: Allows PromptInput to register its file textInput + "open" callback */
|
|
591
|
+
__registerFileInput: (ref: RefObject<HTMLInputElement | null>, open: () => void) => void;
|
|
592
|
+
}
|
|
593
|
+
declare const usePromptInputController: () => PromptInputControllerProps;
|
|
594
|
+
declare const useProviderAttachments: () => AttachmentsContext;
|
|
595
|
+
type PromptInputProviderProps = PropsWithChildren<{
|
|
596
|
+
initialInput?: string;
|
|
597
|
+
}>;
|
|
598
|
+
/**
|
|
599
|
+
* Optional global provider that lifts PromptInput state outside of PromptInput.
|
|
600
|
+
* If you don't use it, PromptInput stays fully self-managed.
|
|
601
|
+
*/
|
|
602
|
+
declare const PromptInputProvider: ({ initialInput: initialTextInput, children, }: PromptInputProviderProps) => react.JSX.Element;
|
|
603
|
+
declare const usePromptInputAttachments: () => AttachmentsContext;
|
|
604
|
+
interface ReferencedSourcesContext {
|
|
605
|
+
sources: (SourceDocumentUIPart & {
|
|
606
|
+
id: string;
|
|
607
|
+
})[];
|
|
608
|
+
add: (sources: SourceDocumentUIPart[] | SourceDocumentUIPart) => void;
|
|
609
|
+
remove: (id: string) => void;
|
|
610
|
+
clear: () => void;
|
|
611
|
+
}
|
|
612
|
+
declare const LocalReferencedSourcesContext: react.Context<ReferencedSourcesContext | null>;
|
|
613
|
+
declare const usePromptInputReferencedSources: () => ReferencedSourcesContext;
|
|
614
|
+
type PromptInputActionAddAttachmentsProps = ComponentProps<typeof DropdownMenuItem> & {
|
|
615
|
+
label?: string;
|
|
616
|
+
};
|
|
617
|
+
declare const PromptInputActionAddAttachments: ({ label, ...props }: PromptInputActionAddAttachmentsProps) => react.JSX.Element;
|
|
618
|
+
type PromptInputActionAddScreenshotProps = ComponentProps<typeof DropdownMenuItem> & {
|
|
619
|
+
label?: string;
|
|
620
|
+
};
|
|
621
|
+
declare const PromptInputActionAddScreenshot: ({ label, onSelect, ...props }: PromptInputActionAddScreenshotProps) => react.JSX.Element;
|
|
622
|
+
interface PromptInputMessage {
|
|
623
|
+
text: string;
|
|
624
|
+
files: FileUIPart[];
|
|
625
|
+
}
|
|
626
|
+
type PromptInputProps = Omit<HTMLAttributes<HTMLFormElement>, "onSubmit" | "onError"> & {
|
|
627
|
+
accept?: string;
|
|
628
|
+
multiple?: boolean;
|
|
629
|
+
globalDrop?: boolean;
|
|
630
|
+
syncHiddenInput?: boolean;
|
|
631
|
+
maxFiles?: number;
|
|
632
|
+
maxFileSize?: number;
|
|
633
|
+
/**
|
|
634
|
+
* The fill of the inner well (the `InputGroup` `variant`). `"surface"`
|
|
635
|
+
* (default) is the standard muted composer look; `"card"` renders a
|
|
636
|
+
* `bg-card` well for nesting inside an already-tinted outer frame — the
|
|
637
|
+
* "double card" look (#254). e.g.
|
|
638
|
+
* `<div className="rounded-xl bg-surface-muted p-1.5"><PromptInput tone="card">…</PromptInput></div>`.
|
|
639
|
+
* The well fill is NOT universally "white": `--card` reads lighter
|
|
640
|
+
* (raised) than `--surface-muted` on light themes, but darker (recessed) on
|
|
641
|
+
* dark — the same theme-dependent trade-off documented
|
|
642
|
+
* for `bg-surface-muted`-as-a-well in `styling-and-tokens.md`. The well
|
|
643
|
+
* stays a legible, distinct tone against the outer frame in every theme;
|
|
644
|
+
* only the "raised" framing is light-themes-specific.
|
|
645
|
+
*/
|
|
646
|
+
tone?: "surface" | "card";
|
|
647
|
+
onError?: (err: {
|
|
648
|
+
code: "max_files" | "max_file_size" | "accept";
|
|
649
|
+
message: string;
|
|
650
|
+
}) => void;
|
|
651
|
+
onSubmit: (message: PromptInputMessage, event: FormEvent<HTMLFormElement>) => void | Promise<void>;
|
|
652
|
+
/**
|
|
653
|
+
* Classes for the inner surface (the visible `InputGroup` well), e.g. to shape
|
|
654
|
+
* its corners. `className` styles the outer `<form>`; this styles the well —
|
|
655
|
+
* the only way to reach it from outside (used by `Composer`).
|
|
656
|
+
*/
|
|
657
|
+
surfaceClassName?: string;
|
|
658
|
+
};
|
|
659
|
+
declare const PromptInput: ({ className, surfaceClassName, tone, accept, multiple, globalDrop, syncHiddenInput, maxFiles, maxFileSize, onError, onSubmit, children, ...props }: PromptInputProps) => react.JSX.Element;
|
|
660
|
+
type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
661
|
+
declare const PromptInputBody: ({ className, ...props }: PromptInputBodyProps) => react.JSX.Element;
|
|
662
|
+
type PromptInputTextareaProps = ComponentProps<typeof InputGroupTextarea>;
|
|
663
|
+
declare const PromptInputTextarea: ({ onChange, onKeyDown, className, placeholder, ...props }: PromptInputTextareaProps) => react.JSX.Element;
|
|
664
|
+
type PromptInputHeaderProps = Omit<ComponentProps<typeof InputGroupAddon>, "align">;
|
|
665
|
+
declare const PromptInputHeader: ({ className, ...props }: PromptInputHeaderProps) => react.JSX.Element;
|
|
666
|
+
type PromptInputFooterProps = Omit<ComponentProps<typeof InputGroupAddon>, "align">;
|
|
667
|
+
declare const PromptInputFooter: ({ className, ...props }: PromptInputFooterProps) => react.JSX.Element;
|
|
668
|
+
type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
|
|
669
|
+
declare const PromptInputTools: ({ className, ...props }: PromptInputToolsProps) => react.JSX.Element;
|
|
670
|
+
type PromptInputButtonTooltip = string | {
|
|
671
|
+
content: ReactNode;
|
|
672
|
+
shortcut?: string;
|
|
673
|
+
side?: ComponentProps<typeof TooltipContent>["side"];
|
|
674
|
+
};
|
|
675
|
+
type PromptInputButtonProps = ComponentProps<typeof InputGroupButton> & {
|
|
676
|
+
tooltip?: PromptInputButtonTooltip;
|
|
677
|
+
};
|
|
678
|
+
declare const PromptInputButton: ({ variant, className, size, tooltip, "aria-label": ariaLabelProp, ...props }: PromptInputButtonProps) => react.JSX.Element;
|
|
679
|
+
type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;
|
|
680
|
+
declare const PromptInputActionMenu: (props: PromptInputActionMenuProps) => react.JSX.Element;
|
|
681
|
+
type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
|
|
682
|
+
declare const PromptInputActionMenuTrigger: ({ className, children, ...props }: PromptInputActionMenuTriggerProps) => react.JSX.Element;
|
|
683
|
+
type PromptInputActionMenuContentProps = ComponentProps<typeof DropdownMenuContent>;
|
|
684
|
+
declare const PromptInputActionMenuContent: ({ className, ...props }: PromptInputActionMenuContentProps) => react.JSX.Element;
|
|
685
|
+
type PromptInputActionMenuItemProps = ComponentProps<typeof DropdownMenuItem>;
|
|
686
|
+
declare const PromptInputActionMenuItem: ({ className, ...props }: PromptInputActionMenuItemProps) => react.JSX.Element;
|
|
687
|
+
/**
|
|
688
|
+
* Which action the merged primary control currently performs (#351). The
|
|
689
|
+
* component owns the AFFORDANCE only — it always invokes `onSubmit` (via the
|
|
690
|
+
* normal form submit) once the action is "send", never `onStop`. What a
|
|
691
|
+
* mid-turn submit MEANS (queued, interleaved, dropped) is entirely up to the
|
|
692
|
+
* app's own `onSubmit`/runtime — brand-ui asserts nothing about that (D5).
|
|
693
|
+
*/
|
|
694
|
+
type PromptInputSubmitAction = "send" | "stop";
|
|
695
|
+
type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {
|
|
696
|
+
status?: ChatStatus;
|
|
697
|
+
onStop?: () => void;
|
|
698
|
+
/**
|
|
699
|
+
* Glyph for the SEND action only — survives the send↔stop flip, so a
|
|
700
|
+
* consumer's resting glyph (e.g. `Composer`'s circular arrow) is no longer
|
|
701
|
+
* lost while generating with a non-empty composer. Prefer this over
|
|
702
|
+
* `children`.
|
|
703
|
+
*/
|
|
704
|
+
sendIcon?: ReactNode;
|
|
705
|
+
/**
|
|
706
|
+
* @deprecated Replaces the glyph for **every** status — ready, submitted,
|
|
707
|
+
* streaming AND error — which is why generating/error affordances can
|
|
708
|
+
* disappear even though the control is still live. Prefer `sendIcon`,
|
|
709
|
+
* which only ever replaces the resting Send glyph.
|
|
710
|
+
*/
|
|
711
|
+
children?: ReactNode;
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* Merged primary-action contract (#351):
|
|
715
|
+
* 1. `ready`/`undefined`/`error` → **Send** (unchanged).
|
|
716
|
+
* 2. `submitted`/`streaming` + composer EMPTY → **Stop** (unchanged).
|
|
717
|
+
* 3. `submitted`/`streaming` + composer NON-EMPTY → **Send** (the fix — a
|
|
718
|
+
* follow-up can always be composed and submitted mid-turn).
|
|
719
|
+
* 4. A `PromptInputStop` mounted alongside → this control is ALWAYS Send;
|
|
720
|
+
* the dedicated control owns stopping (the composed "separate" shape).
|
|
721
|
+
*/
|
|
722
|
+
declare const PromptInputSubmit: ({ className, variant, size, status, onStop, onClick, children, sendIcon, disabled, ...props }: PromptInputSubmitProps) => react.JSX.Element;
|
|
723
|
+
type PromptInputStopProps = ComponentProps<typeof InputGroupButton> & {
|
|
724
|
+
status?: ChatStatus;
|
|
725
|
+
onStop: () => void;
|
|
726
|
+
/** Glyph override; defaults to a square Stop icon. */
|
|
727
|
+
children?: ReactNode;
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* A dedicated Stop control — the composed answer to "two buttons" (#351;
|
|
731
|
+
* never a `mode` prop, per `component-api.md`'s ban on behavioural-mode
|
|
732
|
+
* props). Renders `null` unless the turn is running (`status` is `submitted`
|
|
733
|
+
* or `streaming`). While at least one `PromptInputStop` is mounted inside the
|
|
734
|
+
* same `PromptInput`, `PromptInputSubmit` stays the Send action in every
|
|
735
|
+
* state — the dedicated control owns stopping instead.
|
|
736
|
+
*/
|
|
737
|
+
declare const PromptInputStop: ({ className, variant, size, status, onStop, onClick, children, ...props }: PromptInputStopProps) => react.JSX.Element | null;
|
|
738
|
+
type PromptInputSelectProps = ComponentProps<typeof Select>;
|
|
739
|
+
declare const PromptInputSelect: (props: PromptInputSelectProps) => react.JSX.Element;
|
|
740
|
+
type PromptInputSelectTriggerProps = ComponentProps<typeof SelectTrigger>;
|
|
741
|
+
declare const PromptInputSelectTrigger: ({ className, ...props }: PromptInputSelectTriggerProps) => react.JSX.Element;
|
|
742
|
+
type PromptInputSelectContentProps = ComponentProps<typeof SelectContent>;
|
|
743
|
+
declare const PromptInputSelectContent: ({ className, ...props }: PromptInputSelectContentProps) => react.JSX.Element;
|
|
744
|
+
type PromptInputSelectItemProps = ComponentProps<typeof SelectItem>;
|
|
745
|
+
declare const PromptInputSelectItem: ({ className, ...props }: PromptInputSelectItemProps) => react.JSX.Element;
|
|
746
|
+
type PromptInputSelectValueProps = ComponentProps<typeof SelectValue>;
|
|
747
|
+
declare const PromptInputSelectValue: ({ className, ...props }: PromptInputSelectValueProps) => react.JSX.Element;
|
|
748
|
+
type PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;
|
|
749
|
+
declare const PromptInputHoverCard: ({ openDelay, closeDelay, ...props }: PromptInputHoverCardProps) => react.JSX.Element;
|
|
750
|
+
type PromptInputHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
|
|
751
|
+
declare const PromptInputHoverCardTrigger: (props: PromptInputHoverCardTriggerProps) => react.JSX.Element;
|
|
752
|
+
type PromptInputHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
|
|
753
|
+
declare const PromptInputHoverCardContent: ({ align, ...props }: PromptInputHoverCardContentProps) => react.JSX.Element;
|
|
754
|
+
type PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;
|
|
755
|
+
declare const PromptInputTabsList: ({ className, ...props }: PromptInputTabsListProps) => react.JSX.Element;
|
|
756
|
+
type PromptInputTabProps = HTMLAttributes<HTMLDivElement>;
|
|
757
|
+
declare const PromptInputTab: ({ className, ...props }: PromptInputTabProps) => react.JSX.Element;
|
|
758
|
+
type PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;
|
|
759
|
+
declare const PromptInputTabLabel: ({ className, ...props }: PromptInputTabLabelProps) => react.JSX.Element;
|
|
760
|
+
type PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
761
|
+
declare const PromptInputTabBody: ({ className, ...props }: PromptInputTabBodyProps) => react.JSX.Element;
|
|
762
|
+
type PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;
|
|
763
|
+
declare const PromptInputTabItem: ({ className, ...props }: PromptInputTabItemProps) => react.JSX.Element;
|
|
764
|
+
type PromptInputCommandProps = ComponentProps<typeof Command>;
|
|
765
|
+
declare const PromptInputCommand: ({ className, ...props }: PromptInputCommandProps) => react.JSX.Element;
|
|
766
|
+
type PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;
|
|
767
|
+
declare const PromptInputCommandInput: ({ className, ...props }: PromptInputCommandInputProps) => react.JSX.Element;
|
|
768
|
+
type PromptInputCommandListProps = ComponentProps<typeof CommandList>;
|
|
769
|
+
declare const PromptInputCommandList: ({ className, ...props }: PromptInputCommandListProps) => react.JSX.Element;
|
|
770
|
+
type PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
771
|
+
declare const PromptInputCommandEmpty: ({ className, ...props }: PromptInputCommandEmptyProps) => react.JSX.Element;
|
|
772
|
+
type PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;
|
|
773
|
+
declare const PromptInputCommandGroup: ({ className, ...props }: PromptInputCommandGroupProps) => react.JSX.Element;
|
|
774
|
+
type PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;
|
|
775
|
+
/**
|
|
776
|
+
* A selectable row inside `PromptInputCommand` (e.g. an `@`-mention popup).
|
|
777
|
+
*
|
|
778
|
+
* `id`/`role`/`aria-selected` are assigned internally by the `cmdk` dependency
|
|
779
|
+
* itself — one layer below this wrapper and below `@elabs-ai/components-ui`'s
|
|
780
|
+
* own `CommandItem` — and applied AFTER any props you pass, so a
|
|
781
|
+
* consumer-supplied `id`/`role`/`aria-selected` is silently overridden
|
|
782
|
+
* (`CommandItem` warns about this in development; #365).
|
|
783
|
+
*
|
|
784
|
+
* To wire `aria-activedescendant` from an input rendered OUTSIDE this
|
|
785
|
+
* `PromptInputCommand` tree (the composer textarea driving the popup), use
|
|
786
|
+
* `PromptInputCommand`'s `onActiveItemIdChange` callback (inherited from
|
|
787
|
+
* `@elabs-ai/components-ui`'s `Command`, since `PromptInputCommandProps =
|
|
788
|
+
* ComponentProps<typeof Command>`) instead of reading the id back
|
|
789
|
+
* positionally from the DOM:
|
|
790
|
+
*
|
|
791
|
+
* ```tsx
|
|
792
|
+
* const [activeId, setActiveId] = useState<string>();
|
|
793
|
+
* <textarea role="combobox" aria-expanded={open} aria-controls={listId}
|
|
794
|
+
* aria-activedescendant={activeId} />
|
|
795
|
+
* <PromptInputCommand onActiveItemIdChange={setActiveId}>…</PromptInputCommand>
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
798
|
+
declare const PromptInputCommandItem: ({ className, ...props }: PromptInputCommandItemProps) => react.JSX.Element;
|
|
799
|
+
type PromptInputCommandSeparatorProps = ComponentProps<typeof CommandSeparator>;
|
|
800
|
+
declare const PromptInputCommandSeparator: ({ className, ...props }: PromptInputCommandSeparatorProps) => react.JSX.Element;
|
|
801
|
+
|
|
802
|
+
interface ComposerProps {
|
|
803
|
+
/** Submit handler — receives the assembled message (text + attachments). */
|
|
804
|
+
onSubmit?: PromptInputProps["onSubmit"];
|
|
805
|
+
/** Textarea placeholder. Default `"Ask me anything…"`. */
|
|
806
|
+
placeholder?: string;
|
|
807
|
+
/**
|
|
808
|
+
* Muted status line shown above the input well. Default `"Awaiting your
|
|
809
|
+
* input"`. Drive it from chat state ("Thinking…", "Generating…") or pass
|
|
810
|
+
* `null` to hide the strip entirely.
|
|
811
|
+
*/
|
|
812
|
+
status?: ReactNode;
|
|
813
|
+
/** Model-selector pill label. Default `"Claude Opus 4"`; pass `null` to hide it. */
|
|
814
|
+
model?: ReactNode;
|
|
815
|
+
/**
|
|
816
|
+
* Override the left-hand tool cluster (attach + model pill) — e.g. to add a
|
|
817
|
+
* web-search or connect-data control. Render `PromptInputButton`s /
|
|
818
|
+
* `PromptInputActionMenu` here; when set, `showAttach`/`model` are ignored.
|
|
819
|
+
*/
|
|
820
|
+
tools?: ReactNode;
|
|
821
|
+
/** Send-button state, forwarded to `PromptInputSubmit` (ready/submitted/streaming/error). */
|
|
822
|
+
sendStatus?: ComponentProps<typeof PromptInputSubmit>["status"];
|
|
823
|
+
/** Stop handler used while the send button shows the generating state. */
|
|
824
|
+
onStop?: ComponentProps<typeof PromptInputSubmit>["onStop"];
|
|
825
|
+
/**
|
|
826
|
+
* Extra props spread onto the send button — `disabled`, `aria-label`,
|
|
827
|
+
* `variant`, `id`, `className`. `status` and `onStop` are excluded because
|
|
828
|
+
* `Composer` owns them via `sendStatus` / `onStop` above. (A `data-*` key is
|
|
829
|
+
* not assignable through this object: TypeScript only permits arbitrary
|
|
830
|
+
* `data-*` on a JSX element directly, not on a typed props object. Reach for
|
|
831
|
+
* `id` or `aria-label` as the test hook.)
|
|
832
|
+
*
|
|
833
|
+
* **`disabled` is the one that matters for correctness.** `PromptInput`'s
|
|
834
|
+
* submit handler calls `form.reset()` as soon as it ACCEPTS a submit, so a
|
|
835
|
+
* consumer that refuses the send inside `onSubmit` — an app doing async setup
|
|
836
|
+
* on the first message, say — has already had the textarea cleared and the
|
|
837
|
+
* user's text destroyed, with nothing to restore from. Disabling the control
|
|
838
|
+
* is what actually prevents it: `PromptInputTextarea`'s Enter handler checks
|
|
839
|
+
* `submitControl?.disabled` and bails before `requestSubmit()`, so the Enter
|
|
840
|
+
* path is closed too, not just the click.
|
|
841
|
+
*
|
|
842
|
+
* Leave it UNSET rather than passing `false` when you have no opinion —
|
|
843
|
+
* `PromptInputSubmit` resolves `disabled ?? autoDisabled`, so a literal
|
|
844
|
+
* `false` opts out of the library's own empty-composer guard.
|
|
845
|
+
*/
|
|
846
|
+
submitProps?: Omit<ComponentProps<typeof PromptInputSubmit>, "status" | "onStop">;
|
|
847
|
+
/**
|
|
848
|
+
* The two-tone arrangement, forwarded to the `tone` prop of `PromptInput`.
|
|
849
|
+
* `"surface"` (default, unchanged) is the original Composer look — an outer
|
|
850
|
+
* `bg-card` frame around the standard muted `PromptInput` well — so every
|
|
851
|
+
* existing usage is unaffected. `"card"` swaps to the tinted-outer/
|
|
852
|
+
* distinct-inner "double card" (#254): an outer `bg-surface-muted` frame
|
|
853
|
+
* around a `tone="card"` well. The well fill relative to the frame is
|
|
854
|
+
* theme-driven, not universally "white" — raised on light themes, recessed
|
|
855
|
+
* on dark; see the `tone` prop doc on `PromptInput`.
|
|
856
|
+
*/
|
|
857
|
+
tone?: PromptInputProps["tone"];
|
|
858
|
+
/** Optional suggestion chips rendered beneath the composer. */
|
|
859
|
+
suggestions?: string[];
|
|
860
|
+
/** Click handler for a suggestion chip. */
|
|
861
|
+
onSuggestionClick?: (suggestion: string) => void;
|
|
862
|
+
/** Show the voice button. Default `true`. */
|
|
863
|
+
showVoice?: boolean;
|
|
864
|
+
/** Show the attach button. Default `true`. */
|
|
865
|
+
showAttach?: boolean;
|
|
866
|
+
/** Extra classes for the outer card frame. */
|
|
867
|
+
className?: string;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Composer — the standard brand-ui AI chat input.
|
|
871
|
+
*
|
|
872
|
+
* A rounded two-tone "double card": a status strip wrapping a recessed
|
|
873
|
+
* `PromptInput` well (sharp top, theme-rounded bottom), a model pill, voice,
|
|
874
|
+
* and a circular send. Built on the real `PromptInput`, so it drops into a
|
|
875
|
+
* `ChatShell` footer or stands alone as an empty-state composer. `tone`
|
|
876
|
+
* (default `"surface"`, unchanged) picks the arrangement: `"surface"` keeps
|
|
877
|
+
* the original outer `bg-card` frame around the standard muted well;
|
|
878
|
+
* `"card"` (#254) swaps to an outer `bg-surface-muted` frame around a
|
|
879
|
+
* `tone="card"` well — the well fill is theme-driven (raised on light
|
|
880
|
+
* themes, recessed on dark), not universally white; see the
|
|
881
|
+
* `tone` prop doc on `PromptInput`. Semantic tokens only; theme-aware radii
|
|
882
|
+
* (`rounded-xl` frame / `rounded-b-lg` well); reads in every theme.
|
|
883
|
+
*
|
|
884
|
+
* This is the canonical chat input — reach for it instead of hand-rolling a
|
|
885
|
+
* `PromptInput` footer.
|
|
886
|
+
*/
|
|
887
|
+
declare function Composer({ onSubmit, placeholder, status, model, tools, sendStatus, onStop, submitProps, suggestions, onSuggestionClick, showVoice, showAttach, tone, className, }: ComposerProps): react.JSX.Element;
|
|
888
|
+
|
|
889
|
+
type ToolUIPartApproval = {
|
|
890
|
+
id: string;
|
|
891
|
+
approved?: never;
|
|
892
|
+
reason?: never;
|
|
893
|
+
} | {
|
|
894
|
+
id: string;
|
|
895
|
+
approved: boolean;
|
|
896
|
+
reason?: string;
|
|
897
|
+
} | {
|
|
898
|
+
id: string;
|
|
899
|
+
approved: true;
|
|
900
|
+
reason?: string;
|
|
901
|
+
} | {
|
|
902
|
+
id: string;
|
|
903
|
+
approved: false;
|
|
904
|
+
reason?: string;
|
|
905
|
+
} | undefined;
|
|
906
|
+
type ConfirmationProps = ComponentProps<typeof Alert> & {
|
|
907
|
+
approval?: ToolUIPartApproval;
|
|
908
|
+
state: ToolUIPart["state"];
|
|
909
|
+
};
|
|
910
|
+
declare const Confirmation: ({ className, approval, state, variant, role, children, ...props }: ConfirmationProps) => react.JSX.Element | null;
|
|
911
|
+
type ConfirmationTitleProps = ComponentProps<typeof AlertTitle>;
|
|
912
|
+
/**
|
|
913
|
+
* The question zone (research 11 §B.3 APPROVE-3) — out-ranks the surrounding
|
|
914
|
+
* `text-body` and names the pending region via the card's `aria-labelledby`.
|
|
915
|
+
*/
|
|
916
|
+
declare const ConfirmationTitle: ({ className, id, ...props }: ConfirmationTitleProps) => react.JSX.Element;
|
|
917
|
+
type ConfirmationDescriptionProps = ComponentProps<typeof AlertDescription>;
|
|
918
|
+
/** The consequence zone — what approving will actually do (research 11 §B.3). */
|
|
919
|
+
declare const ConfirmationDescription: ({ className, ...props }: ConfirmationDescriptionProps) => react.JSX.Element;
|
|
920
|
+
interface ConfirmationRequestProps {
|
|
921
|
+
children?: ReactNode;
|
|
922
|
+
}
|
|
923
|
+
declare const ConfirmationRequest: ({ children }: ConfirmationRequestProps) => ReactNode;
|
|
924
|
+
interface ConfirmationAcceptedProps {
|
|
925
|
+
children?: ReactNode;
|
|
926
|
+
}
|
|
927
|
+
declare const ConfirmationAccepted: ({ children }: ConfirmationAcceptedProps) => ReactNode;
|
|
928
|
+
interface ConfirmationRejectedProps {
|
|
929
|
+
children?: ReactNode;
|
|
930
|
+
}
|
|
931
|
+
declare const ConfirmationRejected: ({ children }: ConfirmationRejectedProps) => ReactNode;
|
|
932
|
+
type ConfirmationActionsProps = ComponentProps<"div">;
|
|
933
|
+
declare const ConfirmationActions: ({ className, ...props }: ConfirmationActionsProps) => react.JSX.Element | null;
|
|
934
|
+
type ConfirmationActionProps = ComponentProps<typeof Button>;
|
|
935
|
+
declare const ConfirmationAction: ({ className, ...props }: ConfirmationActionProps) => react.JSX.Element;
|
|
936
|
+
type ConfirmationApproveProps = ConfirmationActionProps;
|
|
937
|
+
/**
|
|
938
|
+
* The proceed action — presets the filled primary variant (research 11 §B.3
|
|
939
|
+
* APPROVE-2). Role-named so the primary path cannot drift to `outline`.
|
|
940
|
+
*/
|
|
941
|
+
declare const ConfirmationApprove: (props: ConfirmationApproveProps) => react.JSX.Element;
|
|
942
|
+
type ConfirmationDenyProps = ConfirmationActionProps;
|
|
943
|
+
/** The decline action — presets the quiet `ghost` variant, never `outline`. */
|
|
944
|
+
declare const ConfirmationDeny: (props: ConfirmationDenyProps) => react.JSX.Element;
|
|
945
|
+
declare const ApprovalCard: ({ className, approval, state, variant, role, children, ...props }: ConfirmationProps) => react.JSX.Element | null;
|
|
946
|
+
type ApprovalCardProps = ConfirmationProps;
|
|
947
|
+
declare const ApprovalCardTitle: ({ className, id, ...props }: ConfirmationTitleProps) => react.JSX.Element;
|
|
948
|
+
type ApprovalCardTitleProps = ConfirmationTitleProps;
|
|
949
|
+
declare const ApprovalCardDescription: ({ className, ...props }: ConfirmationDescriptionProps) => react.JSX.Element;
|
|
950
|
+
type ApprovalCardDescriptionProps = ConfirmationDescriptionProps;
|
|
951
|
+
declare const ApprovalCardRequest: ({ children }: ConfirmationRequestProps) => ReactNode;
|
|
952
|
+
type ApprovalCardRequestProps = ConfirmationRequestProps;
|
|
953
|
+
declare const ApprovalCardAccepted: ({ children }: ConfirmationAcceptedProps) => ReactNode;
|
|
954
|
+
type ApprovalCardAcceptedProps = ConfirmationAcceptedProps;
|
|
955
|
+
declare const ApprovalCardRejected: ({ children }: ConfirmationRejectedProps) => ReactNode;
|
|
956
|
+
type ApprovalCardRejectedProps = ConfirmationRejectedProps;
|
|
957
|
+
declare const ApprovalCardActions: ({ className, ...props }: ConfirmationActionsProps) => react.JSX.Element | null;
|
|
958
|
+
type ApprovalCardActionsProps = ConfirmationActionsProps;
|
|
959
|
+
declare const ApprovalCardAction: ({ className, ...props }: ConfirmationActionProps) => react.JSX.Element;
|
|
960
|
+
type ApprovalCardActionProps = ConfirmationActionProps;
|
|
961
|
+
declare const ApprovalCardApprove: (props: ConfirmationApproveProps) => react.JSX.Element;
|
|
962
|
+
type ApprovalCardApproveProps = ConfirmationApproveProps;
|
|
963
|
+
declare const ApprovalCardDeny: (props: ConfirmationDenyProps) => react.JSX.Element;
|
|
964
|
+
type ApprovalCardDenyProps = ConfirmationDenyProps;
|
|
965
|
+
|
|
966
|
+
declare const Connection: ConnectionLineComponent;
|
|
967
|
+
|
|
968
|
+
type ModelId = string;
|
|
969
|
+
interface ContextSchema {
|
|
970
|
+
usedTokens: number;
|
|
971
|
+
maxTokens: number;
|
|
972
|
+
usage?: LanguageModelUsage;
|
|
973
|
+
modelId?: ModelId;
|
|
974
|
+
}
|
|
975
|
+
type ContextProps = ComponentProps<typeof HoverCard> & ContextSchema;
|
|
976
|
+
declare const Context: ({ usedTokens, maxTokens, usage, modelId, ...props }: ContextProps) => react.JSX.Element;
|
|
977
|
+
type ContextTriggerProps = ComponentProps<typeof Button>;
|
|
978
|
+
declare const ContextTrigger: ({ children, ...props }: ContextTriggerProps) => react.JSX.Element;
|
|
979
|
+
type ContextContentProps = ComponentProps<typeof HoverCardContent>;
|
|
980
|
+
declare const ContextContent: ({ className, ...props }: ContextContentProps) => react.JSX.Element;
|
|
981
|
+
type ContextContentHeaderProps = ComponentProps<"div">;
|
|
982
|
+
declare const ContextContentHeader: ({ children, className, ...props }: ContextContentHeaderProps) => react.JSX.Element;
|
|
983
|
+
type ContextContentBodyProps = ComponentProps<"div">;
|
|
984
|
+
declare const ContextContentBody: ({ children, className, ...props }: ContextContentBodyProps) => react.JSX.Element;
|
|
985
|
+
type ContextContentFooterProps = ComponentProps<"div">;
|
|
986
|
+
declare const ContextContentFooter: ({ children, className, ...props }: ContextContentFooterProps) => react.JSX.Element;
|
|
987
|
+
type ContextInputUsageProps = ComponentProps<"div">;
|
|
988
|
+
declare const ContextInputUsage: ({ className, children, ...props }: ContextInputUsageProps) => string | number | bigint | true | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
989
|
+
type ContextOutputUsageProps = ComponentProps<"div">;
|
|
990
|
+
declare const ContextOutputUsage: ({ className, children, ...props }: ContextOutputUsageProps) => string | number | bigint | true | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
991
|
+
type ContextReasoningUsageProps = ComponentProps<"div">;
|
|
992
|
+
declare const ContextReasoningUsage: ({ className, children, ...props }: ContextReasoningUsageProps) => string | number | bigint | true | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
993
|
+
type ContextCacheUsageProps = ComponentProps<"div">;
|
|
994
|
+
declare const ContextCacheUsage: ({ className, children, ...props }: ContextCacheUsageProps) => string | number | bigint | true | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react.JSX.Element | null;
|
|
995
|
+
|
|
996
|
+
type ControlsProps = ComponentProps<typeof Controls$1>;
|
|
997
|
+
declare const Controls: (props: ControlsProps) => react.JSX.Element;
|
|
998
|
+
|
|
999
|
+
type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
1000
|
+
declare const Conversation: ({ className, ...props }: ConversationProps) => react.JSX.Element;
|
|
1001
|
+
type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
|
|
1002
|
+
declare const ConversationContent: ({ className, ...props }: ConversationContentProps) => react.JSX.Element;
|
|
1003
|
+
type ConversationEmptyStateProps = ComponentProps<"div"> & {
|
|
1004
|
+
title?: string;
|
|
1005
|
+
description?: string;
|
|
1006
|
+
icon?: React.ReactNode;
|
|
1007
|
+
};
|
|
1008
|
+
declare const ConversationEmptyState: ({ className, title, description, icon, children, ...props }: ConversationEmptyStateProps) => react.JSX.Element;
|
|
1009
|
+
type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
1010
|
+
declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => false | react.JSX.Element;
|
|
1011
|
+
type ConversationDownloadProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
|
|
1012
|
+
messages: UIMessage[];
|
|
1013
|
+
filename?: string;
|
|
1014
|
+
formatMessage?: (message: UIMessage, index: number) => string;
|
|
1015
|
+
};
|
|
1016
|
+
declare const messagesToMarkdown: (messages: UIMessage[], formatMessage?: (message: UIMessage, index: number) => string) => string;
|
|
1017
|
+
declare const ConversationDownload: ({ messages, filename, formatMessage, className, children, ...props }: ConversationDownloadProps) => react.JSX.Element;
|
|
1018
|
+
|
|
1019
|
+
declare const Edge: {
|
|
1020
|
+
Animated: (props: EdgeProps) => react.JSX.Element;
|
|
1021
|
+
Temporary: (props: EdgeProps) => react.JSX.Element;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
type EnvironmentVariablesProps = HTMLAttributes<HTMLDivElement> & {
|
|
1025
|
+
showValues?: boolean;
|
|
1026
|
+
defaultShowValues?: boolean;
|
|
1027
|
+
onShowValuesChange?: (show: boolean) => void;
|
|
1028
|
+
};
|
|
1029
|
+
declare const EnvironmentVariables: ({ showValues: controlledShowValues, defaultShowValues, onShowValuesChange, className, children, ...props }: EnvironmentVariablesProps) => react.JSX.Element;
|
|
1030
|
+
type EnvironmentVariablesHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1031
|
+
declare const EnvironmentVariablesHeader: ({ className, children, ...props }: EnvironmentVariablesHeaderProps) => react.JSX.Element;
|
|
1032
|
+
type EnvironmentVariablesTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
1033
|
+
declare const EnvironmentVariablesTitle: ({ className, children, ...props }: EnvironmentVariablesTitleProps) => react.JSX.Element;
|
|
1034
|
+
type EnvironmentVariablesToggleProps = ComponentProps<typeof Switch>;
|
|
1035
|
+
declare const EnvironmentVariablesToggle: ({ className, ...props }: EnvironmentVariablesToggleProps) => react.JSX.Element;
|
|
1036
|
+
type EnvironmentVariablesContentProps = HTMLAttributes<HTMLDivElement>;
|
|
1037
|
+
declare const EnvironmentVariablesContent: ({ className, children, ...props }: EnvironmentVariablesContentProps) => react.JSX.Element;
|
|
1038
|
+
type EnvironmentVariableGroupProps = HTMLAttributes<HTMLDivElement>;
|
|
1039
|
+
declare const EnvironmentVariableGroup: ({ className, children, ...props }: EnvironmentVariableGroupProps) => react.JSX.Element;
|
|
1040
|
+
type EnvironmentVariableNameProps = HTMLAttributes<HTMLSpanElement>;
|
|
1041
|
+
declare const EnvironmentVariableName: ({ className, children, ...props }: EnvironmentVariableNameProps) => react.JSX.Element;
|
|
1042
|
+
type EnvironmentVariableValueProps = HTMLAttributes<HTMLSpanElement>;
|
|
1043
|
+
declare const EnvironmentVariableValue: ({ className, children, ...props }: EnvironmentVariableValueProps) => react.JSX.Element;
|
|
1044
|
+
type EnvironmentVariableProps = HTMLAttributes<HTMLDivElement> & {
|
|
1045
|
+
name: string;
|
|
1046
|
+
value: string;
|
|
1047
|
+
};
|
|
1048
|
+
declare const EnvironmentVariable: ({ name, value, className, children, ...props }: EnvironmentVariableProps) => react.JSX.Element;
|
|
1049
|
+
type EnvironmentVariableCopyButtonProps = ComponentProps<typeof Button> & {
|
|
1050
|
+
onCopy?: () => void;
|
|
1051
|
+
onError?: (error: Error) => void;
|
|
1052
|
+
timeout?: number;
|
|
1053
|
+
copyFormat?: "name" | "value" | "export";
|
|
1054
|
+
};
|
|
1055
|
+
declare const EnvironmentVariableCopyButton: ({ onCopy, onError, timeout, copyFormat, children, className, ...props }: EnvironmentVariableCopyButtonProps) => react.JSX.Element;
|
|
1056
|
+
type EnvironmentVariableRequiredProps = ComponentProps<typeof Badge>;
|
|
1057
|
+
declare const EnvironmentVariableRequired: ({ className, children, ...props }: EnvironmentVariableRequiredProps) => react.JSX.Element;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Visual axis (#193, research 04 §4 ASSET-1): `code` (default, unchanged) is
|
|
1061
|
+
* the IDE source tree — mono + hard box; `document` is the produced-asset
|
|
1062
|
+
* look — sans body role, no box (section label + spacing separate it,
|
|
1063
|
+
* research 08), for trees of documents rather than source files.
|
|
1064
|
+
*/
|
|
1065
|
+
declare const fileTreeVariants: (props?: ({
|
|
1066
|
+
variant?: "code" | "document" | null | undefined;
|
|
1067
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1068
|
+
type FileTreeVariant = NonNullable<VariantProps<typeof fileTreeVariants>["variant"]>;
|
|
1069
|
+
type FileTreeProps = Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> & VariantProps<typeof fileTreeVariants> & {
|
|
1070
|
+
expanded?: Set<string>;
|
|
1071
|
+
defaultExpanded?: Set<string>;
|
|
1072
|
+
selectedPath?: string;
|
|
1073
|
+
onSelect?: (path: string) => void;
|
|
1074
|
+
onExpandedChange?: (expanded: Set<string>) => void;
|
|
1075
|
+
};
|
|
1076
|
+
declare const FileTree: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> & VariantProps<(props?: ({
|
|
1077
|
+
variant?: "code" | "document" | null | undefined;
|
|
1078
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
1079
|
+
expanded?: Set<string>;
|
|
1080
|
+
defaultExpanded?: Set<string>;
|
|
1081
|
+
selectedPath?: string;
|
|
1082
|
+
onSelect?: (path: string) => void;
|
|
1083
|
+
onExpandedChange?: (expanded: Set<string>) => void;
|
|
1084
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1085
|
+
type FileTreeIconProps = HTMLAttributes<HTMLSpanElement>;
|
|
1086
|
+
declare const FileTreeIcon: ({ className, children, ...props }: FileTreeIconProps) => react.JSX.Element;
|
|
1087
|
+
type FileTreeNameProps = HTMLAttributes<HTMLSpanElement>;
|
|
1088
|
+
declare const FileTreeName: ({ className, children, ...props }: FileTreeNameProps) => react.JSX.Element;
|
|
1089
|
+
type FileTreeFolderProps = HTMLAttributes<HTMLDivElement> & {
|
|
1090
|
+
path: string;
|
|
1091
|
+
name: string;
|
|
1092
|
+
};
|
|
1093
|
+
declare const FileTreeFolder: ({ path, name, className, children, ...props }: FileTreeFolderProps) => react.JSX.Element;
|
|
1094
|
+
type FileTreeFileProps = HTMLAttributes<HTMLDivElement> & {
|
|
1095
|
+
path: string;
|
|
1096
|
+
name: string;
|
|
1097
|
+
icon?: ReactNode;
|
|
1098
|
+
};
|
|
1099
|
+
declare const FileTreeFile: ({ path, name, icon, className, children, ...props }: FileTreeFileProps) => react.JSX.Element;
|
|
1100
|
+
type FileTreeActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
1101
|
+
declare const FileTreeActions: ({ className, children, ...props }: FileTreeActionsProps) => react.JSX.Element;
|
|
1102
|
+
/** Asset-type glyphs (lucide, research 04 §4) — doc / code / sql / csv / image. */
|
|
1103
|
+
declare const PRODUCED_ASSET_ICONS: Record<ContextAssetType, LucideIcon>;
|
|
1104
|
+
type ProducedAssetTreeProps = Omit<FileTreeProps, "variant" | "onSelect" | "selectedPath"> & {
|
|
1105
|
+
/** The produced assets, in display order. */
|
|
1106
|
+
assets: ContextAsset[];
|
|
1107
|
+
/** Selected asset id (mirror `useContextPanel().state.selectedAsset?.id`). */
|
|
1108
|
+
selectedId?: string;
|
|
1109
|
+
/** Called with the chosen asset — wire to `useContextPanel().actions.openDetail`. */
|
|
1110
|
+
onSelect?: (asset: ContextAsset) => void;
|
|
1111
|
+
};
|
|
1112
|
+
/**
|
|
1113
|
+
* ProducedAssetTree — the document-variant preset (#193, research 04 §4):
|
|
1114
|
+
* produced assets are documents, not source code, so the tree reads sans,
|
|
1115
|
+
* box-free, with first-class asset-type icons. Pair with `ContextPanelSection`
|
|
1116
|
+
* for the label; selection drives the ContextPanel drill-in.
|
|
1117
|
+
*/
|
|
1118
|
+
declare const ProducedAssetTree: react.ForwardRefExoticComponent<Omit<FileTreeProps, "onSelect" | "variant" | "selectedPath"> & {
|
|
1119
|
+
/** The produced assets, in display order. */
|
|
1120
|
+
assets: ContextAsset[];
|
|
1121
|
+
/** Selected asset id (mirror `useContextPanel().state.selectedAsset?.id`). */
|
|
1122
|
+
selectedId?: string;
|
|
1123
|
+
/** Called with the chosen asset — wire to `useContextPanel().actions.openDetail`. */
|
|
1124
|
+
onSelect?: (asset: ContextAsset) => void;
|
|
1125
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1126
|
+
|
|
1127
|
+
/** One labelled metadata row rendered in the detail panel `<dl>`. */
|
|
1128
|
+
interface GalleryMetaItem {
|
|
1129
|
+
/** Field label (rendered muted, in the `<dt>`). */
|
|
1130
|
+
label: string;
|
|
1131
|
+
/** Field value — a string in the common case; `ReactNode` allows a link/badge. */
|
|
1132
|
+
value: ReactNode;
|
|
1133
|
+
}
|
|
1134
|
+
/** A single gallery image plus its optional metadata. */
|
|
1135
|
+
interface GalleryImage {
|
|
1136
|
+
/** Full-resolution source shown in the lightbox and standalone tile. */
|
|
1137
|
+
src: string;
|
|
1138
|
+
/** Required alt text (a11y). Pass `""` to mark the image decorative. */
|
|
1139
|
+
alt: string;
|
|
1140
|
+
/** Cheaper thumbnail for the grid; falls back to `src`. */
|
|
1141
|
+
thumbnailSrc?: string;
|
|
1142
|
+
/** Headline shown in the panel; also feeds the dialog's accessible name. */
|
|
1143
|
+
title?: string;
|
|
1144
|
+
/** Long-form copy shown under the title in the detail panel. */
|
|
1145
|
+
description?: string;
|
|
1146
|
+
/** Structured key/value rows rendered as a `<dl>` in the detail panel. */
|
|
1147
|
+
meta?: GalleryMetaItem[];
|
|
1148
|
+
/** Overrides `src` for the download (e.g. a signed full-res URL). */
|
|
1149
|
+
downloadUrl?: string;
|
|
1150
|
+
/** Suggested download filename. */
|
|
1151
|
+
downloadName?: string;
|
|
1152
|
+
}
|
|
1153
|
+
interface GalleryProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1154
|
+
/** Images to display. `0` → empty state, `1` → standalone, `≥2` → grid. */
|
|
1155
|
+
images: GalleryImage[];
|
|
1156
|
+
/** Thumbnails to show before collapsing the rest into a "+N more" tile. @default 5 */
|
|
1157
|
+
maxVisible?: number;
|
|
1158
|
+
/** Aspect ratio for grid tiles and the standalone image. @default 1 (square) */
|
|
1159
|
+
aspectRatio?: number;
|
|
1160
|
+
/** Hide every download affordance (e.g. rights-restricted assets). @default false */
|
|
1161
|
+
hideDownload?: boolean;
|
|
1162
|
+
/**
|
|
1163
|
+
* The set is still arriving (loading-states.md `loading` signal). Renders
|
|
1164
|
+
* skeleton tiles in the grid footprint instead of the empty state, and fills
|
|
1165
|
+
* the gap up to `expectedCount` (or `maxVisible`) while images stream in.
|
|
1166
|
+
* @default false
|
|
1167
|
+
*/
|
|
1168
|
+
loading?: boolean;
|
|
1169
|
+
/**
|
|
1170
|
+
* Total images expected once the set finishes arriving. When
|
|
1171
|
+
* `images.length < expectedCount`, the arrived tiles render alongside
|
|
1172
|
+
* skeleton tiles for the missing ones, so the grid fills in place (no reflow).
|
|
1173
|
+
*/
|
|
1174
|
+
expectedCount?: number;
|
|
1175
|
+
/**
|
|
1176
|
+
* Replace the default metadata body in the detail panel. Receives the
|
|
1177
|
+
* currently-active image, so it stays in sync with the carousel. The panel
|
|
1178
|
+
* chrome + title heading remain.
|
|
1179
|
+
*/
|
|
1180
|
+
renderMeta?: (image: GalleryImage, index: number) => ReactNode;
|
|
1181
|
+
}
|
|
1182
|
+
declare const Gallery: react.ForwardRefExoticComponent<GalleryProps & react.RefAttributes<HTMLDivElement>>;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* part-groups.ts — Pure, framework-free part-grouping engine.
|
|
1186
|
+
*
|
|
1187
|
+
* Derives collapsible reasoning/tool traces from an ordered list of message
|
|
1188
|
+
* parts. This is a CLIENT-SIDE VIEW TRANSFORM — never a model output format.
|
|
1189
|
+
* Adapted from assistant-ui's grouping design onto this library's idiom.
|
|
1190
|
+
*
|
|
1191
|
+
* `groupBy(part, context)` maps each part to a group-key path (`group-…`);
|
|
1192
|
+
* ADJACENT parts sharing a key path coalesce into synthetic group nodes
|
|
1193
|
+
* (`{ type: "group-…", status, indices }`); multi-element paths nest. The
|
|
1194
|
+
* `group-` namespace is reserved so a group key can never collide with a real
|
|
1195
|
+
* part `type`.
|
|
1196
|
+
*/
|
|
1197
|
+
/** A reserved group-key. The `group-` prefix can't collide with real part types. */
|
|
1198
|
+
type GroupKey = `group-${string}`;
|
|
1199
|
+
/** Rolled-up status of a group (any member running → the group is running). */
|
|
1200
|
+
type GroupStatus = "pending" | "running" | "complete" | "error";
|
|
1201
|
+
/** The minimum a groupable part must expose. */
|
|
1202
|
+
interface GroupablePart {
|
|
1203
|
+
type: string;
|
|
1204
|
+
[key: string]: unknown;
|
|
1205
|
+
}
|
|
1206
|
+
/** Context passed to `groupBy` for each part. */
|
|
1207
|
+
interface GroupByContext<T extends GroupablePart> {
|
|
1208
|
+
index: number;
|
|
1209
|
+
parts: readonly T[];
|
|
1210
|
+
}
|
|
1211
|
+
/** Maps a part to its group-key path (`[]` = not grouped, a top-level leaf). */
|
|
1212
|
+
type GroupBy<T extends GroupablePart> = (part: T, context: GroupByContext<T>) => readonly GroupKey[];
|
|
1213
|
+
/** Extract a part's status; return `undefined` to fall back to the default. */
|
|
1214
|
+
type GetPartStatus<T extends GroupablePart> = (part: T) => GroupStatus | undefined;
|
|
1215
|
+
/** The synthetic node produced for a coalesced group. */
|
|
1216
|
+
interface PartGroupNode {
|
|
1217
|
+
type: GroupKey;
|
|
1218
|
+
status: GroupStatus;
|
|
1219
|
+
/** Original indices of every leaf part under this group (recursive). */
|
|
1220
|
+
indices: number[];
|
|
1221
|
+
}
|
|
1222
|
+
/** One node in the grouped tree — a leaf part or a synthetic group. */
|
|
1223
|
+
type GroupedNode<T extends GroupablePart> = {
|
|
1224
|
+
kind: "leaf";
|
|
1225
|
+
key: string;
|
|
1226
|
+
index: number;
|
|
1227
|
+
part: T;
|
|
1228
|
+
} | {
|
|
1229
|
+
kind: "group";
|
|
1230
|
+
key: string;
|
|
1231
|
+
group: PartGroupNode;
|
|
1232
|
+
children: GroupedNode<T>[];
|
|
1233
|
+
};
|
|
1234
|
+
/**
|
|
1235
|
+
* Best-effort status from common AI-SDK part shapes (tool `state`, reasoning
|
|
1236
|
+
* `state`, `isStreaming`). Overridable via `getStatus`.
|
|
1237
|
+
*/
|
|
1238
|
+
declare function defaultPartStatus(part: GroupablePart): GroupStatus;
|
|
1239
|
+
/** Roll several member statuses up into one group status. */
|
|
1240
|
+
declare function rollupStatus(statuses: readonly GroupStatus[]): GroupStatus;
|
|
1241
|
+
/**
|
|
1242
|
+
* Build the grouped tree from an ordered part list. Pure + deterministic —
|
|
1243
|
+
* never throws. Adjacent parts with a shared group-key path coalesce; multi-key
|
|
1244
|
+
* paths nest; ungrouped parts (path `[]`) stay as top-level leaves.
|
|
1245
|
+
*/
|
|
1246
|
+
declare function buildPartGroups<T extends GroupablePart>(parts: readonly T[], groupBy: GroupBy<T>, getStatus?: GetPartStatus<T>): GroupedNode<T>[];
|
|
1247
|
+
/**
|
|
1248
|
+
* A cheap fingerprint of the parts' identity + type + status. Feed it to a
|
|
1249
|
+
* `useMemo` so the grouped tree only rebuilds when something structural
|
|
1250
|
+
* changed — streaming token updates that don't change status won't churn it.
|
|
1251
|
+
*/
|
|
1252
|
+
declare function partsFingerprint<T extends GroupablePart>(parts: readonly T[], getStatus?: GetPartStatus<T>): string;
|
|
1253
|
+
/** Whether a part folds into a trace (`inline`) or always stands alone. */
|
|
1254
|
+
type PartDisplay = "inline" | "standalone";
|
|
1255
|
+
interface GroupPartByTypeOptions<T extends GroupablePart> {
|
|
1256
|
+
/** Group key for the collapsible trace. @default "group-work" */
|
|
1257
|
+
groupKey?: GroupKey;
|
|
1258
|
+
/** Part types folded into the trace. @default reasoning + tool-* + dynamic-tool + step-start */
|
|
1259
|
+
inline?: (string | RegExp)[];
|
|
1260
|
+
/** Part types forced standalone (never folded). @default approval / human / confirmation */
|
|
1261
|
+
standalone?: (string | RegExp)[];
|
|
1262
|
+
/** Explicit per-part classification; overrides the type lists. */
|
|
1263
|
+
classify?: (part: T) => PartDisplay | undefined;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Build a `groupBy` that folds reasoning/tool parts into ONE collapsible trace
|
|
1267
|
+
* while forcing human/approval-style parts to stand alone — an interaction card
|
|
1268
|
+
* must never fold into a thinking accordion. The classification maps to the
|
|
1269
|
+
* `display: "inline" | "standalone"` hint.
|
|
1270
|
+
*/
|
|
1271
|
+
declare function groupPartByType<T extends GroupablePart>(options?: GroupPartByTypeOptions<T>): GroupBy<T>;
|
|
1272
|
+
/** Type guard: is this render subject a synthetic group node? */
|
|
1273
|
+
declare function isGroupNode(part: {
|
|
1274
|
+
type: string;
|
|
1275
|
+
}): part is PartGroupNode;
|
|
1276
|
+
|
|
1277
|
+
interface GroupedPartRenderArgs<T extends GroupablePart> {
|
|
1278
|
+
/** The real part (leaf) or the synthetic group node. */
|
|
1279
|
+
part: T | PartGroupNode;
|
|
1280
|
+
/** True when `part` is a synthetic group node. */
|
|
1281
|
+
isGroup: boolean;
|
|
1282
|
+
/** The rendered subtree — group nodes only. */
|
|
1283
|
+
children?: ReactNode;
|
|
1284
|
+
/** Rolled-up status (groups) or the part's status (leaves). */
|
|
1285
|
+
status: GroupStatus;
|
|
1286
|
+
/** Original part indices under this group (groups only). */
|
|
1287
|
+
indices?: number[];
|
|
1288
|
+
/** Original part index (leaves only). */
|
|
1289
|
+
index?: number;
|
|
1290
|
+
}
|
|
1291
|
+
type GroupedPartRenderer<T extends GroupablePart> = (args: GroupedPartRenderArgs<T>) => ReactNode;
|
|
1292
|
+
interface GroupedPartsProps<T extends GroupablePart> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1293
|
+
/** The ordered message parts to render. */
|
|
1294
|
+
parts: readonly T[];
|
|
1295
|
+
/** How to group parts. @default `groupPartByType()` */
|
|
1296
|
+
groupBy?: GroupBy<T>;
|
|
1297
|
+
/** Extract a part's status (drives group rollup + streaming affordances). */
|
|
1298
|
+
getStatus?: GetPartStatus<T>;
|
|
1299
|
+
/** Render-prop switching on `part.type`. Omit to use the default renderers. */
|
|
1300
|
+
children?: GroupedPartRenderer<T>;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Renders `parts`, coalescing adjacent grouped parts into collapsible traces.
|
|
1304
|
+
* The tree only rebuilds when the parts' identity/type/status fingerprint
|
|
1305
|
+
* changes, so streaming token updates don't remount rows.
|
|
1306
|
+
*/
|
|
1307
|
+
declare function GroupedParts<T extends GroupablePart>({ parts, groupBy, getStatus, children, className, ...props }: GroupedPartsProps<T>): react.JSX.Element;
|
|
1308
|
+
|
|
1309
|
+
type ImageProps = Experimental_GeneratedImage & Omit<ImgHTMLAttributes<HTMLImageElement>, "src"> & {
|
|
1310
|
+
/**
|
|
1311
|
+
* Show a Skeleton placeholder (loading-states.md) until the img element
|
|
1312
|
+
* finishes decoding, so the base64 payload does not pop in. Requires
|
|
1313
|
+
* explicit `width`+`height` so the reserved box matches the final size
|
|
1314
|
+
* (interaction-guidelines.md Images section — prevents CLS); without
|
|
1315
|
+
* both there is no box to reserve, so the default is `false` in that
|
|
1316
|
+
* case rather than mounting a skeleton that collapses to nothing.
|
|
1317
|
+
* @default Boolean(width && height)
|
|
1318
|
+
*/
|
|
1319
|
+
showSkeleton?: boolean;
|
|
1320
|
+
};
|
|
1321
|
+
/** `<img>` wrapper for an AI-SDK generated image, with a decode-aware skeleton. */
|
|
1322
|
+
declare const Image: react.ForwardRefExoticComponent<Experimental_GeneratedImage & Omit<ImgHTMLAttributes<HTMLImageElement>, "src"> & {
|
|
1323
|
+
/**
|
|
1324
|
+
* Show a Skeleton placeholder (loading-states.md) until the img element
|
|
1325
|
+
* finishes decoding, so the base64 payload does not pop in. Requires
|
|
1326
|
+
* explicit `width`+`height` so the reserved box matches the final size
|
|
1327
|
+
* (interaction-guidelines.md Images section — prevents CLS); without
|
|
1328
|
+
* both there is no box to reserve, so the default is `false` in that
|
|
1329
|
+
* case rather than mounting a skeleton that collapses to nothing.
|
|
1330
|
+
* @default Boolean(width && height)
|
|
1331
|
+
*/
|
|
1332
|
+
showSkeleton?: boolean;
|
|
1333
|
+
} & react.RefAttributes<HTMLImageElement>>;
|
|
1334
|
+
|
|
1335
|
+
type InlineCitationProps = ComponentProps<"span">;
|
|
1336
|
+
declare const InlineCitation: ({ className, ...props }: InlineCitationProps) => react.JSX.Element;
|
|
1337
|
+
type InlineCitationTextProps = ComponentProps<"span">;
|
|
1338
|
+
declare const InlineCitationText: ({ className, ...props }: InlineCitationTextProps) => react.JSX.Element;
|
|
1339
|
+
type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
|
|
1340
|
+
declare const InlineCitationCard: (props: InlineCitationCardProps) => react.JSX.Element;
|
|
1341
|
+
/**
|
|
1342
|
+
* A cited source: a bare string — a URL, or any opaque id / human label — or a
|
|
1343
|
+
* labelled object.
|
|
1344
|
+
*
|
|
1345
|
+
* Non-URL sources are first-class. An agent citing a warehouse table, a document
|
|
1346
|
+
* id, an uploaded file or a wiki page has no hostname to show, and must not have
|
|
1347
|
+
* to synthesize a fake URL to satisfy the chip.
|
|
1348
|
+
*/
|
|
1349
|
+
type InlineCitationSourceRef = string | {
|
|
1350
|
+
/** Opaque identifier, shown when there is no `label` and no `url`. */
|
|
1351
|
+
id?: string;
|
|
1352
|
+
/** Human-readable label — wins over any hostname derived from `url`. */
|
|
1353
|
+
label?: string;
|
|
1354
|
+
/** Optional link; its hostname is the fallback label. */
|
|
1355
|
+
url?: string;
|
|
1356
|
+
};
|
|
1357
|
+
/**
|
|
1358
|
+
* The chip label for a source ref. Exported so consumers can render the same
|
|
1359
|
+
* label elsewhere (a footnote list, a tooltip) without re-deriving the rules.
|
|
1360
|
+
*/
|
|
1361
|
+
declare const inlineCitationSourceLabel: (source: InlineCitationSourceRef) => string;
|
|
1362
|
+
type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
|
|
1363
|
+
sources: InlineCitationSourceRef[];
|
|
1364
|
+
};
|
|
1365
|
+
declare const InlineCitationCardTrigger: ({ sources, className, ...props }: InlineCitationCardTriggerProps) => react.JSX.Element;
|
|
1366
|
+
type EvidenceChipProps = InlineCitationCardTriggerProps;
|
|
1367
|
+
/**
|
|
1368
|
+
* EvidenceChip — the named front door for the inline evidence interaction
|
|
1369
|
+
* (research 11 §B.4): the re-skinned `InlineCitationCardTrigger` (green
|
|
1370
|
+
* "grounded" wash). Use inside an `InlineCitationCard` (HoverCard) — it reuses
|
|
1371
|
+
* the citation carousel wholesale; it is not a new primitive.
|
|
1372
|
+
*/
|
|
1373
|
+
declare const EvidenceChip: ({ sources, className, ...props }: InlineCitationCardTriggerProps) => react.JSX.Element;
|
|
1374
|
+
type InlineCitationCardBodyProps = ComponentProps<"div">;
|
|
1375
|
+
declare const InlineCitationCardBody: ({ className, ...props }: InlineCitationCardBodyProps) => react.JSX.Element;
|
|
1376
|
+
type InlineCitationCarouselProps = ComponentProps<typeof Carousel>;
|
|
1377
|
+
declare const InlineCitationCarousel: ({ className, children, ...props }: InlineCitationCarouselProps) => react.JSX.Element;
|
|
1378
|
+
type InlineCitationCarouselContentProps = ComponentProps<"div">;
|
|
1379
|
+
declare const InlineCitationCarouselContent: (props: InlineCitationCarouselContentProps) => react.JSX.Element;
|
|
1380
|
+
type InlineCitationCarouselItemProps = ComponentProps<"div">;
|
|
1381
|
+
declare const InlineCitationCarouselItem: ({ className, ...props }: InlineCitationCarouselItemProps) => react.JSX.Element;
|
|
1382
|
+
type InlineCitationCarouselHeaderProps = ComponentProps<"div">;
|
|
1383
|
+
declare const InlineCitationCarouselHeader: ({ className, ...props }: InlineCitationCarouselHeaderProps) => react.JSX.Element;
|
|
1384
|
+
type InlineCitationCarouselIndexProps = ComponentProps<"div">;
|
|
1385
|
+
declare const InlineCitationCarouselIndex: ({ children, className, ...props }: InlineCitationCarouselIndexProps) => react.JSX.Element;
|
|
1386
|
+
type InlineCitationCarouselPrevProps = ComponentProps<"button">;
|
|
1387
|
+
declare const InlineCitationCarouselPrev: ({ className, ...props }: InlineCitationCarouselPrevProps) => react.JSX.Element;
|
|
1388
|
+
type InlineCitationCarouselNextProps = ComponentProps<"button">;
|
|
1389
|
+
declare const InlineCitationCarouselNext: ({ className, ...props }: InlineCitationCarouselNextProps) => react.JSX.Element;
|
|
1390
|
+
type InlineCitationSourceProps = ComponentProps<"div"> & {
|
|
1391
|
+
title?: string;
|
|
1392
|
+
url?: string;
|
|
1393
|
+
description?: string;
|
|
1394
|
+
};
|
|
1395
|
+
declare const InlineCitationSource: ({ title, url, description, className, children, ...props }: InlineCitationSourceProps) => react.JSX.Element;
|
|
1396
|
+
type InlineCitationQuoteProps = ComponentProps<"blockquote">;
|
|
1397
|
+
declare const InlineCitationQuote: ({ children, className, ...props }: InlineCitationQuoteProps) => react.JSX.Element;
|
|
1398
|
+
|
|
1399
|
+
interface InteractiveTerminalHandle {
|
|
1400
|
+
/** Process → screen. ANSI passthrough (colors, cursor movement, clears, …). */
|
|
1401
|
+
write(data: string): void;
|
|
1402
|
+
/** Clears the viewport + scrollback. */
|
|
1403
|
+
clear(): void;
|
|
1404
|
+
/** Re-fits cols/rows to the current container size. */
|
|
1405
|
+
fit(): void;
|
|
1406
|
+
/** Focuses the terminal's input surface. */
|
|
1407
|
+
focus(): void;
|
|
1408
|
+
}
|
|
1409
|
+
interface InteractiveTerminalProps extends Omit<HTMLAttributes<HTMLDivElement>, "onResize"> {
|
|
1410
|
+
/** Keystrokes + paste → process. The PTY/process stays consumer-owned. */
|
|
1411
|
+
onData?: (data: string) => void;
|
|
1412
|
+
/** Fires whenever the container resizes and cols/rows are refit. */
|
|
1413
|
+
onResize?: (size: {
|
|
1414
|
+
cols: number;
|
|
1415
|
+
rows: number;
|
|
1416
|
+
}) => void;
|
|
1417
|
+
/** Degrades to a read-only log: writes still render, stdin is disabled. */
|
|
1418
|
+
readOnly?: boolean;
|
|
1419
|
+
/** Terminal font size in px. Defaults to `13` (matches `CodeEditor`). */
|
|
1420
|
+
fontSize?: number;
|
|
1421
|
+
/** Accessible name for the terminal's real focusable surface. Required. */
|
|
1422
|
+
"aria-label": string;
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Builds xterm's `ITheme` from the active theme's semantic tokens, resolved
|
|
1426
|
+
* off `rootEl` (defaults to `<html>`, where `data-theme` lives).
|
|
1427
|
+
*
|
|
1428
|
+
* ANSI mapping (documented so the intent is auditable, not guessed at):
|
|
1429
|
+
* - background/foreground → `--card`/`--foreground` (the terminal reads as a
|
|
1430
|
+
* raised panel, matching the existing `Terminal` log's bordered-box look).
|
|
1431
|
+
* - cursor → `--primary`; cursorAccent → the background, so glyphs stay
|
|
1432
|
+
* legible under a solid block cursor.
|
|
1433
|
+
* - selectionBackground → a low-alpha `--primary` wash.
|
|
1434
|
+
* - red/green/yellow/blue → the AA-tuned `-text` variants (`--destructive-text`,
|
|
1435
|
+
* `--success-text`, `--warning-text`, `--info-text`) — these are the ones
|
|
1436
|
+
* tuned to read as TEXT on a surface, which is exactly what ANSI color codes
|
|
1437
|
+
* paint. `bright*` variants use the more saturated fill tokens
|
|
1438
|
+
* (`--destructive`, `--success`, `--warning`, `--info`).
|
|
1439
|
+
* - magenta/cyan → `--chart-4`/`--chart-2` (no dedicated fill/text pair, so the
|
|
1440
|
+
* `bright*` siblings are the same hue pushed AWAY from the background).
|
|
1441
|
+
* - black/white are `background`/`foreground` RUNGS, not the tokens
|
|
1442
|
+
* themselves: `black` = the terminal's own background (the common "ANSI
|
|
1443
|
+
* black" convention — invisible ink), `brightBlack` = `--border-strong`
|
|
1444
|
+
* (a dim ink for comments/hashes), `white` = `--muted-foreground` (a dimmer
|
|
1445
|
+
* ink), `brightWhite` = `--foreground` (full ink).
|
|
1446
|
+
*
|
|
1447
|
+
* EVERY slot above except `black` then passes through `readableInk()` — the AA
|
|
1448
|
+
* floor (#386). The mapping picks the token that carries the right MEANING; the
|
|
1449
|
+
* floor guarantees the resulting ink is legible on this terminal's actual
|
|
1450
|
+
* background. Several of these tokens are mark/fill rungs (≥3:1 only), so
|
|
1451
|
+
* without the floor EVERY palette this repo ships had sub-AA ANSI slots —
|
|
1452
|
+
* measured from `themes.css`: `:root` 7 (worst 2.39:1), `light` 4 (worst
|
|
1453
|
+
* 2.91:1), `dark` 1 (3.16:1). Re-derived on every
|
|
1454
|
+
* run by `interactive-terminal.test.tsx`, which parses those palettes out of
|
|
1455
|
+
* `themes.css` rather than hard-coding them. Keep new slots inside `ink(...)`;
|
|
1456
|
+
* a raw token assigned straight to an ANSI slot is the bug.
|
|
1457
|
+
*/
|
|
1458
|
+
declare function buildInteractiveTerminalTheme(rootEl?: Element | null): ITheme;
|
|
1459
|
+
/**
|
|
1460
|
+
* A token-themed, PTY-ready terminal emulator wrapped as a brand-ui component.
|
|
1461
|
+
* Wraps xterm.js + `FitAddon`; the process itself is consumer-owned — this
|
|
1462
|
+
* component only renders ANSI output and emits `onData`/`onResize`.
|
|
1463
|
+
*
|
|
1464
|
+
* Keyboard: the terminal's real focusable surface is xterm's own input
|
|
1465
|
+
* textarea (reachable by Tab like any control). Tab/Shift-Tab and Escape are
|
|
1466
|
+
* explicitly let through (`attachCustomKeyEventHandler`) so focus can always
|
|
1467
|
+
* leave the terminal — there is no keyboard trap.
|
|
1468
|
+
*/
|
|
1469
|
+
declare const InteractiveTerminal: react.ForwardRefExoticComponent<InteractiveTerminalProps & react.RefAttributes<InteractiveTerminalHandle>>;
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* The readiness of the preview, derived from the input (see loading-states.md):
|
|
1473
|
+
* - `idle` — nothing requested yet (empty input, never rendered). Renders nothing.
|
|
1474
|
+
* - `pending` — not-ready: `loading`, `isStreaming`, OR syntactically incomplete
|
|
1475
|
+
* input (a half-arrived tag). Builds up best-effort; the error slot
|
|
1476
|
+
* is suppressed; the skeleton shows until the first successful paint.
|
|
1477
|
+
* - `ready` — settled, parseable input is rendering.
|
|
1478
|
+
* - `error` — settled AND genuinely invalid input (the only state that surfaces
|
|
1479
|
+
* `JSXPreviewError`).
|
|
1480
|
+
*/
|
|
1481
|
+
type JSXPreviewStatus = "idle" | "pending" | "ready" | "error";
|
|
1482
|
+
interface JSXPreviewContextValue {
|
|
1483
|
+
jsx: string;
|
|
1484
|
+
processedJsx: string;
|
|
1485
|
+
isStreaming: boolean;
|
|
1486
|
+
loading: boolean;
|
|
1487
|
+
status: JSXPreviewStatus;
|
|
1488
|
+
hasRendered: boolean;
|
|
1489
|
+
error: Error | null;
|
|
1490
|
+
setError: (error: Error | null) => void;
|
|
1491
|
+
setHasRendered: (value: boolean) => void;
|
|
1492
|
+
components: TProps["components"];
|
|
1493
|
+
bindings: TProps["bindings"];
|
|
1494
|
+
onErrorProp?: (error: Error) => void;
|
|
1495
|
+
}
|
|
1496
|
+
declare const useJSXPreview: () => JSXPreviewContextValue;
|
|
1497
|
+
type JSXPreviewProps = ComponentProps<"div"> & {
|
|
1498
|
+
jsx: string;
|
|
1499
|
+
/** Content is arriving incrementally — build up, suppress transient errors. */
|
|
1500
|
+
isStreaming?: boolean;
|
|
1501
|
+
/**
|
|
1502
|
+
* No renderable content yet (fetch-then-show). Forces the `pending` state so
|
|
1503
|
+
* `JSXPreviewSkeleton` shows until `jsx` arrives. Orthogonal to `isStreaming`.
|
|
1504
|
+
*/
|
|
1505
|
+
loading?: boolean;
|
|
1506
|
+
components?: TProps["components"];
|
|
1507
|
+
bindings?: TProps["bindings"];
|
|
1508
|
+
onError?: (error: Error) => void;
|
|
1509
|
+
};
|
|
1510
|
+
declare const JSXPreview: react.MemoExoticComponent<({ jsx, isStreaming, loading, components, bindings, onError, className, children, ...props }: JSXPreviewProps) => react.JSX.Element>;
|
|
1511
|
+
type JSXPreviewContentProps = Omit<ComponentProps<"div">, "children">;
|
|
1512
|
+
declare const JSXPreviewContent: react.MemoExoticComponent<({ className, ...props }: JSXPreviewContentProps) => react.JSX.Element | null>;
|
|
1513
|
+
type JSXPreviewSkeletonProps = ComponentProps<"div">;
|
|
1514
|
+
/**
|
|
1515
|
+
* The not-ready placeholder (loading-states.md §slot anatomy). Renders a
|
|
1516
|
+
* layout-shaped `Skeleton` while the preview is `pending` and nothing has
|
|
1517
|
+
* painted yet — so a streaming/incomplete surface BUILDS UP behind a skeleton
|
|
1518
|
+
* instead of flashing the error box. Pass `children` to override the shape.
|
|
1519
|
+
*/
|
|
1520
|
+
declare const JSXPreviewSkeleton: react.MemoExoticComponent<({ className, children, ...props }: JSXPreviewSkeletonProps) => react.JSX.Element>;
|
|
1521
|
+
type JSXPreviewErrorProps = ComponentProps<"div"> & {
|
|
1522
|
+
children?: ReactNode | ((error: Error) => ReactNode);
|
|
1523
|
+
};
|
|
1524
|
+
declare const JSXPreviewError: react.MemoExoticComponent<({ className, children, ...props }: JSXPreviewErrorProps) => react.JSX.Element | null>;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* A drop-in replacement for `@streamdown/mermaid`'s `mermaid` plugin that loads
|
|
1528
|
+
* the Mermaid engine **on first diagram render** instead of at import time.
|
|
1529
|
+
*
|
|
1530
|
+
* Why this exists
|
|
1531
|
+
* ---------------
|
|
1532
|
+
* `@streamdown/mermaid`'s dist opens with a static `import n from "mermaid"`, and
|
|
1533
|
+
* neither it nor `mermaid`/`dompurify`/`d3` declares `sideEffects`, so a bundler
|
|
1534
|
+
* must keep the whole edge. `@elabs-ai/components-ai` imported that plugin from three modules
|
|
1535
|
+
* (`message`, `reasoning`, `markdown-view`), which put Mermaid + d3 + DOMPurify —
|
|
1536
|
+
* several MB — in the **entry chunk** of every consumer, including the vast
|
|
1537
|
+
* majority that never render a diagram.
|
|
1538
|
+
*
|
|
1539
|
+
* How it avoids a render flash
|
|
1540
|
+
* ----------------------------
|
|
1541
|
+
* `DiagramPlugin` is not the engine; it is a lazy accessor. Streamdown calls
|
|
1542
|
+
* `getMermaid()` only from inside its async diagram-render path (immediately
|
|
1543
|
+
* before `await instance.render(...)`), never at module or component init. So the
|
|
1544
|
+
* plugin object can be present from the very first frame — Streamdown always
|
|
1545
|
+
* treats a ```mermaid fence as a diagram — while the engine itself arrives with a
|
|
1546
|
+
* dynamic import inside `render()`. No content-sniffing, no plugin swap, no
|
|
1547
|
+
* suspense seam at the call sites, and no "raw source flashes then becomes a
|
|
1548
|
+
* diagram" transition.
|
|
1549
|
+
*
|
|
1550
|
+
* The upstream plugin is ~10 lines; its defaults and initialize-once semantics
|
|
1551
|
+
* are mirrored exactly below. The `DiagramPlugin` type is still imported (as a
|
|
1552
|
+
* type, so it erases) from `@streamdown/mermaid`, which keeps this honest against
|
|
1553
|
+
* the real contract at typecheck time.
|
|
1554
|
+
*/
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* Start fetching the Mermaid engine ahead of time.
|
|
1558
|
+
*
|
|
1559
|
+
* Optional. Call it when you already know the surface will render diagrams (on
|
|
1560
|
+
* route entry, or when a conversation is known to contain them) so the first
|
|
1561
|
+
* diagram doesn't pay the import latency. Safe to call repeatedly; safe to
|
|
1562
|
+
* ignore — rendering a diagram loads the engine either way.
|
|
1563
|
+
*/
|
|
1564
|
+
declare const preloadMermaid: () => void;
|
|
1565
|
+
/**
|
|
1566
|
+
* Create a lazy Mermaid diagram plugin for Streamdown.
|
|
1567
|
+
*
|
|
1568
|
+
* @param options.config Mermaid config merged over the brand defaults.
|
|
1569
|
+
*/
|
|
1570
|
+
declare const createLazyMermaidPlugin: (options?: {
|
|
1571
|
+
config?: MermaidConfig;
|
|
1572
|
+
}) => DiagramPlugin;
|
|
1573
|
+
/**
|
|
1574
|
+
* The shared lazy Mermaid plugin — the `@elabs-ai/components-ai` replacement for
|
|
1575
|
+
* `@streamdown/mermaid`'s eager `mermaid` export. One instance for the whole
|
|
1576
|
+
* app, so the engine and its initialize-once state are shared.
|
|
1577
|
+
*/
|
|
1578
|
+
declare const lazyMermaid: DiagramPlugin;
|
|
1579
|
+
|
|
1580
|
+
interface MarkdownViewProps extends Omit<ComponentProps<typeof Streamdown>, "components" | "plugins"> {
|
|
1581
|
+
/**
|
|
1582
|
+
* The prose level a markdown `#` maps to; deeper headings shift with it
|
|
1583
|
+
* (capped at 6). Default `1` (the full reading scale). Pass `2` in narrow
|
|
1584
|
+
* embeds (a context rail) so headings stay on the constrained rung.
|
|
1585
|
+
*/
|
|
1586
|
+
baseHeadingLevel?: ProseHeadingLevel;
|
|
1587
|
+
}
|
|
1588
|
+
declare const MarkdownView: ({ baseHeadingLevel, className, children, ...props }: MarkdownViewProps) => react.JSX.Element;
|
|
1589
|
+
|
|
1590
|
+
type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
1591
|
+
from: UIMessage["role"];
|
|
1592
|
+
};
|
|
1593
|
+
declare const Message: ({ className, from, ...props }: MessageProps) => react.JSX.Element;
|
|
1594
|
+
type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
1595
|
+
declare const MessageContent: ({ children, className, ...props }: MessageContentProps) => react.JSX.Element;
|
|
1596
|
+
type MessageHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1597
|
+
/**
|
|
1598
|
+
* Optional identity row above the bubble — avatar + name + timestamp
|
|
1599
|
+
* (research 11 §B.1 MSG-2). A slot, not baked structure.
|
|
1600
|
+
*/
|
|
1601
|
+
declare const MessageHeader: ({ className, ...props }: MessageHeaderProps) => react.JSX.Element;
|
|
1602
|
+
type MessageAvatarProps = ComponentProps<typeof Avatar> & {
|
|
1603
|
+
/** Image source for the participant. */
|
|
1604
|
+
src?: string;
|
|
1605
|
+
/** Participant name — drives the image alt + the fallback initial, and the accessible label. */
|
|
1606
|
+
name?: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* Visual identity role.
|
|
1609
|
+
* - `"user"` (default): shows the initial letter as a fallback.
|
|
1610
|
+
* - `"agent"`: shows a branded Bot icon on a primary (green) ground instead
|
|
1611
|
+
* of a text initial, matching the agent identity convention.
|
|
1612
|
+
*/
|
|
1613
|
+
role?: "user" | "agent";
|
|
1614
|
+
};
|
|
1615
|
+
/**
|
|
1616
|
+
* Thin preset over the `@elabs-ai/components-ui` Avatar sized for inline chat (NOT a new
|
|
1617
|
+
* avatar primitive — research 11 §B.1 MSG-2).
|
|
1618
|
+
*
|
|
1619
|
+
* When `role="agent"`, renders a filled primary-green circle with a centered
|
|
1620
|
+
* Bot icon (lucide-react `BotIcon`) and an accessible label derived from
|
|
1621
|
+
* `name`. The primary/primary-foreground token pair is the agent identity
|
|
1622
|
+
* colour across both themes (green on light/dark; theme-adapted
|
|
1623
|
+
* on others).
|
|
1624
|
+
*/
|
|
1625
|
+
declare const MessageAvatar: ({ src, name, role, className, children, ...props }: MessageAvatarProps) => react.JSX.Element;
|
|
1626
|
+
type UserMessageProps = Omit<MessageProps, "from">;
|
|
1627
|
+
/**
|
|
1628
|
+
* Named front door for a user turn (research 11 §B.2) — a thin preset over
|
|
1629
|
+
* `Message from="user"`; the chat-user fill comes from `MessageContent`.
|
|
1630
|
+
*/
|
|
1631
|
+
declare const UserMessage: (props: UserMessageProps) => react.JSX.Element;
|
|
1632
|
+
declare const agentMessageVariants: (props?: ({
|
|
1633
|
+
emphasis?: "default" | "answer" | null | undefined;
|
|
1634
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1635
|
+
type AgentMessageEmphasis = NonNullable<VariantProps<typeof agentMessageVariants>["emphasis"]>;
|
|
1636
|
+
type AgentMessageProps = Omit<MessageProps, "from"> & VariantProps<typeof agentMessageVariants>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Named front door for an assistant turn (research 11 §B.2). KPI band / prose /
|
|
1639
|
+
* footer are COMPOSED children (`MetricGrid` + `MessageResponse` +
|
|
1640
|
+
* `SourceList`), not baked-in layout.
|
|
1641
|
+
*/
|
|
1642
|
+
declare const AgentMessage: ({ className, emphasis, ...props }: AgentMessageProps) => react.JSX.Element;
|
|
1643
|
+
declare const messageActionsVariants: (props?: ({
|
|
1644
|
+
appearance?: "bar" | "plain" | null | undefined;
|
|
1645
|
+
reveal?: "always" | "hover" | null | undefined;
|
|
1646
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1647
|
+
type MessageActionsProps = ComponentProps<"div"> & VariantProps<typeof messageActionsVariants> & {
|
|
1648
|
+
/**
|
|
1649
|
+
* Accessible name for the group. Defaults to the `ai.message.actions`
|
|
1650
|
+
* microcopy key. Naming matters more here than on an always-visible row:
|
|
1651
|
+
* assistive tech reaches these controls whether or not a pointer ever
|
|
1652
|
+
* revealed them, so the group has to say what they act on.
|
|
1653
|
+
*/
|
|
1654
|
+
label?: string;
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* A row of per-message controls (copy, pin, retry, a `⋯` menu, …).
|
|
1658
|
+
*
|
|
1659
|
+
* **Presentational only** — it lays the controls out and decides when they are
|
|
1660
|
+
* visible; it ships no clipboard call, no pin state and no persistence. Every
|
|
1661
|
+
* `MessageAction` inside it is a bare `Button`: give it an `onClick`, and for a
|
|
1662
|
+
* toggle (pin, bookmark) an `aria-pressed` the host owns. That is the D5
|
|
1663
|
+
* boundary (`docs/DECISIONS.md` §D5) — brand-ui renders, the app acts.
|
|
1664
|
+
*
|
|
1665
|
+
* `reveal="hover"` reads the parent `Message`'s `group` class, so the row must
|
|
1666
|
+
* be rendered INSIDE a `Message` for pointer-reveal to fire. Standing alone it
|
|
1667
|
+
* still reveals on its own hover and on focus-within, but not from the bubble.
|
|
1668
|
+
*/
|
|
1669
|
+
declare const MessageActions: ({ appearance, className, children, label, reveal, ...props }: MessageActionsProps) => react.JSX.Element;
|
|
1670
|
+
type MessageActionProps = ComponentProps<typeof Button> & {
|
|
1671
|
+
tooltip?: string;
|
|
1672
|
+
label?: string;
|
|
1673
|
+
};
|
|
1674
|
+
declare const MessageAction: ({ tooltip, children, label, variant, size, ...props }: MessageActionProps) => react.JSX.Element;
|
|
1675
|
+
type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
|
|
1676
|
+
/**
|
|
1677
|
+
* Controlled current branch index. When set, `MessageBranch` no longer
|
|
1678
|
+
* tracks its own state — the host owns it and must update `branch` from
|
|
1679
|
+
* `onBranchChange` (or elsewhere) to move the selection. Omit for the
|
|
1680
|
+
* uncontrolled default (see `defaultBranch`).
|
|
1681
|
+
*/
|
|
1682
|
+
branch?: number;
|
|
1683
|
+
defaultBranch?: number;
|
|
1684
|
+
onBranchChange?: (branchIndex: number) => void;
|
|
1685
|
+
};
|
|
1686
|
+
declare const MessageBranch: ({ branch: branchProp, defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) => react.JSX.Element;
|
|
1687
|
+
type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
|
|
1688
|
+
declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) => react.JSX.Element[];
|
|
1689
|
+
type MessageBranchSelectorProps = ComponentProps<typeof ButtonGroup>;
|
|
1690
|
+
declare const MessageBranchSelector: ({ className, ...props }: MessageBranchSelectorProps) => react.JSX.Element | null;
|
|
1691
|
+
type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
1692
|
+
declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) => react.JSX.Element;
|
|
1693
|
+
type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
1694
|
+
declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) => react.JSX.Element;
|
|
1695
|
+
type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
1696
|
+
declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => react.JSX.Element;
|
|
1697
|
+
type MessageResponseProps = ComponentProps<typeof Streamdown> & {
|
|
1698
|
+
/**
|
|
1699
|
+
* No content has arrived yet (loading-states.md `loading`) — renders
|
|
1700
|
+
* skeleton lines at the body line-height instead of `<Streamdown>`, so the
|
|
1701
|
+
* bubble reserves its space before the first token.
|
|
1702
|
+
* @default false
|
|
1703
|
+
*/
|
|
1704
|
+
loading?: boolean;
|
|
1705
|
+
};
|
|
1706
|
+
declare const MessageResponse: react.MemoExoticComponent<({ className, loading, ...props }: MessageResponseProps) => react.JSX.Element>;
|
|
1707
|
+
type MessageToolbarProps = ComponentProps<"div">;
|
|
1708
|
+
declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) => react.JSX.Element;
|
|
1709
|
+
|
|
1710
|
+
interface MessageEditContextValue {
|
|
1711
|
+
editing: boolean;
|
|
1712
|
+
draft: string;
|
|
1713
|
+
setDraft: (value: string) => void;
|
|
1714
|
+
beginEdit: () => void;
|
|
1715
|
+
cancel: () => void;
|
|
1716
|
+
submit: () => void;
|
|
1717
|
+
/** Ref for the trigger element so focus can be restored to it on exit. */
|
|
1718
|
+
triggerRef: React.MutableRefObject<HTMLElement | null>;
|
|
1719
|
+
editorId: string;
|
|
1720
|
+
}
|
|
1721
|
+
/** Read-only access to the edit state (for a custom trigger/toolbar). */
|
|
1722
|
+
declare function useMessageEdit(): Pick<MessageEditContextValue, "editing" | "draft" | "beginEdit" | "cancel" | "submit">;
|
|
1723
|
+
interface MessageEditProviderProps {
|
|
1724
|
+
/** The editable source text (seeds the editor on begin). */
|
|
1725
|
+
value: string;
|
|
1726
|
+
/** Called with the new text on save. The consumer creates the branch. */
|
|
1727
|
+
onEditSubmit?: (newText: string) => void;
|
|
1728
|
+
/** Controlled editing state. When set, `onEditingChange` drives transitions. */
|
|
1729
|
+
editing?: boolean;
|
|
1730
|
+
/** Uncontrolled initial editing state. @default false */
|
|
1731
|
+
defaultEditing?: boolean;
|
|
1732
|
+
/** Called when editing begins/ends. */
|
|
1733
|
+
onEditingChange?: (editing: boolean) => void;
|
|
1734
|
+
children: ReactNode;
|
|
1735
|
+
}
|
|
1736
|
+
/** Lifts the edit state (editing + draft). Controlled or uncontrolled. */
|
|
1737
|
+
declare function MessageEditProvider({ value, onEditSubmit, editing: editingProp, defaultEditing, onEditingChange, children, }: MessageEditProviderProps): react.JSX.Element;
|
|
1738
|
+
type MessageEditFormProps = Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> & {
|
|
1739
|
+
/** Save button label. @default "Save" */
|
|
1740
|
+
saveLabel?: string;
|
|
1741
|
+
/** Cancel button label. @default "Cancel" */
|
|
1742
|
+
cancelLabel?: string;
|
|
1743
|
+
};
|
|
1744
|
+
/** The inline editor: an autofocused textarea + Save/Cancel, Enter/Esc wired. */
|
|
1745
|
+
declare const MessageEditForm: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> & {
|
|
1746
|
+
/** Save button label. @default "Save" */
|
|
1747
|
+
saveLabel?: string;
|
|
1748
|
+
/** Cancel button label. @default "Cancel" */
|
|
1749
|
+
cancelLabel?: string;
|
|
1750
|
+
} & react.RefAttributes<HTMLFormElement>>;
|
|
1751
|
+
type MessageEditContentProps = HTMLAttributes<HTMLDivElement>;
|
|
1752
|
+
/** Renders `children` in display mode, or the inline editor while editing. */
|
|
1753
|
+
declare const MessageEditContent: react.ForwardRefExoticComponent<MessageEditContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1754
|
+
type MessageEditTriggerProps = React.ComponentProps<typeof Button>;
|
|
1755
|
+
/** Begins editing. Focus is restored here on cancel/submit. Hidden while editing. */
|
|
1756
|
+
declare const MessageEditTrigger: react.ForwardRefExoticComponent<Omit<_elabs_ai_components_ui.ButtonProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1757
|
+
interface MessageEditProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit" | "children"> {
|
|
1758
|
+
/** The editable source text. */
|
|
1759
|
+
value: string;
|
|
1760
|
+
/** Called with the new text on save (consumer creates the branch). */
|
|
1761
|
+
onEditSubmit?: (newText: string) => void;
|
|
1762
|
+
/** Controlled editing state. */
|
|
1763
|
+
editing?: boolean;
|
|
1764
|
+
/** Uncontrolled initial editing state. */
|
|
1765
|
+
defaultEditing?: boolean;
|
|
1766
|
+
/** Called when editing begins/ends. */
|
|
1767
|
+
onEditingChange?: (editing: boolean) => void;
|
|
1768
|
+
/** The display content (usually the rendered message text). */
|
|
1769
|
+
children: ReactNode;
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Convenience composition: display `children` + an "Edit" trigger, swapping to
|
|
1773
|
+
* the inline editor while editing. For toolbar-placed triggers, compose the
|
|
1774
|
+
* parts (`MessageEditProvider` + `MessageEditTrigger` in your toolbar).
|
|
1775
|
+
*/
|
|
1776
|
+
declare const MessageEdit: react.ForwardRefExoticComponent<MessageEditProps & react.RefAttributes<HTMLDivElement>>;
|
|
1777
|
+
|
|
1778
|
+
type FeedbackType = "positive" | "negative";
|
|
1779
|
+
declare const messageFeedbackVariants: (props?: ({
|
|
1780
|
+
compact?: boolean | null | undefined;
|
|
1781
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1782
|
+
interface MessageFeedbackProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit" | "defaultValue">, VariantProps<typeof messageFeedbackVariants> {
|
|
1783
|
+
/** Controlled selected feedback. When set, `onSubmit` is the only updater. */
|
|
1784
|
+
value?: FeedbackType | null;
|
|
1785
|
+
/** Uncontrolled initial selection. @default null */
|
|
1786
|
+
defaultValue?: FeedbackType | null;
|
|
1787
|
+
/** Called once with the chosen feedback. No persistence — host-owned. */
|
|
1788
|
+
onSubmit?: (feedback: {
|
|
1789
|
+
type: FeedbackType;
|
|
1790
|
+
}) => void;
|
|
1791
|
+
/** Force-disable both controls (e.g. while the message is still streaming). */
|
|
1792
|
+
disabled?: boolean;
|
|
1793
|
+
/** aria-label for the positive control. @default "Good response" */
|
|
1794
|
+
positiveLabel?: string;
|
|
1795
|
+
/** aria-label for the negative control. @default "Bad response" */
|
|
1796
|
+
negativeLabel?: string;
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Two icon buttons. The chosen one stays prominent after submit; the other
|
|
1800
|
+
* recedes. `compact` tightens spacing/size for message toolbars.
|
|
1801
|
+
*/
|
|
1802
|
+
declare const MessageFeedback: react.ForwardRefExoticComponent<MessageFeedbackProps & react.RefAttributes<HTMLDivElement>>;
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* message-form-spec.ts — Serializable FormSpec for MessageForm.
|
|
1806
|
+
*
|
|
1807
|
+
* These are pure data types + zod schemas with no React dependency. The shape is
|
|
1808
|
+
* what an LLM tool-call emits when it wants the user to fill in a form inside a
|
|
1809
|
+
* chat message. It is deliberately compatible with MCP elicitation's
|
|
1810
|
+
* `requestedSchema` (spec 2025-11-25): flat primitive fields (string / number /
|
|
1811
|
+
* integer / boolean / single- and multi-select enum), each with a label,
|
|
1812
|
+
* optional description, `required`, and a `default`.
|
|
1813
|
+
*
|
|
1814
|
+
* The exported zod schemas are the source of truth downstream catalogs compile
|
|
1815
|
+
* prompts + validators from. Field types are intentionally limited to the safe
|
|
1816
|
+
* set — there is NO file input and NO password/credential type/format, so a spec
|
|
1817
|
+
* that asks for one fails validation (rejected, never rendered).
|
|
1818
|
+
*/
|
|
1819
|
+
|
|
1820
|
+
/** A single enum choice: a plain value, or a `{ const, title }` pair. */
|
|
1821
|
+
declare const enumOptionSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1822
|
+
const: z.ZodString;
|
|
1823
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1824
|
+
}, "strip", z.ZodTypeAny, {
|
|
1825
|
+
const: string;
|
|
1826
|
+
title?: string | undefined;
|
|
1827
|
+
}, {
|
|
1828
|
+
const: string;
|
|
1829
|
+
title?: string | undefined;
|
|
1830
|
+
}>]>;
|
|
1831
|
+
type EnumOption = z.infer<typeof enumOptionSchema>;
|
|
1832
|
+
/** The submitted value of an enum option. */
|
|
1833
|
+
declare function optionValue(option: EnumOption): string;
|
|
1834
|
+
/** The display label of an enum option (falls back to its value). */
|
|
1835
|
+
declare function optionLabel(option: EnumOption): string;
|
|
1836
|
+
/**
|
|
1837
|
+
* A single-line or multi-line text field.
|
|
1838
|
+
* `format` narrows the input type + validation. Note there is NO `"password"`
|
|
1839
|
+
* format — credential capture is deliberately unsupported.
|
|
1840
|
+
*/
|
|
1841
|
+
declare const stringFieldSchema: z.ZodObject<{
|
|
1842
|
+
default: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
format: z.ZodOptional<z.ZodEnum<["email", "uri", "date", "date-time"]>>;
|
|
1844
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
1845
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
1846
|
+
/** A serialized RegExp source string (client-enforced when present). */
|
|
1847
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
1848
|
+
/** Render a textarea instead of a single-line input. */
|
|
1849
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
1850
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
1851
|
+
name: z.ZodString;
|
|
1852
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
1853
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1854
|
+
/** Helper text shown under the control. */
|
|
1855
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1856
|
+
/** Whether a value is required before the form can submit. */
|
|
1857
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1858
|
+
type: z.ZodLiteral<"string">;
|
|
1859
|
+
}, "strip", z.ZodTypeAny, {
|
|
1860
|
+
name: string;
|
|
1861
|
+
type: "string";
|
|
1862
|
+
label?: string | undefined;
|
|
1863
|
+
default?: string | undefined;
|
|
1864
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
1865
|
+
pattern?: string | undefined;
|
|
1866
|
+
maxLength?: number | undefined;
|
|
1867
|
+
minLength?: number | undefined;
|
|
1868
|
+
required?: boolean | undefined;
|
|
1869
|
+
description?: string | undefined;
|
|
1870
|
+
multiline?: boolean | undefined;
|
|
1871
|
+
}, {
|
|
1872
|
+
name: string;
|
|
1873
|
+
type: "string";
|
|
1874
|
+
label?: string | undefined;
|
|
1875
|
+
default?: string | undefined;
|
|
1876
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
1877
|
+
pattern?: string | undefined;
|
|
1878
|
+
maxLength?: number | undefined;
|
|
1879
|
+
minLength?: number | undefined;
|
|
1880
|
+
required?: boolean | undefined;
|
|
1881
|
+
description?: string | undefined;
|
|
1882
|
+
multiline?: boolean | undefined;
|
|
1883
|
+
}>;
|
|
1884
|
+
type StringFieldSpec = z.infer<typeof stringFieldSchema>;
|
|
1885
|
+
/** A floating-point number field. */
|
|
1886
|
+
declare const numberFieldSchema: z.ZodObject<{
|
|
1887
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
1888
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
1889
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1890
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
1891
|
+
name: z.ZodString;
|
|
1892
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
1893
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1894
|
+
/** Helper text shown under the control. */
|
|
1895
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1896
|
+
/** Whether a value is required before the form can submit. */
|
|
1897
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1898
|
+
type: z.ZodLiteral<"number">;
|
|
1899
|
+
}, "strip", z.ZodTypeAny, {
|
|
1900
|
+
name: string;
|
|
1901
|
+
type: "number";
|
|
1902
|
+
label?: string | undefined;
|
|
1903
|
+
default?: number | undefined;
|
|
1904
|
+
max?: number | undefined;
|
|
1905
|
+
min?: number | undefined;
|
|
1906
|
+
required?: boolean | undefined;
|
|
1907
|
+
description?: string | undefined;
|
|
1908
|
+
}, {
|
|
1909
|
+
name: string;
|
|
1910
|
+
type: "number";
|
|
1911
|
+
label?: string | undefined;
|
|
1912
|
+
default?: number | undefined;
|
|
1913
|
+
max?: number | undefined;
|
|
1914
|
+
min?: number | undefined;
|
|
1915
|
+
required?: boolean | undefined;
|
|
1916
|
+
description?: string | undefined;
|
|
1917
|
+
}>;
|
|
1918
|
+
type NumberFieldSpec = z.infer<typeof numberFieldSchema>;
|
|
1919
|
+
/** A whole-number field. */
|
|
1920
|
+
declare const integerFieldSchema: z.ZodObject<{
|
|
1921
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
1922
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
1923
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
1924
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
1925
|
+
name: z.ZodString;
|
|
1926
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
1927
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1928
|
+
/** Helper text shown under the control. */
|
|
1929
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1930
|
+
/** Whether a value is required before the form can submit. */
|
|
1931
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1932
|
+
type: z.ZodLiteral<"integer">;
|
|
1933
|
+
}, "strip", z.ZodTypeAny, {
|
|
1934
|
+
name: string;
|
|
1935
|
+
type: "integer";
|
|
1936
|
+
label?: string | undefined;
|
|
1937
|
+
default?: number | undefined;
|
|
1938
|
+
max?: number | undefined;
|
|
1939
|
+
min?: number | undefined;
|
|
1940
|
+
required?: boolean | undefined;
|
|
1941
|
+
description?: string | undefined;
|
|
1942
|
+
}, {
|
|
1943
|
+
name: string;
|
|
1944
|
+
type: "integer";
|
|
1945
|
+
label?: string | undefined;
|
|
1946
|
+
default?: number | undefined;
|
|
1947
|
+
max?: number | undefined;
|
|
1948
|
+
min?: number | undefined;
|
|
1949
|
+
required?: boolean | undefined;
|
|
1950
|
+
description?: string | undefined;
|
|
1951
|
+
}>;
|
|
1952
|
+
type IntegerFieldSpec = z.infer<typeof integerFieldSchema>;
|
|
1953
|
+
/** A boolean checkbox field. */
|
|
1954
|
+
declare const booleanFieldSchema: z.ZodObject<{
|
|
1955
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
1956
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
1957
|
+
name: z.ZodString;
|
|
1958
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
1959
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1960
|
+
/** Helper text shown under the control. */
|
|
1961
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1962
|
+
/** Whether a value is required before the form can submit. */
|
|
1963
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1964
|
+
type: z.ZodLiteral<"boolean">;
|
|
1965
|
+
}, "strip", z.ZodTypeAny, {
|
|
1966
|
+
name: string;
|
|
1967
|
+
type: "boolean";
|
|
1968
|
+
label?: string | undefined;
|
|
1969
|
+
default?: boolean | undefined;
|
|
1970
|
+
required?: boolean | undefined;
|
|
1971
|
+
description?: string | undefined;
|
|
1972
|
+
}, {
|
|
1973
|
+
name: string;
|
|
1974
|
+
type: "boolean";
|
|
1975
|
+
label?: string | undefined;
|
|
1976
|
+
default?: boolean | undefined;
|
|
1977
|
+
required?: boolean | undefined;
|
|
1978
|
+
description?: string | undefined;
|
|
1979
|
+
}>;
|
|
1980
|
+
type BooleanFieldSpec = z.infer<typeof booleanFieldSchema>;
|
|
1981
|
+
/** A single-select enum (one value from `options`). */
|
|
1982
|
+
declare const enumFieldSchema: z.ZodObject<{
|
|
1983
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1984
|
+
const: z.ZodString;
|
|
1985
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1986
|
+
}, "strip", z.ZodTypeAny, {
|
|
1987
|
+
const: string;
|
|
1988
|
+
title?: string | undefined;
|
|
1989
|
+
}, {
|
|
1990
|
+
const: string;
|
|
1991
|
+
title?: string | undefined;
|
|
1992
|
+
}>]>, "many">;
|
|
1993
|
+
default: z.ZodOptional<z.ZodString>;
|
|
1994
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
1995
|
+
name: z.ZodString;
|
|
1996
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
1997
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1998
|
+
/** Helper text shown under the control. */
|
|
1999
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2000
|
+
/** Whether a value is required before the form can submit. */
|
|
2001
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2002
|
+
type: z.ZodLiteral<"enum">;
|
|
2003
|
+
}, "strip", z.ZodTypeAny, {
|
|
2004
|
+
name: string;
|
|
2005
|
+
type: "enum";
|
|
2006
|
+
options: (string | {
|
|
2007
|
+
const: string;
|
|
2008
|
+
title?: string | undefined;
|
|
2009
|
+
})[];
|
|
2010
|
+
label?: string | undefined;
|
|
2011
|
+
default?: string | undefined;
|
|
2012
|
+
required?: boolean | undefined;
|
|
2013
|
+
description?: string | undefined;
|
|
2014
|
+
}, {
|
|
2015
|
+
name: string;
|
|
2016
|
+
type: "enum";
|
|
2017
|
+
options: (string | {
|
|
2018
|
+
const: string;
|
|
2019
|
+
title?: string | undefined;
|
|
2020
|
+
})[];
|
|
2021
|
+
label?: string | undefined;
|
|
2022
|
+
default?: string | undefined;
|
|
2023
|
+
required?: boolean | undefined;
|
|
2024
|
+
description?: string | undefined;
|
|
2025
|
+
}>;
|
|
2026
|
+
type EnumFieldSpec = z.infer<typeof enumFieldSchema>;
|
|
2027
|
+
/** A multi-select enum (zero or more values from `options`). */
|
|
2028
|
+
declare const multiEnumFieldSchema: z.ZodObject<{
|
|
2029
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2030
|
+
const: z.ZodString;
|
|
2031
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2032
|
+
}, "strip", z.ZodTypeAny, {
|
|
2033
|
+
const: string;
|
|
2034
|
+
title?: string | undefined;
|
|
2035
|
+
}, {
|
|
2036
|
+
const: string;
|
|
2037
|
+
title?: string | undefined;
|
|
2038
|
+
}>]>, "many">;
|
|
2039
|
+
default: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2040
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2041
|
+
name: z.ZodString;
|
|
2042
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2043
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2044
|
+
/** Helper text shown under the control. */
|
|
2045
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2046
|
+
/** Whether a value is required before the form can submit. */
|
|
2047
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2048
|
+
type: z.ZodLiteral<"multi-enum">;
|
|
2049
|
+
}, "strip", z.ZodTypeAny, {
|
|
2050
|
+
name: string;
|
|
2051
|
+
type: "multi-enum";
|
|
2052
|
+
options: (string | {
|
|
2053
|
+
const: string;
|
|
2054
|
+
title?: string | undefined;
|
|
2055
|
+
})[];
|
|
2056
|
+
label?: string | undefined;
|
|
2057
|
+
default?: string[] | undefined;
|
|
2058
|
+
required?: boolean | undefined;
|
|
2059
|
+
description?: string | undefined;
|
|
2060
|
+
}, {
|
|
2061
|
+
name: string;
|
|
2062
|
+
type: "multi-enum";
|
|
2063
|
+
options: (string | {
|
|
2064
|
+
const: string;
|
|
2065
|
+
title?: string | undefined;
|
|
2066
|
+
})[];
|
|
2067
|
+
label?: string | undefined;
|
|
2068
|
+
default?: string[] | undefined;
|
|
2069
|
+
required?: boolean | undefined;
|
|
2070
|
+
description?: string | undefined;
|
|
2071
|
+
}>;
|
|
2072
|
+
type MultiEnumFieldSpec = z.infer<typeof multiEnumFieldSchema>;
|
|
2073
|
+
/** Any one field in a FormSpec. */
|
|
2074
|
+
declare const fieldSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2075
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2076
|
+
format: z.ZodOptional<z.ZodEnum<["email", "uri", "date", "date-time"]>>;
|
|
2077
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
2078
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
2079
|
+
/** A serialized RegExp source string (client-enforced when present). */
|
|
2080
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
2081
|
+
/** Render a textarea instead of a single-line input. */
|
|
2082
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
2083
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2084
|
+
name: z.ZodString;
|
|
2085
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2086
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2087
|
+
/** Helper text shown under the control. */
|
|
2088
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2089
|
+
/** Whether a value is required before the form can submit. */
|
|
2090
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2091
|
+
type: z.ZodLiteral<"string">;
|
|
2092
|
+
}, "strip", z.ZodTypeAny, {
|
|
2093
|
+
name: string;
|
|
2094
|
+
type: "string";
|
|
2095
|
+
label?: string | undefined;
|
|
2096
|
+
default?: string | undefined;
|
|
2097
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2098
|
+
pattern?: string | undefined;
|
|
2099
|
+
maxLength?: number | undefined;
|
|
2100
|
+
minLength?: number | undefined;
|
|
2101
|
+
required?: boolean | undefined;
|
|
2102
|
+
description?: string | undefined;
|
|
2103
|
+
multiline?: boolean | undefined;
|
|
2104
|
+
}, {
|
|
2105
|
+
name: string;
|
|
2106
|
+
type: "string";
|
|
2107
|
+
label?: string | undefined;
|
|
2108
|
+
default?: string | undefined;
|
|
2109
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2110
|
+
pattern?: string | undefined;
|
|
2111
|
+
maxLength?: number | undefined;
|
|
2112
|
+
minLength?: number | undefined;
|
|
2113
|
+
required?: boolean | undefined;
|
|
2114
|
+
description?: string | undefined;
|
|
2115
|
+
multiline?: boolean | undefined;
|
|
2116
|
+
}>, z.ZodObject<{
|
|
2117
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
2118
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
2119
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
2120
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2121
|
+
name: z.ZodString;
|
|
2122
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2123
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2124
|
+
/** Helper text shown under the control. */
|
|
2125
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2126
|
+
/** Whether a value is required before the form can submit. */
|
|
2127
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2128
|
+
type: z.ZodLiteral<"number">;
|
|
2129
|
+
}, "strip", z.ZodTypeAny, {
|
|
2130
|
+
name: string;
|
|
2131
|
+
type: "number";
|
|
2132
|
+
label?: string | undefined;
|
|
2133
|
+
default?: number | undefined;
|
|
2134
|
+
max?: number | undefined;
|
|
2135
|
+
min?: number | undefined;
|
|
2136
|
+
required?: boolean | undefined;
|
|
2137
|
+
description?: string | undefined;
|
|
2138
|
+
}, {
|
|
2139
|
+
name: string;
|
|
2140
|
+
type: "number";
|
|
2141
|
+
label?: string | undefined;
|
|
2142
|
+
default?: number | undefined;
|
|
2143
|
+
max?: number | undefined;
|
|
2144
|
+
min?: number | undefined;
|
|
2145
|
+
required?: boolean | undefined;
|
|
2146
|
+
description?: string | undefined;
|
|
2147
|
+
}>, z.ZodObject<{
|
|
2148
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
2149
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
2150
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
2151
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2152
|
+
name: z.ZodString;
|
|
2153
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2154
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2155
|
+
/** Helper text shown under the control. */
|
|
2156
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2157
|
+
/** Whether a value is required before the form can submit. */
|
|
2158
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2159
|
+
type: z.ZodLiteral<"integer">;
|
|
2160
|
+
}, "strip", z.ZodTypeAny, {
|
|
2161
|
+
name: string;
|
|
2162
|
+
type: "integer";
|
|
2163
|
+
label?: string | undefined;
|
|
2164
|
+
default?: number | undefined;
|
|
2165
|
+
max?: number | undefined;
|
|
2166
|
+
min?: number | undefined;
|
|
2167
|
+
required?: boolean | undefined;
|
|
2168
|
+
description?: string | undefined;
|
|
2169
|
+
}, {
|
|
2170
|
+
name: string;
|
|
2171
|
+
type: "integer";
|
|
2172
|
+
label?: string | undefined;
|
|
2173
|
+
default?: number | undefined;
|
|
2174
|
+
max?: number | undefined;
|
|
2175
|
+
min?: number | undefined;
|
|
2176
|
+
required?: boolean | undefined;
|
|
2177
|
+
description?: string | undefined;
|
|
2178
|
+
}>, z.ZodObject<{
|
|
2179
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
2180
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2181
|
+
name: z.ZodString;
|
|
2182
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2183
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2184
|
+
/** Helper text shown under the control. */
|
|
2185
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2186
|
+
/** Whether a value is required before the form can submit. */
|
|
2187
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2188
|
+
type: z.ZodLiteral<"boolean">;
|
|
2189
|
+
}, "strip", z.ZodTypeAny, {
|
|
2190
|
+
name: string;
|
|
2191
|
+
type: "boolean";
|
|
2192
|
+
label?: string | undefined;
|
|
2193
|
+
default?: boolean | undefined;
|
|
2194
|
+
required?: boolean | undefined;
|
|
2195
|
+
description?: string | undefined;
|
|
2196
|
+
}, {
|
|
2197
|
+
name: string;
|
|
2198
|
+
type: "boolean";
|
|
2199
|
+
label?: string | undefined;
|
|
2200
|
+
default?: boolean | undefined;
|
|
2201
|
+
required?: boolean | undefined;
|
|
2202
|
+
description?: string | undefined;
|
|
2203
|
+
}>, z.ZodObject<{
|
|
2204
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2205
|
+
const: z.ZodString;
|
|
2206
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2207
|
+
}, "strip", z.ZodTypeAny, {
|
|
2208
|
+
const: string;
|
|
2209
|
+
title?: string | undefined;
|
|
2210
|
+
}, {
|
|
2211
|
+
const: string;
|
|
2212
|
+
title?: string | undefined;
|
|
2213
|
+
}>]>, "many">;
|
|
2214
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2215
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2216
|
+
name: z.ZodString;
|
|
2217
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2218
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2219
|
+
/** Helper text shown under the control. */
|
|
2220
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2221
|
+
/** Whether a value is required before the form can submit. */
|
|
2222
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2223
|
+
type: z.ZodLiteral<"enum">;
|
|
2224
|
+
}, "strip", z.ZodTypeAny, {
|
|
2225
|
+
name: string;
|
|
2226
|
+
type: "enum";
|
|
2227
|
+
options: (string | {
|
|
2228
|
+
const: string;
|
|
2229
|
+
title?: string | undefined;
|
|
2230
|
+
})[];
|
|
2231
|
+
label?: string | undefined;
|
|
2232
|
+
default?: string | undefined;
|
|
2233
|
+
required?: boolean | undefined;
|
|
2234
|
+
description?: string | undefined;
|
|
2235
|
+
}, {
|
|
2236
|
+
name: string;
|
|
2237
|
+
type: "enum";
|
|
2238
|
+
options: (string | {
|
|
2239
|
+
const: string;
|
|
2240
|
+
title?: string | undefined;
|
|
2241
|
+
})[];
|
|
2242
|
+
label?: string | undefined;
|
|
2243
|
+
default?: string | undefined;
|
|
2244
|
+
required?: boolean | undefined;
|
|
2245
|
+
description?: string | undefined;
|
|
2246
|
+
}>, z.ZodObject<{
|
|
2247
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2248
|
+
const: z.ZodString;
|
|
2249
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2250
|
+
}, "strip", z.ZodTypeAny, {
|
|
2251
|
+
const: string;
|
|
2252
|
+
title?: string | undefined;
|
|
2253
|
+
}, {
|
|
2254
|
+
const: string;
|
|
2255
|
+
title?: string | undefined;
|
|
2256
|
+
}>]>, "many">;
|
|
2257
|
+
default: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2258
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2259
|
+
name: z.ZodString;
|
|
2260
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2261
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2262
|
+
/** Helper text shown under the control. */
|
|
2263
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2264
|
+
/** Whether a value is required before the form can submit. */
|
|
2265
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2266
|
+
type: z.ZodLiteral<"multi-enum">;
|
|
2267
|
+
}, "strip", z.ZodTypeAny, {
|
|
2268
|
+
name: string;
|
|
2269
|
+
type: "multi-enum";
|
|
2270
|
+
options: (string | {
|
|
2271
|
+
const: string;
|
|
2272
|
+
title?: string | undefined;
|
|
2273
|
+
})[];
|
|
2274
|
+
label?: string | undefined;
|
|
2275
|
+
default?: string[] | undefined;
|
|
2276
|
+
required?: boolean | undefined;
|
|
2277
|
+
description?: string | undefined;
|
|
2278
|
+
}, {
|
|
2279
|
+
name: string;
|
|
2280
|
+
type: "multi-enum";
|
|
2281
|
+
options: (string | {
|
|
2282
|
+
const: string;
|
|
2283
|
+
title?: string | undefined;
|
|
2284
|
+
})[];
|
|
2285
|
+
label?: string | undefined;
|
|
2286
|
+
default?: string[] | undefined;
|
|
2287
|
+
required?: boolean | undefined;
|
|
2288
|
+
description?: string | undefined;
|
|
2289
|
+
}>]>;
|
|
2290
|
+
type FieldSpec = z.infer<typeof fieldSpecSchema>;
|
|
2291
|
+
/**
|
|
2292
|
+
* The serializable form specification produced by an LLM tool-call.
|
|
2293
|
+
* MessageForm reads this, renders the fields, and emits `{ formName, values }`.
|
|
2294
|
+
*
|
|
2295
|
+
* Export target for downstream catalogs: compile the prompt + a validator from
|
|
2296
|
+
* `formSpecSchema`.
|
|
2297
|
+
*/
|
|
2298
|
+
declare const formSpecSchema: z.ZodObject<{
|
|
2299
|
+
/** Stable identifier echoed back in the submit payload. */
|
|
2300
|
+
formName: z.ZodString;
|
|
2301
|
+
/** Heading rendered above the fields (also the accessible form name). */
|
|
2302
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2303
|
+
/** Supplemental description under the title. */
|
|
2304
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2305
|
+
/** The ordered fields to render. */
|
|
2306
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2307
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2308
|
+
format: z.ZodOptional<z.ZodEnum<["email", "uri", "date", "date-time"]>>;
|
|
2309
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
2310
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
2311
|
+
/** A serialized RegExp source string (client-enforced when present). */
|
|
2312
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
2313
|
+
/** Render a textarea instead of a single-line input. */
|
|
2314
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
2315
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2316
|
+
name: z.ZodString;
|
|
2317
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2318
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2319
|
+
/** Helper text shown under the control. */
|
|
2320
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2321
|
+
/** Whether a value is required before the form can submit. */
|
|
2322
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2323
|
+
type: z.ZodLiteral<"string">;
|
|
2324
|
+
}, "strip", z.ZodTypeAny, {
|
|
2325
|
+
name: string;
|
|
2326
|
+
type: "string";
|
|
2327
|
+
label?: string | undefined;
|
|
2328
|
+
default?: string | undefined;
|
|
2329
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2330
|
+
pattern?: string | undefined;
|
|
2331
|
+
maxLength?: number | undefined;
|
|
2332
|
+
minLength?: number | undefined;
|
|
2333
|
+
required?: boolean | undefined;
|
|
2334
|
+
description?: string | undefined;
|
|
2335
|
+
multiline?: boolean | undefined;
|
|
2336
|
+
}, {
|
|
2337
|
+
name: string;
|
|
2338
|
+
type: "string";
|
|
2339
|
+
label?: string | undefined;
|
|
2340
|
+
default?: string | undefined;
|
|
2341
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2342
|
+
pattern?: string | undefined;
|
|
2343
|
+
maxLength?: number | undefined;
|
|
2344
|
+
minLength?: number | undefined;
|
|
2345
|
+
required?: boolean | undefined;
|
|
2346
|
+
description?: string | undefined;
|
|
2347
|
+
multiline?: boolean | undefined;
|
|
2348
|
+
}>, z.ZodObject<{
|
|
2349
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
2350
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
2351
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
2352
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2353
|
+
name: z.ZodString;
|
|
2354
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2355
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2356
|
+
/** Helper text shown under the control. */
|
|
2357
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2358
|
+
/** Whether a value is required before the form can submit. */
|
|
2359
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2360
|
+
type: z.ZodLiteral<"number">;
|
|
2361
|
+
}, "strip", z.ZodTypeAny, {
|
|
2362
|
+
name: string;
|
|
2363
|
+
type: "number";
|
|
2364
|
+
label?: string | undefined;
|
|
2365
|
+
default?: number | undefined;
|
|
2366
|
+
max?: number | undefined;
|
|
2367
|
+
min?: number | undefined;
|
|
2368
|
+
required?: boolean | undefined;
|
|
2369
|
+
description?: string | undefined;
|
|
2370
|
+
}, {
|
|
2371
|
+
name: string;
|
|
2372
|
+
type: "number";
|
|
2373
|
+
label?: string | undefined;
|
|
2374
|
+
default?: number | undefined;
|
|
2375
|
+
max?: number | undefined;
|
|
2376
|
+
min?: number | undefined;
|
|
2377
|
+
required?: boolean | undefined;
|
|
2378
|
+
description?: string | undefined;
|
|
2379
|
+
}>, z.ZodObject<{
|
|
2380
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
2381
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
2382
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
2383
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2384
|
+
name: z.ZodString;
|
|
2385
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2386
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2387
|
+
/** Helper text shown under the control. */
|
|
2388
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2389
|
+
/** Whether a value is required before the form can submit. */
|
|
2390
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2391
|
+
type: z.ZodLiteral<"integer">;
|
|
2392
|
+
}, "strip", z.ZodTypeAny, {
|
|
2393
|
+
name: string;
|
|
2394
|
+
type: "integer";
|
|
2395
|
+
label?: string | undefined;
|
|
2396
|
+
default?: number | undefined;
|
|
2397
|
+
max?: number | undefined;
|
|
2398
|
+
min?: number | undefined;
|
|
2399
|
+
required?: boolean | undefined;
|
|
2400
|
+
description?: string | undefined;
|
|
2401
|
+
}, {
|
|
2402
|
+
name: string;
|
|
2403
|
+
type: "integer";
|
|
2404
|
+
label?: string | undefined;
|
|
2405
|
+
default?: number | undefined;
|
|
2406
|
+
max?: number | undefined;
|
|
2407
|
+
min?: number | undefined;
|
|
2408
|
+
required?: boolean | undefined;
|
|
2409
|
+
description?: string | undefined;
|
|
2410
|
+
}>, z.ZodObject<{
|
|
2411
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
2412
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2413
|
+
name: z.ZodString;
|
|
2414
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2415
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2416
|
+
/** Helper text shown under the control. */
|
|
2417
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2418
|
+
/** Whether a value is required before the form can submit. */
|
|
2419
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2420
|
+
type: z.ZodLiteral<"boolean">;
|
|
2421
|
+
}, "strip", z.ZodTypeAny, {
|
|
2422
|
+
name: string;
|
|
2423
|
+
type: "boolean";
|
|
2424
|
+
label?: string | undefined;
|
|
2425
|
+
default?: boolean | undefined;
|
|
2426
|
+
required?: boolean | undefined;
|
|
2427
|
+
description?: string | undefined;
|
|
2428
|
+
}, {
|
|
2429
|
+
name: string;
|
|
2430
|
+
type: "boolean";
|
|
2431
|
+
label?: string | undefined;
|
|
2432
|
+
default?: boolean | undefined;
|
|
2433
|
+
required?: boolean | undefined;
|
|
2434
|
+
description?: string | undefined;
|
|
2435
|
+
}>, z.ZodObject<{
|
|
2436
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2437
|
+
const: z.ZodString;
|
|
2438
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2439
|
+
}, "strip", z.ZodTypeAny, {
|
|
2440
|
+
const: string;
|
|
2441
|
+
title?: string | undefined;
|
|
2442
|
+
}, {
|
|
2443
|
+
const: string;
|
|
2444
|
+
title?: string | undefined;
|
|
2445
|
+
}>]>, "many">;
|
|
2446
|
+
default: z.ZodOptional<z.ZodString>;
|
|
2447
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2448
|
+
name: z.ZodString;
|
|
2449
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2450
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2451
|
+
/** Helper text shown under the control. */
|
|
2452
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2453
|
+
/** Whether a value is required before the form can submit. */
|
|
2454
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2455
|
+
type: z.ZodLiteral<"enum">;
|
|
2456
|
+
}, "strip", z.ZodTypeAny, {
|
|
2457
|
+
name: string;
|
|
2458
|
+
type: "enum";
|
|
2459
|
+
options: (string | {
|
|
2460
|
+
const: string;
|
|
2461
|
+
title?: string | undefined;
|
|
2462
|
+
})[];
|
|
2463
|
+
label?: string | undefined;
|
|
2464
|
+
default?: string | undefined;
|
|
2465
|
+
required?: boolean | undefined;
|
|
2466
|
+
description?: string | undefined;
|
|
2467
|
+
}, {
|
|
2468
|
+
name: string;
|
|
2469
|
+
type: "enum";
|
|
2470
|
+
options: (string | {
|
|
2471
|
+
const: string;
|
|
2472
|
+
title?: string | undefined;
|
|
2473
|
+
})[];
|
|
2474
|
+
label?: string | undefined;
|
|
2475
|
+
default?: string | undefined;
|
|
2476
|
+
required?: boolean | undefined;
|
|
2477
|
+
description?: string | undefined;
|
|
2478
|
+
}>, z.ZodObject<{
|
|
2479
|
+
options: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
2480
|
+
const: z.ZodString;
|
|
2481
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2482
|
+
}, "strip", z.ZodTypeAny, {
|
|
2483
|
+
const: string;
|
|
2484
|
+
title?: string | undefined;
|
|
2485
|
+
}, {
|
|
2486
|
+
const: string;
|
|
2487
|
+
title?: string | undefined;
|
|
2488
|
+
}>]>, "many">;
|
|
2489
|
+
default: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2490
|
+
/** Value key in the emitted form state (the `values` object key). */
|
|
2491
|
+
name: z.ZodString;
|
|
2492
|
+
/** Human label. Falls back to a humanized `name` when omitted. */
|
|
2493
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2494
|
+
/** Helper text shown under the control. */
|
|
2495
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2496
|
+
/** Whether a value is required before the form can submit. */
|
|
2497
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
2498
|
+
type: z.ZodLiteral<"multi-enum">;
|
|
2499
|
+
}, "strip", z.ZodTypeAny, {
|
|
2500
|
+
name: string;
|
|
2501
|
+
type: "multi-enum";
|
|
2502
|
+
options: (string | {
|
|
2503
|
+
const: string;
|
|
2504
|
+
title?: string | undefined;
|
|
2505
|
+
})[];
|
|
2506
|
+
label?: string | undefined;
|
|
2507
|
+
default?: string[] | undefined;
|
|
2508
|
+
required?: boolean | undefined;
|
|
2509
|
+
description?: string | undefined;
|
|
2510
|
+
}, {
|
|
2511
|
+
name: string;
|
|
2512
|
+
type: "multi-enum";
|
|
2513
|
+
options: (string | {
|
|
2514
|
+
const: string;
|
|
2515
|
+
title?: string | undefined;
|
|
2516
|
+
})[];
|
|
2517
|
+
label?: string | undefined;
|
|
2518
|
+
default?: string[] | undefined;
|
|
2519
|
+
required?: boolean | undefined;
|
|
2520
|
+
description?: string | undefined;
|
|
2521
|
+
}>]>, "many">;
|
|
2522
|
+
/** Submit button label. @default "Submit" */
|
|
2523
|
+
submitLabel: z.ZodOptional<z.ZodString>;
|
|
2524
|
+
}, "strip", z.ZodTypeAny, {
|
|
2525
|
+
formName: string;
|
|
2526
|
+
fields: ({
|
|
2527
|
+
name: string;
|
|
2528
|
+
type: "string";
|
|
2529
|
+
label?: string | undefined;
|
|
2530
|
+
default?: string | undefined;
|
|
2531
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2532
|
+
pattern?: string | undefined;
|
|
2533
|
+
maxLength?: number | undefined;
|
|
2534
|
+
minLength?: number | undefined;
|
|
2535
|
+
required?: boolean | undefined;
|
|
2536
|
+
description?: string | undefined;
|
|
2537
|
+
multiline?: boolean | undefined;
|
|
2538
|
+
} | {
|
|
2539
|
+
name: string;
|
|
2540
|
+
type: "number";
|
|
2541
|
+
label?: string | undefined;
|
|
2542
|
+
default?: number | undefined;
|
|
2543
|
+
max?: number | undefined;
|
|
2544
|
+
min?: number | undefined;
|
|
2545
|
+
required?: boolean | undefined;
|
|
2546
|
+
description?: string | undefined;
|
|
2547
|
+
} | {
|
|
2548
|
+
name: string;
|
|
2549
|
+
type: "integer";
|
|
2550
|
+
label?: string | undefined;
|
|
2551
|
+
default?: number | undefined;
|
|
2552
|
+
max?: number | undefined;
|
|
2553
|
+
min?: number | undefined;
|
|
2554
|
+
required?: boolean | undefined;
|
|
2555
|
+
description?: string | undefined;
|
|
2556
|
+
} | {
|
|
2557
|
+
name: string;
|
|
2558
|
+
type: "boolean";
|
|
2559
|
+
label?: string | undefined;
|
|
2560
|
+
default?: boolean | undefined;
|
|
2561
|
+
required?: boolean | undefined;
|
|
2562
|
+
description?: string | undefined;
|
|
2563
|
+
} | {
|
|
2564
|
+
name: string;
|
|
2565
|
+
type: "enum";
|
|
2566
|
+
options: (string | {
|
|
2567
|
+
const: string;
|
|
2568
|
+
title?: string | undefined;
|
|
2569
|
+
})[];
|
|
2570
|
+
label?: string | undefined;
|
|
2571
|
+
default?: string | undefined;
|
|
2572
|
+
required?: boolean | undefined;
|
|
2573
|
+
description?: string | undefined;
|
|
2574
|
+
} | {
|
|
2575
|
+
name: string;
|
|
2576
|
+
type: "multi-enum";
|
|
2577
|
+
options: (string | {
|
|
2578
|
+
const: string;
|
|
2579
|
+
title?: string | undefined;
|
|
2580
|
+
})[];
|
|
2581
|
+
label?: string | undefined;
|
|
2582
|
+
default?: string[] | undefined;
|
|
2583
|
+
required?: boolean | undefined;
|
|
2584
|
+
description?: string | undefined;
|
|
2585
|
+
})[];
|
|
2586
|
+
title?: string | undefined;
|
|
2587
|
+
description?: string | undefined;
|
|
2588
|
+
submitLabel?: string | undefined;
|
|
2589
|
+
}, {
|
|
2590
|
+
formName: string;
|
|
2591
|
+
fields: ({
|
|
2592
|
+
name: string;
|
|
2593
|
+
type: "string";
|
|
2594
|
+
label?: string | undefined;
|
|
2595
|
+
default?: string | undefined;
|
|
2596
|
+
format?: "email" | "date" | "uri" | "date-time" | undefined;
|
|
2597
|
+
pattern?: string | undefined;
|
|
2598
|
+
maxLength?: number | undefined;
|
|
2599
|
+
minLength?: number | undefined;
|
|
2600
|
+
required?: boolean | undefined;
|
|
2601
|
+
description?: string | undefined;
|
|
2602
|
+
multiline?: boolean | undefined;
|
|
2603
|
+
} | {
|
|
2604
|
+
name: string;
|
|
2605
|
+
type: "number";
|
|
2606
|
+
label?: string | undefined;
|
|
2607
|
+
default?: number | undefined;
|
|
2608
|
+
max?: number | undefined;
|
|
2609
|
+
min?: number | undefined;
|
|
2610
|
+
required?: boolean | undefined;
|
|
2611
|
+
description?: string | undefined;
|
|
2612
|
+
} | {
|
|
2613
|
+
name: string;
|
|
2614
|
+
type: "integer";
|
|
2615
|
+
label?: string | undefined;
|
|
2616
|
+
default?: number | undefined;
|
|
2617
|
+
max?: number | undefined;
|
|
2618
|
+
min?: number | undefined;
|
|
2619
|
+
required?: boolean | undefined;
|
|
2620
|
+
description?: string | undefined;
|
|
2621
|
+
} | {
|
|
2622
|
+
name: string;
|
|
2623
|
+
type: "boolean";
|
|
2624
|
+
label?: string | undefined;
|
|
2625
|
+
default?: boolean | undefined;
|
|
2626
|
+
required?: boolean | undefined;
|
|
2627
|
+
description?: string | undefined;
|
|
2628
|
+
} | {
|
|
2629
|
+
name: string;
|
|
2630
|
+
type: "enum";
|
|
2631
|
+
options: (string | {
|
|
2632
|
+
const: string;
|
|
2633
|
+
title?: string | undefined;
|
|
2634
|
+
})[];
|
|
2635
|
+
label?: string | undefined;
|
|
2636
|
+
default?: string | undefined;
|
|
2637
|
+
required?: boolean | undefined;
|
|
2638
|
+
description?: string | undefined;
|
|
2639
|
+
} | {
|
|
2640
|
+
name: string;
|
|
2641
|
+
type: "multi-enum";
|
|
2642
|
+
options: (string | {
|
|
2643
|
+
const: string;
|
|
2644
|
+
title?: string | undefined;
|
|
2645
|
+
})[];
|
|
2646
|
+
label?: string | undefined;
|
|
2647
|
+
default?: string[] | undefined;
|
|
2648
|
+
required?: boolean | undefined;
|
|
2649
|
+
description?: string | undefined;
|
|
2650
|
+
})[];
|
|
2651
|
+
title?: string | undefined;
|
|
2652
|
+
description?: string | undefined;
|
|
2653
|
+
submitLabel?: string | undefined;
|
|
2654
|
+
}>;
|
|
2655
|
+
type FormSpec = z.infer<typeof formSpecSchema>;
|
|
2656
|
+
/** A single field's value in the form state. */
|
|
2657
|
+
type FormValue = string | number | boolean | string[] | undefined;
|
|
2658
|
+
/** The `values` object keyed by field `name`. */
|
|
2659
|
+
type FormValues = Record<string, FormValue>;
|
|
2660
|
+
/** The payload passed to `onSubmit`. */
|
|
2661
|
+
interface FormSubmitState {
|
|
2662
|
+
/** Echoes `spec.formName`. */
|
|
2663
|
+
formName: string;
|
|
2664
|
+
/** The current field values keyed by field name. */
|
|
2665
|
+
values: FormValues;
|
|
2666
|
+
}
|
|
2667
|
+
/** A validated, render-ready FormSpec. */
|
|
2668
|
+
interface NormalizedFormSpec {
|
|
2669
|
+
formName: string;
|
|
2670
|
+
title?: string;
|
|
2671
|
+
description?: string;
|
|
2672
|
+
submitLabel?: string;
|
|
2673
|
+
fields: FieldSpec[];
|
|
2674
|
+
}
|
|
2675
|
+
/**
|
|
2676
|
+
* Lenient parse for the render path. Mirrors AutoChart's guard philosophy:
|
|
2677
|
+
* NEVER throws. Individually invalid or half-streamed fields are dropped (not
|
|
2678
|
+
* fatal), so a partial spec still renders progressively. Returns `{ ok: false }`
|
|
2679
|
+
* only when the whole spec is unusable (not an object) — the caller then shows
|
|
2680
|
+
* `MessageFormFallback`.
|
|
2681
|
+
*/
|
|
2682
|
+
declare function normalizeFormSpec(spec: unknown): {
|
|
2683
|
+
ok: true;
|
|
2684
|
+
spec: NormalizedFormSpec;
|
|
2685
|
+
} | {
|
|
2686
|
+
ok: false;
|
|
2687
|
+
reason: string;
|
|
2688
|
+
};
|
|
2689
|
+
/** The label to show for a field (explicit `label`, else a humanized `name`). */
|
|
2690
|
+
declare function fieldLabel(field: FieldSpec): string;
|
|
2691
|
+
/** Seed the initial values from each field's `default` (+ sensible empties). */
|
|
2692
|
+
declare function initialFormValues(fields: FieldSpec[]): FormValues;
|
|
2693
|
+
/**
|
|
2694
|
+
* Validate one field's value against its declarative constraints.
|
|
2695
|
+
* Returns a short human error message, or `null` when the value is valid.
|
|
2696
|
+
* The vocabulary: required · email · url · min · max · minLength · maxLength ·
|
|
2697
|
+
* pattern · numeric (integer whole-number).
|
|
2698
|
+
*/
|
|
2699
|
+
declare function validateField(field: FieldSpec, value: FormValue): string | null;
|
|
2700
|
+
/** Validate every field; returns a `{ [name]: error | null }` map. */
|
|
2701
|
+
declare function validateForm(fields: FieldSpec[], values: FormValues): Record<string, string | null>;
|
|
2702
|
+
|
|
2703
|
+
interface MessageFormProviderProps {
|
|
2704
|
+
/** A validated/normalized spec (a plain `FormSpec` also satisfies this). */
|
|
2705
|
+
spec: NormalizedFormSpec;
|
|
2706
|
+
/**
|
|
2707
|
+
* Controlled values. When provided the component is controlled and `onChange`
|
|
2708
|
+
* is the only way to update state.
|
|
2709
|
+
*/
|
|
2710
|
+
values?: FormValues;
|
|
2711
|
+
/** Called with the next full values object on any field change. */
|
|
2712
|
+
onChange?: (values: FormValues) => void;
|
|
2713
|
+
/** Called with `{ formName, values }` when a valid form is submitted. */
|
|
2714
|
+
onSubmit?: (state: FormSubmitState) => void;
|
|
2715
|
+
/** Disable every control (form is not interactable). */
|
|
2716
|
+
disabled?: boolean;
|
|
2717
|
+
/** Terminal submitted state: controls are inert, values visible, no submit. */
|
|
2718
|
+
submitted?: boolean;
|
|
2719
|
+
/** In-flight submit: controls disabled, the submit button shows a spinner. */
|
|
2720
|
+
submitting?: boolean;
|
|
2721
|
+
/** The spec is still streaming in (renders a skeleton when no fields yet). */
|
|
2722
|
+
streaming?: boolean;
|
|
2723
|
+
children: ReactNode;
|
|
2724
|
+
}
|
|
2725
|
+
/**
|
|
2726
|
+
* Lifts the form values. Controlled (pass `values`) or uncontrolled.
|
|
2727
|
+
* Derives `isControlled = values !== undefined` and never flips modes.
|
|
2728
|
+
*/
|
|
2729
|
+
declare function MessageFormProvider({ spec, values: valuesProp, onChange, onSubmit, disabled, submitted, submitting, streaming, children, }: MessageFormProviderProps): react.JSX.Element;
|
|
2730
|
+
interface MessageFormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2731
|
+
/** The field's `name` (its key in the spec + values). */
|
|
2732
|
+
name: string;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* Renders one field by name: label, control, description, inline error.
|
|
2736
|
+
* Boolean fields render their own inline label (checkbox + label), so the
|
|
2737
|
+
* standalone `<Label>` above is suppressed for them.
|
|
2738
|
+
*/
|
|
2739
|
+
declare const MessageFormField: react.ForwardRefExoticComponent<MessageFormFieldProps & react.RefAttributes<HTMLDivElement>>;
|
|
2740
|
+
type MessageFormFieldsProps = HTMLAttributes<HTMLDivElement>;
|
|
2741
|
+
/** Renders every field in the spec, in order. A skeleton while streaming empty. */
|
|
2742
|
+
declare const MessageFormFields: react.ForwardRefExoticComponent<MessageFormFieldsProps & react.RefAttributes<HTMLDivElement>>;
|
|
2743
|
+
interface MessageFormSubmitProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2744
|
+
/** Submit button label (overrides `spec.submitLabel`). @default "Submit" */
|
|
2745
|
+
label?: string;
|
|
2746
|
+
}
|
|
2747
|
+
/**
|
|
2748
|
+
* The submit affordance. Enabled until the request starts (validation runs on
|
|
2749
|
+
* click), then a spinner. A submitted form shows an inert "Submitted" note.
|
|
2750
|
+
*/
|
|
2751
|
+
declare const MessageFormSubmit: react.ForwardRefExoticComponent<MessageFormSubmitProps & react.RefAttributes<HTMLDivElement>>;
|
|
2752
|
+
type MessageFormRootProps = Omit<HTMLAttributes<HTMLFormElement>, "onSubmit">;
|
|
2753
|
+
/**
|
|
2754
|
+
* The `<form>` element wired to the context's `submit`. Never nest inside
|
|
2755
|
+
* another `<form>` — compose it as its own message-body block.
|
|
2756
|
+
*/
|
|
2757
|
+
declare const MessageFormRoot: react.ForwardRefExoticComponent<MessageFormRootProps & react.RefAttributes<HTMLFormElement>>;
|
|
2758
|
+
type MessageFormTitleProps = HTMLAttributes<HTMLParagraphElement>;
|
|
2759
|
+
/** The form heading. Its id is the `<form>`'s `aria-labelledby` target. */
|
|
2760
|
+
declare const MessageFormTitle: react.ForwardRefExoticComponent<MessageFormTitleProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
2761
|
+
type MessageFormDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
2762
|
+
/** Supplemental description under the title. */
|
|
2763
|
+
declare const MessageFormDescription: react.ForwardRefExoticComponent<MessageFormDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
2764
|
+
interface MessageFormFallbackProps extends HTMLAttributes<HTMLDivElement> {
|
|
2765
|
+
/** Short human reason the form could not render. */
|
|
2766
|
+
message?: string;
|
|
2767
|
+
}
|
|
2768
|
+
/**
|
|
2769
|
+
* Shown when the spec is unusable. Mirrors `ChartFallback`: a calm, bordered
|
|
2770
|
+
* status box with a short reason — never a thrown error.
|
|
2771
|
+
*/
|
|
2772
|
+
declare const MessageFormFallback: react.ForwardRefExoticComponent<MessageFormFallbackProps & react.RefAttributes<HTMLDivElement>>;
|
|
2773
|
+
interface MessageFormProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit" | "onChange" | "title"> {
|
|
2774
|
+
/** The serializable form specification produced by an LLM tool-call. */
|
|
2775
|
+
spec: FormSpec | unknown;
|
|
2776
|
+
/** Controlled values (`{ [fieldName]: value }`). Omit for uncontrolled. */
|
|
2777
|
+
values?: FormValues;
|
|
2778
|
+
/** Called with the next full values object on any change. */
|
|
2779
|
+
onChange?: (values: FormValues) => void;
|
|
2780
|
+
/** Called with `{ formName, values }` on a valid submit. */
|
|
2781
|
+
onSubmit?: (state: FormSubmitState) => void;
|
|
2782
|
+
/** Submit button label (overrides `spec.submitLabel`). */
|
|
2783
|
+
submitLabel?: string;
|
|
2784
|
+
/** Disable every control. */
|
|
2785
|
+
disabled?: boolean;
|
|
2786
|
+
/** Terminal submitted state: inert, values visible, submit replaced. */
|
|
2787
|
+
submitted?: boolean;
|
|
2788
|
+
/** In-flight submit: controls disabled, spinner on submit. */
|
|
2789
|
+
submitting?: boolean;
|
|
2790
|
+
/** The spec is still streaming (renders a skeleton when no fields yet). */
|
|
2791
|
+
streaming?: boolean;
|
|
2792
|
+
}
|
|
2793
|
+
/**
|
|
2794
|
+
* Convenience composition: `Provider → Root(form) → title/description → Fields →
|
|
2795
|
+
* Submit`. For a custom layout, compose `MessageFormProvider` + the parts.
|
|
2796
|
+
* A malformed spec renders `MessageFormFallback` (never throws).
|
|
2797
|
+
*/
|
|
2798
|
+
declare const MessageForm: react.ForwardRefExoticComponent<MessageFormProps & react.RefAttributes<HTMLDivElement>>;
|
|
2799
|
+
|
|
2800
|
+
/**
|
|
2801
|
+
* message-table-spec.ts — Serializable TableSpec for MessageTable.
|
|
2802
|
+
*
|
|
2803
|
+
* Pure data types + zod schemas (no React). The shape is what an LLM tool-call
|
|
2804
|
+
* emits when it wants to show tabular data inside a chat message. It is
|
|
2805
|
+
* column-oriented: `columns` declare the shape + per-column `format`, and each
|
|
2806
|
+
* `rows` entry is an object keyed by column `key`.
|
|
2807
|
+
*
|
|
2808
|
+
* The exported zod schemas are the source of truth downstream catalogs compile
|
|
2809
|
+
* prompts + validators from. Specs carry NO style-bearing props — the model
|
|
2810
|
+
* chooses the data and its semantic format, never the look.
|
|
2811
|
+
*/
|
|
2812
|
+
|
|
2813
|
+
/**
|
|
2814
|
+
* How a cell's value is rendered + aligned.
|
|
2815
|
+
* - `text` (default) — as-is, start-aligned.
|
|
2816
|
+
* - `number` / `currency` / `percent` — `Intl`-formatted, end-aligned, tabular.
|
|
2817
|
+
* - `date` — localized date.
|
|
2818
|
+
* - `badge` — a tonal badge whose tone is inferred from the value's semantics.
|
|
2819
|
+
*/
|
|
2820
|
+
declare const cellFormatSchema: z.ZodEnum<["text", "number", "currency", "percent", "date", "badge"]>;
|
|
2821
|
+
type CellFormat = z.infer<typeof cellFormatSchema>;
|
|
2822
|
+
/** One column definition. */
|
|
2823
|
+
declare const columnSpecSchema: z.ZodObject<{
|
|
2824
|
+
/** The row-object key this column reads. */
|
|
2825
|
+
key: z.ZodString;
|
|
2826
|
+
/** Header label. Falls back to the `key` when omitted. */
|
|
2827
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2828
|
+
/** How cells in this column are formatted + aligned. @default "text" */
|
|
2829
|
+
format: z.ZodOptional<z.ZodEnum<["text", "number", "currency", "percent", "date", "badge"]>>;
|
|
2830
|
+
}, "strip", z.ZodTypeAny, {
|
|
2831
|
+
key: string;
|
|
2832
|
+
label?: string | undefined;
|
|
2833
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2834
|
+
}, {
|
|
2835
|
+
key: string;
|
|
2836
|
+
label?: string | undefined;
|
|
2837
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2838
|
+
}>;
|
|
2839
|
+
type ColumnSpec = z.infer<typeof columnSpecSchema>;
|
|
2840
|
+
/** A single row: an object keyed by column `key`. */
|
|
2841
|
+
type TableRowData = Record<string, unknown>;
|
|
2842
|
+
/**
|
|
2843
|
+
* The serializable table specification produced by an LLM tool-call.
|
|
2844
|
+
* MessageTable reads this and renders a lightweight, message-body table.
|
|
2845
|
+
*/
|
|
2846
|
+
declare const tableSpecSchema: z.ZodObject<{
|
|
2847
|
+
/** Optional heading + accessible label for the table. */
|
|
2848
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2849
|
+
/** Ordered column definitions. */
|
|
2850
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
2851
|
+
/** The row-object key this column reads. */
|
|
2852
|
+
key: z.ZodString;
|
|
2853
|
+
/** Header label. Falls back to the `key` when omitted. */
|
|
2854
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2855
|
+
/** How cells in this column are formatted + aligned. @default "text" */
|
|
2856
|
+
format: z.ZodOptional<z.ZodEnum<["text", "number", "currency", "percent", "date", "badge"]>>;
|
|
2857
|
+
}, "strip", z.ZodTypeAny, {
|
|
2858
|
+
key: string;
|
|
2859
|
+
label?: string | undefined;
|
|
2860
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2861
|
+
}, {
|
|
2862
|
+
key: string;
|
|
2863
|
+
label?: string | undefined;
|
|
2864
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2865
|
+
}>, "many">;
|
|
2866
|
+
/** Row objects keyed by column `key`. */
|
|
2867
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
2868
|
+
/** Message shown when there are zero rows. @default "No rows to display" */
|
|
2869
|
+
emptyText: z.ZodOptional<z.ZodString>;
|
|
2870
|
+
}, "strip", z.ZodTypeAny, {
|
|
2871
|
+
columns: {
|
|
2872
|
+
key: string;
|
|
2873
|
+
label?: string | undefined;
|
|
2874
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2875
|
+
}[];
|
|
2876
|
+
rows: Record<string, unknown>[];
|
|
2877
|
+
title?: string | undefined;
|
|
2878
|
+
emptyText?: string | undefined;
|
|
2879
|
+
}, {
|
|
2880
|
+
columns: {
|
|
2881
|
+
key: string;
|
|
2882
|
+
label?: string | undefined;
|
|
2883
|
+
format?: "number" | "text" | "percent" | "currency" | "date" | "badge" | undefined;
|
|
2884
|
+
}[];
|
|
2885
|
+
rows: Record<string, unknown>[];
|
|
2886
|
+
title?: string | undefined;
|
|
2887
|
+
emptyText?: string | undefined;
|
|
2888
|
+
}>;
|
|
2889
|
+
type TableSpec = z.infer<typeof tableSpecSchema>;
|
|
2890
|
+
/** A validated, render-ready TableSpec. */
|
|
2891
|
+
interface NormalizedTableSpec {
|
|
2892
|
+
title?: string;
|
|
2893
|
+
columns: ColumnSpec[];
|
|
2894
|
+
rows: TableRowData[];
|
|
2895
|
+
emptyText?: string;
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* Lenient parse for the render path. NEVER throws. Individually invalid columns
|
|
2899
|
+
* are dropped and non-object rows are filtered out, so a partial (streaming)
|
|
2900
|
+
* spec still renders progressively. Returns `{ ok: false }` only when the whole
|
|
2901
|
+
* spec is unusable (not an object).
|
|
2902
|
+
*/
|
|
2903
|
+
declare function normalizeTableSpec(spec: unknown): {
|
|
2904
|
+
ok: true;
|
|
2905
|
+
spec: NormalizedTableSpec;
|
|
2906
|
+
} | {
|
|
2907
|
+
ok: false;
|
|
2908
|
+
reason: string;
|
|
2909
|
+
};
|
|
2910
|
+
/** The em-dash shown for a missing / empty cell. */
|
|
2911
|
+
declare const EMPTY_CELL = "\u2014";
|
|
2912
|
+
/** Whether a format is numeric (drives end-alignment + `tabular-nums`). */
|
|
2913
|
+
declare function isNumericFormat(format: CellFormat | undefined): boolean;
|
|
2914
|
+
/** Whether a value is considered empty (renders the em-dash). */
|
|
2915
|
+
declare function isEmptyCell(value: unknown): boolean;
|
|
2916
|
+
/**
|
|
2917
|
+
* Format a present value to a display string per its column format.
|
|
2918
|
+
* Unknown formats fall through to `String(value)` (never throws). Empty values
|
|
2919
|
+
* are the caller's concern (render `EMPTY_CELL`). `percent` follows `Intl`
|
|
2920
|
+
* semantics — pass fractions (0.42 → "42%").
|
|
2921
|
+
*/
|
|
2922
|
+
declare function formatCellValue(value: unknown, format: CellFormat | undefined): string;
|
|
2923
|
+
type BadgeTone = "secondary" | "success" | "warning" | "destructive" | "info";
|
|
2924
|
+
/** Infer a badge tone from a value's semantics (status vocabulary). */
|
|
2925
|
+
declare function badgeToneForValue(value: unknown): BadgeTone;
|
|
2926
|
+
/** Compare two cell values for sorting, honoring numeric/date formats. */
|
|
2927
|
+
declare function compareCellValues(a: unknown, b: unknown, format: CellFormat | undefined): number;
|
|
2928
|
+
|
|
2929
|
+
interface TableSort {
|
|
2930
|
+
/** The sorted column's key. */
|
|
2931
|
+
key: string;
|
|
2932
|
+
direction: "asc" | "desc";
|
|
2933
|
+
}
|
|
2934
|
+
/** Per-cell render override — return `undefined` to fall back to default rendering. */
|
|
2935
|
+
type RenderCell = (args: {
|
|
2936
|
+
value: unknown;
|
|
2937
|
+
column: ColumnSpec;
|
|
2938
|
+
row: TableRowData;
|
|
2939
|
+
rowIndex: number;
|
|
2940
|
+
}) => ReactNode;
|
|
2941
|
+
interface MessageTableFallbackProps extends HTMLAttributes<HTMLDivElement> {
|
|
2942
|
+
/** Short human reason the table could not render. */
|
|
2943
|
+
message?: string;
|
|
2944
|
+
}
|
|
2945
|
+
/** Shown when the spec is unusable. Mirrors `ChartFallback` semantics. */
|
|
2946
|
+
declare const MessageTableFallback: react.ForwardRefExoticComponent<MessageTableFallbackProps & react.RefAttributes<HTMLDivElement>>;
|
|
2947
|
+
interface MessageTableProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
2948
|
+
/** The serializable table specification produced by an LLM tool-call. */
|
|
2949
|
+
spec: TableSpec | unknown;
|
|
2950
|
+
/** Enable click-to-sort column headers. @default false */
|
|
2951
|
+
sortable?: boolean;
|
|
2952
|
+
/** Controlled sort. When provided, `onSortChange` is the only way to update it. */
|
|
2953
|
+
sort?: TableSort | null;
|
|
2954
|
+
/** Uncontrolled initial sort. */
|
|
2955
|
+
defaultSort?: TableSort | null;
|
|
2956
|
+
/** Called with the next sort (or `null`) when a header is clicked. */
|
|
2957
|
+
onSortChange?: (sort: TableSort | null) => void;
|
|
2958
|
+
/** Cap the number of rendered rows; shows a "Showing N of M rows" notice. */
|
|
2959
|
+
maxRows?: number;
|
|
2960
|
+
/** Per-cell render override for custom composition. */
|
|
2961
|
+
renderCell?: RenderCell;
|
|
2962
|
+
/** The spec is still streaming (columns-but-no-rows shows skeleton rows). */
|
|
2963
|
+
streaming?: boolean;
|
|
2964
|
+
}
|
|
2965
|
+
/**
|
|
2966
|
+
* MessageTable — renders a `TableSpec` as a lightweight message-body table.
|
|
2967
|
+
*
|
|
2968
|
+
* Intentionally bare: no toolbar, no expand chrome. Growing one here would be
|
|
2969
|
+
* `ChartFrame` re-implemented inside this package.
|
|
2970
|
+
*
|
|
2971
|
+
* **To make it expandable, wrap it in `ExpandDialog`**
|
|
2972
|
+
* (`@elabs-ai/components-ui`) — the shared two-pane expand surface,
|
|
2973
|
+
* the same one a chart opens. Do NOT hand-roll a lightbox or a full-screen
|
|
2974
|
+
* breakout; four of those already existed before the component was shared, and
|
|
2975
|
+
* each one taught users a different meaning for the same button.
|
|
2976
|
+
*
|
|
2977
|
+
* The context pane for a table is its SHAPE, not statistics: row count,
|
|
2978
|
+
* "showing N of M", column count, each column's declared `format`. A
|
|
2979
|
+
* model-emitted table's numerics may already be formatted strings, so min/max/avg
|
|
2980
|
+
* over them is wrong more often than right.
|
|
2981
|
+
*/
|
|
2982
|
+
declare const MessageTable: react.ForwardRefExoticComponent<MessageTableProps & react.RefAttributes<HTMLDivElement>>;
|
|
2983
|
+
|
|
2984
|
+
declare const useAudioDevices: () => {
|
|
2985
|
+
devices: MediaDeviceInfo[];
|
|
2986
|
+
error: string | null;
|
|
2987
|
+
hasPermission: boolean;
|
|
2988
|
+
loadDevices: () => Promise<void>;
|
|
2989
|
+
loading: boolean;
|
|
2990
|
+
};
|
|
2991
|
+
type MicSelectorProps = ComponentProps<typeof Popover> & {
|
|
2992
|
+
defaultValue?: string;
|
|
2993
|
+
value?: string | undefined;
|
|
2994
|
+
onValueChange?: (value: string | undefined) => void;
|
|
2995
|
+
open?: boolean;
|
|
2996
|
+
onOpenChange?: (open: boolean) => void;
|
|
2997
|
+
};
|
|
2998
|
+
declare const MicSelector: ({ defaultValue, value: controlledValue, onValueChange: controlledOnValueChange, defaultOpen, open: controlledOpen, onOpenChange: controlledOnOpenChange, ...props }: MicSelectorProps) => react.JSX.Element;
|
|
2999
|
+
type MicSelectorTriggerProps = ComponentProps<typeof Button>;
|
|
3000
|
+
declare const MicSelectorTrigger: ({ children, ...props }: MicSelectorTriggerProps) => react.JSX.Element;
|
|
3001
|
+
type MicSelectorContentProps = ComponentProps<typeof Command> & {
|
|
3002
|
+
popoverOptions?: ComponentProps<typeof PopoverContent>;
|
|
3003
|
+
};
|
|
3004
|
+
declare const MicSelectorContent: ({ className, popoverOptions, ...props }: MicSelectorContentProps) => react.JSX.Element;
|
|
3005
|
+
type MicSelectorInputProps = ComponentProps<typeof CommandInput> & {
|
|
3006
|
+
value?: string;
|
|
3007
|
+
defaultValue?: string;
|
|
3008
|
+
onValueChange?: (value: string) => void;
|
|
3009
|
+
};
|
|
3010
|
+
declare const MicSelectorInput: ({ ...props }: MicSelectorInputProps) => react.JSX.Element;
|
|
3011
|
+
type MicSelectorListProps = Omit<ComponentProps<typeof CommandList>, "children"> & {
|
|
3012
|
+
children: (devices: MediaDeviceInfo[]) => ReactNode;
|
|
3013
|
+
};
|
|
3014
|
+
declare const MicSelectorList: ({ children, ...props }: MicSelectorListProps) => react.JSX.Element;
|
|
3015
|
+
type MicSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
3016
|
+
declare const MicSelectorEmpty: ({ children, ...props }: MicSelectorEmptyProps) => react.JSX.Element;
|
|
3017
|
+
type MicSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
3018
|
+
declare const MicSelectorItem: (props: MicSelectorItemProps) => react.JSX.Element;
|
|
3019
|
+
type MicSelectorLabelProps = ComponentProps<"span"> & {
|
|
3020
|
+
device: MediaDeviceInfo;
|
|
3021
|
+
};
|
|
3022
|
+
declare const MicSelectorLabel: ({ device, className, ...props }: MicSelectorLabelProps) => react.JSX.Element;
|
|
3023
|
+
type MicSelectorValueProps = ComponentProps<"span">;
|
|
3024
|
+
declare const MicSelectorValue: ({ className, ...props }: MicSelectorValueProps) => react.JSX.Element;
|
|
3025
|
+
|
|
3026
|
+
type ModelSelectorProps = ComponentProps<typeof Dialog>;
|
|
3027
|
+
declare const ModelSelector: (props: ModelSelectorProps) => react.JSX.Element;
|
|
3028
|
+
type ModelSelectorTriggerProps = ComponentProps<typeof DialogTrigger>;
|
|
3029
|
+
declare const ModelSelectorTrigger: (props: ModelSelectorTriggerProps) => react.JSX.Element;
|
|
3030
|
+
type ModelSelectorContentProps = ComponentProps<typeof DialogContent> & {
|
|
3031
|
+
title?: ReactNode;
|
|
3032
|
+
};
|
|
3033
|
+
declare const ModelSelectorContent: ({ className, children, title, ...props }: ModelSelectorContentProps) => react.JSX.Element;
|
|
3034
|
+
type ModelSelectorDialogProps = ComponentProps<typeof CommandDialog>;
|
|
3035
|
+
declare const ModelSelectorDialog: (props: ModelSelectorDialogProps) => react.JSX.Element;
|
|
3036
|
+
type ModelSelectorInputProps = ComponentProps<typeof CommandInput>;
|
|
3037
|
+
declare const ModelSelectorInput: ({ className, ...props }: ModelSelectorInputProps) => react.JSX.Element;
|
|
3038
|
+
type ModelSelectorListProps = ComponentProps<typeof CommandList>;
|
|
3039
|
+
declare const ModelSelectorList: (props: ModelSelectorListProps) => react.JSX.Element;
|
|
3040
|
+
type ModelSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
3041
|
+
declare const ModelSelectorEmpty: (props: ModelSelectorEmptyProps) => react.JSX.Element;
|
|
3042
|
+
type ModelSelectorGroupProps = ComponentProps<typeof CommandGroup>;
|
|
3043
|
+
declare const ModelSelectorGroup: (props: ModelSelectorGroupProps) => react.JSX.Element;
|
|
3044
|
+
type ModelSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
3045
|
+
declare const ModelSelectorItem: (props: ModelSelectorItemProps) => react.JSX.Element;
|
|
3046
|
+
type ModelSelectorShortcutProps = ComponentProps<typeof CommandShortcut>;
|
|
3047
|
+
declare const ModelSelectorShortcut: (props: ModelSelectorShortcutProps) => react.JSX.Element;
|
|
3048
|
+
type ModelSelectorSeparatorProps = ComponentProps<typeof CommandSeparator>;
|
|
3049
|
+
declare const ModelSelectorSeparator: (props: ModelSelectorSeparatorProps) => react.JSX.Element;
|
|
3050
|
+
/**
|
|
3051
|
+
* Where provider logos are fetched from by default.
|
|
3052
|
+
*
|
|
3053
|
+
* This is a REMOTE origin: a deployment with a restrictive `img-src` blocks it.
|
|
3054
|
+
* Self-host the SVGs and pass `src` (or set a `fallback`) — see
|
|
3055
|
+
* `docs/CSP-AND-NETWORK.md`.
|
|
3056
|
+
*/
|
|
3057
|
+
declare const MODEL_SELECTOR_LOGO_BASE_URL = "https://models.dev/logos";
|
|
3058
|
+
type ModelSelectorLogoProps = Omit<ComponentProps<"img">, "alt"> & {
|
|
3059
|
+
/**
|
|
3060
|
+
* Override the logo URL — point at a self-hosted or bundled asset when a CSP
|
|
3061
|
+
* blocks `models.dev`. Defaults to `${MODEL_SELECTOR_LOGO_BASE_URL}/<provider>.svg`.
|
|
3062
|
+
*/
|
|
3063
|
+
src?: string;
|
|
3064
|
+
/**
|
|
3065
|
+
* Rendered when the logo fails to load (blocked, offline, or unknown
|
|
3066
|
+
* provider). Defaults to a neutral Lucide glyph, so the row never collapses
|
|
3067
|
+
* to a broken image.
|
|
3068
|
+
*/
|
|
3069
|
+
fallback?: ReactNode;
|
|
3070
|
+
provider: "moonshotai-cn" | "lucidquery" | "moonshotai" | "zai-coding-plan" | "alibaba" | "xai" | "vultr" | "nvidia" | "upstage" | "groq" | "github-copilot" | "mistral" | "vercel" | "nebius" | "deepseek" | "alibaba-cn" | "google-vertex-anthropic" | "venice" | "chutes" | "cortecs" | "github-models" | "togetherai" | "azure" | "baseten" | "huggingface" | "opencode" | "fastrouter" | "google" | "google-vertex" | "cloudflare-workers-ai" | "inception" | "wandb" | "openai" | "zhipuai-coding-plan" | "perplexity" | "openrouter" | "zenmux" | "v0" | "iflowcn" | "synthetic" | "deepinfra" | "zhipuai" | "submodel" | "zai" | "inference" | "requesty" | "morph" | "lmstudio" | "anthropic" | "aihubmix" | "fireworks-ai" | "modelscope" | "llama" | "scaleway" | "amazon-bedrock" | "cerebras" | (string & {});
|
|
3071
|
+
};
|
|
3072
|
+
declare const ModelSelectorLogo: ({ provider, className, src, fallback, onError, ...props }: ModelSelectorLogoProps) => react.JSX.Element;
|
|
3073
|
+
type ModelSelectorLogoGroupProps = ComponentProps<"div">;
|
|
3074
|
+
declare const ModelSelectorLogoGroup: ({ className, ...props }: ModelSelectorLogoGroupProps) => react.JSX.Element;
|
|
3075
|
+
type ModelSelectorNameProps = ComponentProps<"span">;
|
|
3076
|
+
declare const ModelSelectorName: ({ className, ...props }: ModelSelectorNameProps) => react.JSX.Element;
|
|
3077
|
+
|
|
3078
|
+
interface BrandMotionConfigProps {
|
|
3079
|
+
children: ReactNode;
|
|
3080
|
+
/** Override the default transition handed to descendant Motion components. */
|
|
3081
|
+
transition?: Transition;
|
|
3082
|
+
}
|
|
3083
|
+
/**
|
|
3084
|
+
* App-level wrapper that bridges the brand-ui motion preference into Motion
|
|
3085
|
+
* (motion.dev). It drives Motion's `reducedMotion` from `useReducedMotion()`
|
|
3086
|
+
* (user choice > OS setting) so JS-driven Motion components honor the SAME gate
|
|
3087
|
+
* as the CSS `--motion-factor` layer, and supplies a token-mirrored default
|
|
3088
|
+
* transition. Provider-OPTIONAL: without a `<ThemeProvider>` it degrades to
|
|
3089
|
+
* OS-only reduced-motion detection.
|
|
3090
|
+
*
|
|
3091
|
+
* Wrap the Motion-using subtree (e.g. the chat surface) once near the app root.
|
|
3092
|
+
*
|
|
3093
|
+
* NOTE: Motion's `reducedMotion="always"` disables only transform/layout
|
|
3094
|
+
* animations (opacity/color persist — "reduced != none"). Components that loop
|
|
3095
|
+
* on other properties (e.g. {@link Shimmer}, which animates backgroundPosition)
|
|
3096
|
+
* must still branch on `useReducedMotion()` themselves.
|
|
3097
|
+
*/
|
|
3098
|
+
declare function BrandMotionConfig({ children, transition, }: BrandMotionConfigProps): react.JSX.Element;
|
|
3099
|
+
|
|
3100
|
+
type NodeProps = ComponentProps<typeof Card> & {
|
|
3101
|
+
handles: {
|
|
3102
|
+
target: boolean;
|
|
3103
|
+
source: boolean;
|
|
3104
|
+
};
|
|
3105
|
+
};
|
|
3106
|
+
declare const Node: (props: NodeProps) => react.JSX.Element;
|
|
3107
|
+
type NodeHeaderProps = ComponentProps<typeof CardHeader>;
|
|
3108
|
+
declare const NodeHeader: ({ className, ...props }: NodeHeaderProps) => react.JSX.Element;
|
|
3109
|
+
type NodeTitleProps = ComponentProps<typeof CardTitle>;
|
|
3110
|
+
declare const NodeTitle: (props: NodeTitleProps) => react.JSX.Element;
|
|
3111
|
+
type NodeDescriptionProps = ComponentProps<typeof CardDescription>;
|
|
3112
|
+
declare const NodeDescription: (props: NodeDescriptionProps) => react.JSX.Element;
|
|
3113
|
+
type NodeActionProps = ComponentProps<typeof CardAction>;
|
|
3114
|
+
declare const NodeAction: (props: NodeActionProps) => react.JSX.Element;
|
|
3115
|
+
type NodeContentProps = ComponentProps<typeof CardContent>;
|
|
3116
|
+
declare const NodeContent: ({ className, ...props }: NodeContentProps) => react.JSX.Element;
|
|
3117
|
+
type NodeFooterProps = ComponentProps<typeof CardFooter>;
|
|
3118
|
+
declare const NodeFooter: ({ className, ...props }: NodeFooterProps) => react.JSX.Element;
|
|
3119
|
+
|
|
3120
|
+
type OpenInProps = ComponentProps<typeof DropdownMenu> & {
|
|
3121
|
+
query: string;
|
|
3122
|
+
};
|
|
3123
|
+
declare const OpenIn: ({ query, ...props }: OpenInProps) => react.JSX.Element;
|
|
3124
|
+
type OpenInContentProps = ComponentProps<typeof DropdownMenuContent>;
|
|
3125
|
+
declare const OpenInContent: ({ className, ...props }: OpenInContentProps) => react.JSX.Element;
|
|
3126
|
+
type OpenInItemProps = ComponentProps<typeof DropdownMenuItem>;
|
|
3127
|
+
declare const OpenInItem: (props: OpenInItemProps) => react.JSX.Element;
|
|
3128
|
+
type OpenInLabelProps = ComponentProps<typeof DropdownMenuLabel>;
|
|
3129
|
+
declare const OpenInLabel: (props: OpenInLabelProps) => react.JSX.Element;
|
|
3130
|
+
type OpenInSeparatorProps = ComponentProps<typeof DropdownMenuSeparator>;
|
|
3131
|
+
declare const OpenInSeparator: (props: OpenInSeparatorProps) => react.JSX.Element;
|
|
3132
|
+
type OpenInTriggerProps = ComponentProps<typeof DropdownMenuTrigger>;
|
|
3133
|
+
declare const OpenInTrigger: ({ children, ...props }: OpenInTriggerProps) => react.JSX.Element;
|
|
3134
|
+
type OpenInChatGPTProps = ComponentProps<typeof DropdownMenuItem>;
|
|
3135
|
+
declare const OpenInChatGPT: (props: OpenInChatGPTProps) => react.JSX.Element;
|
|
3136
|
+
type OpenInClaudeProps = ComponentProps<typeof DropdownMenuItem>;
|
|
3137
|
+
declare const OpenInClaude: (props: OpenInClaudeProps) => react.JSX.Element;
|
|
3138
|
+
type OpenInT3Props = ComponentProps<typeof DropdownMenuItem>;
|
|
3139
|
+
declare const OpenInT3: (props: OpenInT3Props) => react.JSX.Element;
|
|
3140
|
+
type OpenInSciraProps = ComponentProps<typeof DropdownMenuItem>;
|
|
3141
|
+
declare const OpenInScira: (props: OpenInSciraProps) => react.JSX.Element;
|
|
3142
|
+
type OpenInv0Props = ComponentProps<typeof DropdownMenuItem>;
|
|
3143
|
+
declare const OpenInv0: (props: OpenInv0Props) => react.JSX.Element;
|
|
3144
|
+
type OpenInCursorProps = ComponentProps<typeof DropdownMenuItem>;
|
|
3145
|
+
declare const OpenInCursor: (props: OpenInCursorProps) => react.JSX.Element;
|
|
3146
|
+
|
|
3147
|
+
type ChangeType = "major" | "minor" | "patch" | "added" | "removed";
|
|
3148
|
+
type PackageInfoHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
3149
|
+
declare const PackageInfoHeader: ({ className, children, ...props }: PackageInfoHeaderProps) => react.JSX.Element;
|
|
3150
|
+
type PackageInfoNameProps = HTMLAttributes<HTMLDivElement>;
|
|
3151
|
+
declare const PackageInfoName: ({ className, children, ...props }: PackageInfoNameProps) => react.JSX.Element;
|
|
3152
|
+
type PackageInfoChangeTypeProps = HTMLAttributes<HTMLDivElement>;
|
|
3153
|
+
declare const PackageInfoChangeType: ({ className, children, ...props }: PackageInfoChangeTypeProps) => react.JSX.Element | null;
|
|
3154
|
+
type PackageInfoVersionProps = HTMLAttributes<HTMLDivElement>;
|
|
3155
|
+
declare const PackageInfoVersion: ({ className, children, ...props }: PackageInfoVersionProps) => react.JSX.Element | null;
|
|
3156
|
+
type PackageInfoProps = HTMLAttributes<HTMLDivElement> & {
|
|
3157
|
+
name: string;
|
|
3158
|
+
currentVersion?: string;
|
|
3159
|
+
newVersion?: string;
|
|
3160
|
+
changeType?: ChangeType;
|
|
3161
|
+
};
|
|
3162
|
+
declare const PackageInfo: ({ name, currentVersion, newVersion, changeType, className, children, ...props }: PackageInfoProps) => react.JSX.Element;
|
|
3163
|
+
type PackageInfoDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
3164
|
+
declare const PackageInfoDescription: ({ className, children, ...props }: PackageInfoDescriptionProps) => react.JSX.Element;
|
|
3165
|
+
type PackageInfoContentProps = HTMLAttributes<HTMLDivElement>;
|
|
3166
|
+
declare const PackageInfoContent: ({ className, children, ...props }: PackageInfoContentProps) => react.JSX.Element;
|
|
3167
|
+
type PackageInfoDependenciesProps = HTMLAttributes<HTMLDivElement>;
|
|
3168
|
+
declare const PackageInfoDependencies: ({ className, children, ...props }: PackageInfoDependenciesProps) => react.JSX.Element;
|
|
3169
|
+
type PackageInfoDependencyProps = HTMLAttributes<HTMLDivElement> & {
|
|
3170
|
+
name: string;
|
|
3171
|
+
version?: string;
|
|
3172
|
+
};
|
|
3173
|
+
declare const PackageInfoDependency: ({ name, version, className, children, ...props }: PackageInfoDependencyProps) => react.JSX.Element;
|
|
3174
|
+
|
|
3175
|
+
type PanelProps = ComponentProps<typeof Panel$1>;
|
|
3176
|
+
declare const Panel: (props: PanelProps) => react.JSX.Element;
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* Persona artwork sources — a plain data module shared by `persona.tsx` (the
|
|
3180
|
+
* public shell) and `_persona-rive.tsx` (the lazily-loaded Rive half), so
|
|
3181
|
+
* neither has to import the other.
|
|
3182
|
+
*/
|
|
3183
|
+
type PersonaState = "idle" | "listening" | "thinking" | "speaking" | "asleep";
|
|
3184
|
+
/**
|
|
3185
|
+
* Where the shipped `.riv` artwork is fetched from.
|
|
3186
|
+
*
|
|
3187
|
+
* ⚠️ These are REMOTE origins fetched at runtime by the Rive runtime — a
|
|
3188
|
+
* deployment with a restrictive `connect-src` blocks them, and the component
|
|
3189
|
+
* falls back to a token-driven orb. Self-host the six files and pass
|
|
3190
|
+
* `<Persona src={…}>` to point at your own copies. See `docs/CSP-AND-NETWORK.md`.
|
|
3191
|
+
*/
|
|
3192
|
+
declare const PERSONA_SOURCES: {
|
|
3193
|
+
readonly command: {
|
|
3194
|
+
readonly dynamicColor: true;
|
|
3195
|
+
readonly hasModel: true;
|
|
3196
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/command-2.0.riv";
|
|
3197
|
+
};
|
|
3198
|
+
readonly glint: {
|
|
3199
|
+
readonly dynamicColor: true;
|
|
3200
|
+
readonly hasModel: true;
|
|
3201
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/glint-2.0.riv";
|
|
3202
|
+
};
|
|
3203
|
+
readonly halo: {
|
|
3204
|
+
readonly dynamicColor: true;
|
|
3205
|
+
readonly hasModel: true;
|
|
3206
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/halo-2.0.riv";
|
|
3207
|
+
};
|
|
3208
|
+
readonly mana: {
|
|
3209
|
+
readonly dynamicColor: false;
|
|
3210
|
+
readonly hasModel: true;
|
|
3211
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/mana-2.0.riv";
|
|
3212
|
+
};
|
|
3213
|
+
readonly obsidian: {
|
|
3214
|
+
readonly dynamicColor: true;
|
|
3215
|
+
readonly hasModel: true;
|
|
3216
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/obsidian-2.0.riv";
|
|
3217
|
+
};
|
|
3218
|
+
readonly opal: {
|
|
3219
|
+
readonly dynamicColor: false;
|
|
3220
|
+
readonly hasModel: false;
|
|
3221
|
+
readonly source: "https://ejiidnob33g9ap1r.public.blob.vercel-storage.com/orb-1.2.riv";
|
|
3222
|
+
};
|
|
3223
|
+
};
|
|
3224
|
+
type PersonaVariant = keyof typeof PERSONA_SOURCES;
|
|
3225
|
+
|
|
3226
|
+
interface PersonaProps {
|
|
3227
|
+
className?: string;
|
|
3228
|
+
/**
|
|
3229
|
+
* Rendered while the artwork loads, and permanently if it fails (blocked by a
|
|
3230
|
+
* `connect-src` CSP, offline, or a bad `src`). Defaults to a token-driven orb,
|
|
3231
|
+
* so a blocked fetch never leaves an empty box.
|
|
3232
|
+
*/
|
|
3233
|
+
fallback?: ReactNode;
|
|
3234
|
+
onLoad?: RiveParameters["onLoad"];
|
|
3235
|
+
onLoadError?: RiveParameters["onLoadError"];
|
|
3236
|
+
onPause?: RiveParameters["onPause"];
|
|
3237
|
+
onPlay?: RiveParameters["onPlay"];
|
|
3238
|
+
onReady?: () => void;
|
|
3239
|
+
onStop?: RiveParameters["onStop"];
|
|
3240
|
+
/**
|
|
3241
|
+
* Override the `.riv` artwork URL — point at a self-hosted copy when a CSP
|
|
3242
|
+
* blocks the default origin. Defaults to `PERSONA_SOURCES[variant].source`.
|
|
3243
|
+
* Mirrors the `mapStyle` override on `MapCanvas`.
|
|
3244
|
+
*/
|
|
3245
|
+
src?: string;
|
|
3246
|
+
state: PersonaState;
|
|
3247
|
+
/**
|
|
3248
|
+
* Visually-hidden text announced when `state` changes. Defaults to a
|
|
3249
|
+
* localized label for the current `state`; pass `null` when the consuming
|
|
3250
|
+
* surface already renders its own `role="status"` line, so AT is not told
|
|
3251
|
+
* twice.
|
|
3252
|
+
*/
|
|
3253
|
+
statusLabel?: ReactNode | null;
|
|
3254
|
+
variant?: PersonaVariant;
|
|
3255
|
+
}
|
|
3256
|
+
declare const Persona: FC<PersonaProps>;
|
|
3257
|
+
|
|
3258
|
+
type PlanProps = ComponentProps<typeof Collapsible> & {
|
|
3259
|
+
isStreaming?: boolean;
|
|
3260
|
+
};
|
|
3261
|
+
declare const Plan: ({ className, isStreaming, children, ...props }: PlanProps) => react.JSX.Element;
|
|
3262
|
+
type PlanHeaderProps = ComponentProps<typeof CardHeader>;
|
|
3263
|
+
declare const PlanHeader: ({ className, ...props }: PlanHeaderProps) => react.JSX.Element;
|
|
3264
|
+
type PlanTitleProps = Omit<ComponentProps<typeof CardTitle>, "children"> & {
|
|
3265
|
+
children: string;
|
|
3266
|
+
};
|
|
3267
|
+
declare const PlanTitle: ({ children, ...props }: PlanTitleProps) => react.JSX.Element;
|
|
3268
|
+
type PlanDescriptionProps = Omit<ComponentProps<typeof CardDescription>, "children"> & {
|
|
3269
|
+
children: string;
|
|
3270
|
+
};
|
|
3271
|
+
declare const PlanDescription: ({ className, children, ...props }: PlanDescriptionProps) => react.JSX.Element;
|
|
3272
|
+
type PlanActionProps = ComponentProps<typeof CardAction>;
|
|
3273
|
+
declare const PlanAction: (props: PlanActionProps) => react.JSX.Element;
|
|
3274
|
+
type PlanContentProps = ComponentProps<typeof CardContent>;
|
|
3275
|
+
declare const PlanContent: ({ className, ...props }: PlanContentProps) => react.JSX.Element;
|
|
3276
|
+
type PlanFooterProps = ComponentProps<"div">;
|
|
3277
|
+
declare const PlanFooter: (props: PlanFooterProps) => react.JSX.Element;
|
|
3278
|
+
type PlanTriggerProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
3279
|
+
declare const PlanTrigger: ({ className, ...props }: PlanTriggerProps) => react.JSX.Element;
|
|
3280
|
+
|
|
3281
|
+
interface QueueMessagePart {
|
|
3282
|
+
type: string;
|
|
3283
|
+
text?: string;
|
|
3284
|
+
url?: string;
|
|
3285
|
+
filename?: string;
|
|
3286
|
+
mediaType?: string;
|
|
3287
|
+
}
|
|
3288
|
+
interface QueueMessage {
|
|
3289
|
+
id: string;
|
|
3290
|
+
parts: QueueMessagePart[];
|
|
3291
|
+
}
|
|
3292
|
+
interface QueueTodo {
|
|
3293
|
+
id: string;
|
|
3294
|
+
title: string;
|
|
3295
|
+
description?: string;
|
|
3296
|
+
status?: "pending" | "completed";
|
|
3297
|
+
}
|
|
3298
|
+
type QueueItemProps = ComponentProps<"li">;
|
|
3299
|
+
declare const QueueItem: ({ className, ...props }: QueueItemProps) => react.JSX.Element;
|
|
3300
|
+
type QueueItemIndicatorProps = ComponentProps<"span"> & {
|
|
3301
|
+
completed?: boolean;
|
|
3302
|
+
};
|
|
3303
|
+
declare const QueueItemIndicator: ({ completed, className, ...props }: QueueItemIndicatorProps) => react.JSX.Element;
|
|
3304
|
+
type QueueItemContentProps = ComponentProps<"span"> & {
|
|
3305
|
+
completed?: boolean;
|
|
3306
|
+
};
|
|
3307
|
+
declare const QueueItemContent: ({ completed, className, ...props }: QueueItemContentProps) => react.JSX.Element;
|
|
3308
|
+
type QueueItemDescriptionProps = ComponentProps<"div"> & {
|
|
3309
|
+
completed?: boolean;
|
|
3310
|
+
};
|
|
3311
|
+
declare const QueueItemDescription: ({ completed, className, ...props }: QueueItemDescriptionProps) => react.JSX.Element;
|
|
3312
|
+
type QueueItemActionsProps = ComponentProps<"div">;
|
|
3313
|
+
declare const QueueItemActions: ({ className, ...props }: QueueItemActionsProps) => react.JSX.Element;
|
|
3314
|
+
type QueueItemActionProps = Omit<ComponentProps<typeof Button>, "variant" | "size">;
|
|
3315
|
+
declare const QueueItemAction: ({ className, ...props }: QueueItemActionProps) => react.JSX.Element;
|
|
3316
|
+
type QueueItemAttachmentProps = ComponentProps<"div">;
|
|
3317
|
+
declare const QueueItemAttachment: ({ className, ...props }: QueueItemAttachmentProps) => react.JSX.Element;
|
|
3318
|
+
type QueueItemImageProps = ComponentProps<"img">;
|
|
3319
|
+
declare const QueueItemImage: ({ className, ...props }: QueueItemImageProps) => react.JSX.Element;
|
|
3320
|
+
type QueueItemFileProps = ComponentProps<"span">;
|
|
3321
|
+
declare const QueueItemFile: ({ children, className, ...props }: QueueItemFileProps) => react.JSX.Element;
|
|
3322
|
+
type QueueListProps = ComponentProps<typeof ScrollArea>;
|
|
3323
|
+
declare const QueueList: ({ children, className, ...props }: QueueListProps) => react.JSX.Element;
|
|
3324
|
+
type QueueSectionProps = ComponentProps<typeof Collapsible>;
|
|
3325
|
+
declare const QueueSection: ({ className, defaultOpen, ...props }: QueueSectionProps) => react.JSX.Element;
|
|
3326
|
+
type QueueSectionTriggerProps = ComponentProps<"button">;
|
|
3327
|
+
declare const QueueSectionTrigger: ({ children, className, ...props }: QueueSectionTriggerProps) => react.JSX.Element;
|
|
3328
|
+
type QueueSectionLabelProps = ComponentProps<"span"> & {
|
|
3329
|
+
count?: number;
|
|
3330
|
+
label: string;
|
|
3331
|
+
icon?: React.ReactNode;
|
|
3332
|
+
};
|
|
3333
|
+
declare const QueueSectionLabel: ({ count, label, icon, className, ...props }: QueueSectionLabelProps) => react.JSX.Element;
|
|
3334
|
+
type QueueSectionContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3335
|
+
declare const QueueSectionContent: ({ className, ...props }: QueueSectionContentProps) => react.JSX.Element;
|
|
3336
|
+
type QueueProps = ComponentProps<"div">;
|
|
3337
|
+
declare const Queue: ({ className, ...props }: QueueProps) => react.JSX.Element;
|
|
3338
|
+
|
|
3339
|
+
interface ReasoningContextValue {
|
|
3340
|
+
isStreaming: boolean;
|
|
3341
|
+
isOpen: boolean;
|
|
3342
|
+
setIsOpen: (open: boolean) => void;
|
|
3343
|
+
duration: number | undefined;
|
|
3344
|
+
}
|
|
3345
|
+
declare const useReasoning: () => ReasoningContextValue;
|
|
3346
|
+
type ReasoningProps = ComponentProps<typeof Collapsible> & {
|
|
3347
|
+
isStreaming?: boolean;
|
|
3348
|
+
open?: boolean;
|
|
3349
|
+
defaultOpen?: boolean;
|
|
3350
|
+
onOpenChange?: (open: boolean) => void;
|
|
3351
|
+
duration?: number;
|
|
3352
|
+
};
|
|
3353
|
+
declare const Reasoning: react.MemoExoticComponent<({ className, isStreaming, open, defaultOpen, onOpenChange, duration: durationProp, children, ...props }: ReasoningProps) => react.JSX.Element>;
|
|
3354
|
+
type ReasoningTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
3355
|
+
getThinkingMessage?: (isStreaming: boolean, duration?: number) => ReactNode;
|
|
3356
|
+
};
|
|
3357
|
+
declare const ReasoningTrigger: react.MemoExoticComponent<({ className, children, getThinkingMessage, ...props }: ReasoningTriggerProps) => react.JSX.Element>;
|
|
3358
|
+
type ReasoningContentProps = Omit<ComponentProps<typeof CollapsibleContent>, "children"> & {
|
|
3359
|
+
/**
|
|
3360
|
+
* The reasoning body.
|
|
3361
|
+
*
|
|
3362
|
+
* A **string** is rendered as streamed markdown (Streamdown) — the default for
|
|
3363
|
+
* model reasoning text. Any other node renders **as-is**, so a structured live
|
|
3364
|
+
* ledger (a timeline, per-step status) can live inside the disclosure without
|
|
3365
|
+
* being handed to a markdown parser. Mirrors the `getThinkingMessage` /
|
|
3366
|
+
* `children` override seam on `ReasoningTrigger`.
|
|
3367
|
+
*
|
|
3368
|
+
* Note an **array** of strings is not a `string` — `{["a", "b"]}` renders raw.
|
|
3369
|
+
* Pass one string if you want it parsed as markdown.
|
|
3370
|
+
*/
|
|
3371
|
+
children: ReactNode;
|
|
3372
|
+
};
|
|
3373
|
+
declare const ReasoningContent: react.MemoExoticComponent<({ className, children, ...props }: ReasoningContentProps) => react.JSX.Element>;
|
|
3374
|
+
|
|
3375
|
+
type SandboxProps = ComponentProps<typeof Collapsible> & {
|
|
3376
|
+
/**
|
|
3377
|
+
* The run output has not arrived yet (loading-states.md loading signal).
|
|
3378
|
+
* SandboxContent renders a layout-shaped skeleton instead of its children;
|
|
3379
|
+
* SandboxHeader keeps rendering as passed.
|
|
3380
|
+
* @default false
|
|
3381
|
+
*/
|
|
3382
|
+
loading?: boolean;
|
|
3383
|
+
};
|
|
3384
|
+
/** @deprecated Renamed to `SandboxProps`. */
|
|
3385
|
+
type SandboxRootProps = SandboxProps;
|
|
3386
|
+
declare const Sandbox: ({ className, loading, children, ...props }: SandboxProps) => react.JSX.Element;
|
|
3387
|
+
interface SandboxHeaderProps {
|
|
3388
|
+
title?: string;
|
|
3389
|
+
state: ToolUIPart["state"];
|
|
3390
|
+
className?: string;
|
|
3391
|
+
}
|
|
3392
|
+
declare const SandboxHeader: ({ className, title, state, ...props }: SandboxHeaderProps) => react.JSX.Element;
|
|
3393
|
+
type SandboxContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3394
|
+
declare const SandboxContent: ({ className, children, ...props }: SandboxContentProps) => react.JSX.Element;
|
|
3395
|
+
type SandboxTabsProps = ComponentProps<typeof Tabs>;
|
|
3396
|
+
declare const SandboxTabs: ({ className, ...props }: SandboxTabsProps) => react.JSX.Element;
|
|
3397
|
+
type SandboxTabsBarProps = ComponentProps<"div">;
|
|
3398
|
+
declare const SandboxTabsBar: ({ className, ...props }: SandboxTabsBarProps) => react.JSX.Element;
|
|
3399
|
+
type SandboxTabsListProps = ComponentProps<typeof TabsList>;
|
|
3400
|
+
declare const SandboxTabsList: ({ className, ...props }: SandboxTabsListProps) => react.JSX.Element;
|
|
3401
|
+
type SandboxTabsTriggerProps = ComponentProps<typeof TabsTrigger>;
|
|
3402
|
+
declare const SandboxTabsTrigger: ({ className, ...props }: SandboxTabsTriggerProps) => react.JSX.Element;
|
|
3403
|
+
type SandboxTabContentProps = ComponentProps<typeof TabsContent>;
|
|
3404
|
+
declare const SandboxTabContent: ({ className, ...props }: SandboxTabContentProps) => react.JSX.Element;
|
|
3405
|
+
|
|
3406
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
3407
|
+
interface SchemaParameter {
|
|
3408
|
+
name: string;
|
|
3409
|
+
type: string;
|
|
3410
|
+
required?: boolean;
|
|
3411
|
+
description?: string;
|
|
3412
|
+
location?: "path" | "query" | "header";
|
|
3413
|
+
}
|
|
3414
|
+
interface SchemaProperty {
|
|
3415
|
+
name: string;
|
|
3416
|
+
type: string;
|
|
3417
|
+
required?: boolean;
|
|
3418
|
+
description?: string;
|
|
3419
|
+
properties?: SchemaProperty[];
|
|
3420
|
+
items?: SchemaProperty;
|
|
3421
|
+
}
|
|
3422
|
+
type SchemaDisplayHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
3423
|
+
declare const SchemaDisplayHeader: ({ className, children, ...props }: SchemaDisplayHeaderProps) => react.JSX.Element;
|
|
3424
|
+
type SchemaDisplayMethodProps = ComponentProps<typeof Badge>;
|
|
3425
|
+
declare const SchemaDisplayMethod: ({ className, children, ...props }: SchemaDisplayMethodProps) => react.JSX.Element;
|
|
3426
|
+
type SchemaDisplayPathProps = HTMLAttributes<HTMLSpanElement>;
|
|
3427
|
+
declare const SchemaDisplayPath: ({ className, children, ...props }: SchemaDisplayPathProps) => react.JSX.Element;
|
|
3428
|
+
type SchemaDisplayDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
3429
|
+
declare const SchemaDisplayDescription: ({ className, children, ...props }: SchemaDisplayDescriptionProps) => react.JSX.Element;
|
|
3430
|
+
type SchemaDisplayContentProps = HTMLAttributes<HTMLDivElement>;
|
|
3431
|
+
declare const SchemaDisplayContent: ({ className, children, ...props }: SchemaDisplayContentProps) => react.JSX.Element;
|
|
3432
|
+
type SchemaDisplayParameterProps = HTMLAttributes<HTMLDivElement> & SchemaParameter;
|
|
3433
|
+
declare const SchemaDisplayParameter: ({ name, type, required, description, location, className, ...props }: SchemaDisplayParameterProps) => react.JSX.Element;
|
|
3434
|
+
type SchemaDisplayParametersProps = ComponentProps<typeof Collapsible>;
|
|
3435
|
+
declare const SchemaDisplayParameters: ({ className, children, ...props }: SchemaDisplayParametersProps) => react.JSX.Element;
|
|
3436
|
+
type SchemaDisplayPropertyProps = HTMLAttributes<HTMLDivElement> & SchemaProperty & {
|
|
3437
|
+
depth?: number;
|
|
3438
|
+
};
|
|
3439
|
+
declare const SchemaDisplayProperty: ({ name, type, required, description, properties, items, depth, className, ...props }: SchemaDisplayPropertyProps) => react.JSX.Element;
|
|
3440
|
+
type SchemaDisplayRequestProps = ComponentProps<typeof Collapsible>;
|
|
3441
|
+
declare const SchemaDisplayRequest: ({ className, children, ...props }: SchemaDisplayRequestProps) => react.JSX.Element;
|
|
3442
|
+
type SchemaDisplayResponseProps = ComponentProps<typeof Collapsible>;
|
|
3443
|
+
declare const SchemaDisplayResponse: ({ className, children, ...props }: SchemaDisplayResponseProps) => react.JSX.Element;
|
|
3444
|
+
type SchemaDisplayProps = HTMLAttributes<HTMLDivElement> & {
|
|
3445
|
+
method: HttpMethod;
|
|
3446
|
+
path: string;
|
|
3447
|
+
description?: string;
|
|
3448
|
+
parameters?: SchemaParameter[];
|
|
3449
|
+
requestBody?: SchemaProperty[];
|
|
3450
|
+
responseBody?: SchemaProperty[];
|
|
3451
|
+
};
|
|
3452
|
+
declare const SchemaDisplay: ({ method, path, description, parameters, requestBody, responseBody, className, children, ...props }: SchemaDisplayProps) => react.JSX.Element;
|
|
3453
|
+
type SchemaDisplayBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
3454
|
+
declare const SchemaDisplayBody: ({ className, children, ...props }: SchemaDisplayBodyProps) => react.JSX.Element;
|
|
3455
|
+
type SchemaDisplayExampleProps = HTMLAttributes<HTMLPreElement>;
|
|
3456
|
+
declare const SchemaDisplayExample: ({ className, children, ...props }: SchemaDisplayExampleProps) => react.JSX.Element;
|
|
3457
|
+
|
|
3458
|
+
/** A captured selection snapshot: the trimmed text + its viewport rect. */
|
|
3459
|
+
interface SelectionSnapshot {
|
|
3460
|
+
text: string;
|
|
3461
|
+
rect: {
|
|
3462
|
+
top: number;
|
|
3463
|
+
left: number;
|
|
3464
|
+
width: number;
|
|
3465
|
+
height: number;
|
|
3466
|
+
};
|
|
3467
|
+
}
|
|
3468
|
+
/**
|
|
3469
|
+
* Read the current selection if it is a non-empty range fully inside
|
|
3470
|
+
* `container` (and not inside a form field / editor). Returns `null` otherwise.
|
|
3471
|
+
* Exported for testing + custom integrations.
|
|
3472
|
+
*/
|
|
3473
|
+
declare function readSelectionWithin(container: HTMLElement | null): SelectionSnapshot | null;
|
|
3474
|
+
interface SelectionToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3475
|
+
/** Called with the selected text when the user clicks Quote. */
|
|
3476
|
+
onQuote?: (selectedText: string) => void;
|
|
3477
|
+
/** Quote button label. @default "Quote" */
|
|
3478
|
+
quoteLabel?: string;
|
|
3479
|
+
/** Extra toolbar controls rendered after the Quote button. */
|
|
3480
|
+
actions?: ReactNode;
|
|
3481
|
+
/** Disable selection detection entirely. */
|
|
3482
|
+
disabled?: boolean;
|
|
3483
|
+
/** The transcript region to watch for selections. */
|
|
3484
|
+
children: ReactNode;
|
|
3485
|
+
}
|
|
3486
|
+
/**
|
|
3487
|
+
* Wraps a region and shows a floating Quote toolbar over selected text.
|
|
3488
|
+
* The wrapper renders inline (`display: contents` is avoided — it's a real
|
|
3489
|
+
* relative box) so the anchor + portal position correctly.
|
|
3490
|
+
*/
|
|
3491
|
+
declare const SelectionToolbar: react.ForwardRefExoticComponent<SelectionToolbarProps & react.RefAttributes<HTMLDivElement>>;
|
|
3492
|
+
|
|
3493
|
+
interface TextShimmerProps {
|
|
3494
|
+
children: string;
|
|
3495
|
+
as?: ElementType;
|
|
3496
|
+
className?: string;
|
|
3497
|
+
duration?: number;
|
|
3498
|
+
spread?: number;
|
|
3499
|
+
}
|
|
3500
|
+
declare const Shimmer: react.MemoExoticComponent<({ children, as: Component, className, duration, spread, }: TextShimmerProps) => JSX.Element>;
|
|
3501
|
+
|
|
3502
|
+
type SnippetProps = ComponentProps<typeof InputGroup> & {
|
|
3503
|
+
code: string;
|
|
3504
|
+
};
|
|
3505
|
+
declare const Snippet: ({ code, className, children, ...props }: SnippetProps) => react.JSX.Element;
|
|
3506
|
+
type SnippetAddonProps = ComponentProps<typeof InputGroupAddon>;
|
|
3507
|
+
declare const SnippetAddon: (props: SnippetAddonProps) => react.JSX.Element;
|
|
3508
|
+
type SnippetTextProps = ComponentProps<typeof InputGroupText>;
|
|
3509
|
+
declare const SnippetText: ({ className, ...props }: SnippetTextProps) => react.JSX.Element;
|
|
3510
|
+
type SnippetInputProps = Omit<ComponentProps<typeof InputGroupInput>, "readOnly" | "value">;
|
|
3511
|
+
declare const SnippetInput: ({ className, ...props }: SnippetInputProps) => react.JSX.Element;
|
|
3512
|
+
type SnippetCopyButtonProps = ComponentProps<typeof InputGroupButton> & {
|
|
3513
|
+
onCopy?: () => void;
|
|
3514
|
+
onError?: (error: Error) => void;
|
|
3515
|
+
timeout?: number;
|
|
3516
|
+
};
|
|
3517
|
+
declare const SnippetCopyButton: ({ onCopy, onError, timeout, children, className, ...props }: SnippetCopyButtonProps) => react.JSX.Element;
|
|
3518
|
+
|
|
3519
|
+
type SourcesProps = ComponentProps<"div">;
|
|
3520
|
+
declare const Sources: ({ className, ...props }: SourcesProps) => react.JSX.Element;
|
|
3521
|
+
type SourcesTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
3522
|
+
count: number;
|
|
3523
|
+
};
|
|
3524
|
+
declare const SourcesTrigger: ({ className, count, children, ...props }: SourcesTriggerProps) => react.JSX.Element;
|
|
3525
|
+
type SourcesContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3526
|
+
declare const SourcesContent: ({ className, ...props }: SourcesContentProps) => react.JSX.Element;
|
|
3527
|
+
type SourceProps = ComponentProps<"a">;
|
|
3528
|
+
declare const Source: ({ href, title, children, className, ...props }: SourceProps) => react.JSX.Element;
|
|
3529
|
+
interface SourceListItem {
|
|
3530
|
+
href: string;
|
|
3531
|
+
title?: string;
|
|
3532
|
+
}
|
|
3533
|
+
type SourceListProps = Omit<ComponentProps<typeof Sources>, "children"> & {
|
|
3534
|
+
/** The grounding sources, rendered as the named list. */
|
|
3535
|
+
sources: SourceListItem[];
|
|
3536
|
+
/** Extra rows appended after the named list (escape hatch). */
|
|
3537
|
+
children?: ReactNode;
|
|
3538
|
+
};
|
|
3539
|
+
/**
|
|
3540
|
+
* SourceList — the per-answer grounding footer (research 11 §B.4): a green
|
|
3541
|
+
* "Grounded in N sources" header + the named source list. Sugar over the fixed
|
|
3542
|
+
* `Sources`/`Source` primitives, reused by the context panel (research 09).
|
|
3543
|
+
*/
|
|
3544
|
+
declare const SourceList: ({ sources, children, ...props }: SourceListProps) => react.JSX.Element;
|
|
3545
|
+
|
|
3546
|
+
interface SpeechRecognition extends EventTarget {
|
|
3547
|
+
continuous: boolean;
|
|
3548
|
+
interimResults: boolean;
|
|
3549
|
+
lang: string;
|
|
3550
|
+
start(): void;
|
|
3551
|
+
stop(): void;
|
|
3552
|
+
onstart: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
3553
|
+
onend: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
3554
|
+
onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => void) | null;
|
|
3555
|
+
onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => void) | null;
|
|
3556
|
+
}
|
|
3557
|
+
interface SpeechRecognitionEvent extends Event {
|
|
3558
|
+
results: SpeechRecognitionResultList;
|
|
3559
|
+
resultIndex: number;
|
|
3560
|
+
}
|
|
3561
|
+
interface SpeechRecognitionResultList {
|
|
3562
|
+
readonly length: number;
|
|
3563
|
+
item(index: number): SpeechRecognitionResult;
|
|
3564
|
+
[index: number]: SpeechRecognitionResult;
|
|
3565
|
+
}
|
|
3566
|
+
interface SpeechRecognitionResult {
|
|
3567
|
+
readonly length: number;
|
|
3568
|
+
item(index: number): SpeechRecognitionAlternative;
|
|
3569
|
+
[index: number]: SpeechRecognitionAlternative;
|
|
3570
|
+
isFinal: boolean;
|
|
3571
|
+
}
|
|
3572
|
+
interface SpeechRecognitionAlternative {
|
|
3573
|
+
transcript: string;
|
|
3574
|
+
confidence: number;
|
|
3575
|
+
}
|
|
3576
|
+
interface SpeechRecognitionErrorEvent extends Event {
|
|
3577
|
+
error: string;
|
|
3578
|
+
}
|
|
3579
|
+
declare global {
|
|
3580
|
+
interface Window {
|
|
3581
|
+
SpeechRecognition: new () => SpeechRecognition;
|
|
3582
|
+
webkitSpeechRecognition: new () => SpeechRecognition;
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
type SpeechInputProps = ComponentProps<typeof Button> & {
|
|
3586
|
+
onTranscriptionChange?: (text: string) => void;
|
|
3587
|
+
/**
|
|
3588
|
+
* Callback for when audio is recorded using MediaRecorder fallback.
|
|
3589
|
+
* This is called in browsers that don't support the Web Speech API (Firefox, Safari).
|
|
3590
|
+
* The callback receives an audio Blob that should be sent to a transcription service.
|
|
3591
|
+
* Return the transcribed text, which will be passed to onTranscriptionChange.
|
|
3592
|
+
*/
|
|
3593
|
+
onAudioRecorded?: (audioBlob: Blob) => Promise<string>;
|
|
3594
|
+
lang?: string;
|
|
3595
|
+
};
|
|
3596
|
+
declare const SpeechInput: ({ className, onTranscriptionChange, onAudioRecorded, lang, ...props }: SpeechInputProps) => react.JSX.Element;
|
|
3597
|
+
|
|
3598
|
+
type StackTraceProps = ComponentProps<"div"> & {
|
|
3599
|
+
trace: string;
|
|
3600
|
+
open?: boolean;
|
|
3601
|
+
defaultOpen?: boolean;
|
|
3602
|
+
onOpenChange?: (open: boolean) => void;
|
|
3603
|
+
onFilePathClick?: (filePath: string, line?: number, column?: number) => void;
|
|
3604
|
+
};
|
|
3605
|
+
declare const StackTrace: react.MemoExoticComponent<({ trace, className, open, defaultOpen, onOpenChange, onFilePathClick, children, ...props }: StackTraceProps) => react.JSX.Element>;
|
|
3606
|
+
type StackTraceHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
3607
|
+
declare const StackTraceHeader: react.MemoExoticComponent<({ className, children, ...props }: StackTraceHeaderProps) => react.JSX.Element>;
|
|
3608
|
+
type StackTraceErrorProps = ComponentProps<"div">;
|
|
3609
|
+
declare const StackTraceError: react.MemoExoticComponent<({ className, children, ...props }: StackTraceErrorProps) => react.JSX.Element>;
|
|
3610
|
+
type StackTraceErrorTypeProps = ComponentProps<"span">;
|
|
3611
|
+
declare const StackTraceErrorType: react.MemoExoticComponent<({ className, children, ...props }: StackTraceErrorTypeProps) => react.JSX.Element>;
|
|
3612
|
+
type StackTraceErrorMessageProps = ComponentProps<"span">;
|
|
3613
|
+
declare const StackTraceErrorMessage: react.MemoExoticComponent<({ className, children, ...props }: StackTraceErrorMessageProps) => react.JSX.Element>;
|
|
3614
|
+
type StackTraceActionsProps = ComponentProps<"div">;
|
|
3615
|
+
declare const StackTraceActions: react.MemoExoticComponent<({ className, children, ...props }: StackTraceActionsProps) => react.JSX.Element>;
|
|
3616
|
+
type StackTraceCopyButtonProps = ComponentProps<typeof Button> & {
|
|
3617
|
+
onCopy?: () => void;
|
|
3618
|
+
onError?: (error: Error) => void;
|
|
3619
|
+
timeout?: number;
|
|
3620
|
+
};
|
|
3621
|
+
declare const StackTraceCopyButton: react.MemoExoticComponent<({ onCopy, onError, timeout, className, children, ...props }: StackTraceCopyButtonProps) => react.JSX.Element>;
|
|
3622
|
+
type StackTraceExpandButtonProps = ComponentProps<"div">;
|
|
3623
|
+
declare const StackTraceExpandButton: react.MemoExoticComponent<({ className, ...props }: StackTraceExpandButtonProps) => react.JSX.Element>;
|
|
3624
|
+
type StackTraceContentProps = ComponentProps<typeof CollapsibleContent> & {
|
|
3625
|
+
maxHeight?: number;
|
|
3626
|
+
};
|
|
3627
|
+
declare const StackTraceContent: react.MemoExoticComponent<({ className, maxHeight, children, ...props }: StackTraceContentProps) => react.JSX.Element>;
|
|
3628
|
+
type StackTraceFramesProps = ComponentProps<"div"> & {
|
|
3629
|
+
showInternalFrames?: boolean;
|
|
3630
|
+
};
|
|
3631
|
+
declare const StackTraceFrames: react.MemoExoticComponent<({ className, showInternalFrames, ...props }: StackTraceFramesProps) => react.JSX.Element>;
|
|
3632
|
+
|
|
3633
|
+
type SuggestionsProps = ComponentProps<typeof ScrollArea>;
|
|
3634
|
+
declare const Suggestions: ({ className, children, ...props }: SuggestionsProps) => react.JSX.Element;
|
|
3635
|
+
type SuggestionProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
|
|
3636
|
+
suggestion: string;
|
|
3637
|
+
onClick?: (suggestion: string) => void;
|
|
3638
|
+
};
|
|
3639
|
+
declare const Suggestion: ({ suggestion, onClick, className, variant, size, children, ...props }: SuggestionProps) => react.JSX.Element;
|
|
3640
|
+
type SuggestionLoadingProps = HTMLAttributes<HTMLDivElement> & {
|
|
3641
|
+
/** Shimmering label shown while the suggestion set is still generating. */
|
|
3642
|
+
label?: string;
|
|
3643
|
+
};
|
|
3644
|
+
/**
|
|
3645
|
+
* A non-interactive trailing chip that shimmers while suggestions stream in.
|
|
3646
|
+
* Shaped like a `Suggestion` pill; composes `Shimmer` (motion-reduce aware) and
|
|
3647
|
+
* announces via `role="status"`. Render it after the chips while loading.
|
|
3648
|
+
*/
|
|
3649
|
+
declare const SuggestionLoading: ({ label, className, ...props }: SuggestionLoadingProps) => react.JSX.Element;
|
|
3650
|
+
type StreamingSuggestionsProps = Omit<SuggestionsProps, "children"> & {
|
|
3651
|
+
/** The suggestions to render. As this array grows, new chips appear in place. */
|
|
3652
|
+
suggestions: string[];
|
|
3653
|
+
/** While true, a shimmering trailing chip is shown until the set settles. */
|
|
3654
|
+
loading?: boolean;
|
|
3655
|
+
/** Click handler for a suggestion chip. */
|
|
3656
|
+
onSuggestionClick?: (suggestion: string) => void;
|
|
3657
|
+
/** Label for the trailing loading chip. @default "Thinking…" */
|
|
3658
|
+
loadingLabel?: string;
|
|
3659
|
+
};
|
|
3660
|
+
/**
|
|
3661
|
+
* Suggestions that appear progressively while a generator streams. Each chip
|
|
3662
|
+
* fades in on mount (existing chips don't re-animate — keys are the suggestion
|
|
3663
|
+
* text); a shimmering trailing chip shows until `loading` flips false.
|
|
3664
|
+
*/
|
|
3665
|
+
declare const StreamingSuggestions: ({ suggestions, loading, onSuggestionClick, loadingLabel, ...props }: StreamingSuggestionsProps) => react.JSX.Element;
|
|
3666
|
+
|
|
3667
|
+
type TaskItemFileProps = ComponentProps<"span">;
|
|
3668
|
+
/**
|
|
3669
|
+
* A quiet inline file chip. Unbordered since #192 (the fill is the gesture;
|
|
3670
|
+
* a border on a filled chip is the redundant-border anti-pattern). For a
|
|
3671
|
+
* navigable list of produced files, prefer the asset-tree idiom (research 09).
|
|
3672
|
+
*/
|
|
3673
|
+
declare const TaskItemFile: ({ children, className, ...props }: TaskItemFileProps) => react.JSX.Element;
|
|
3674
|
+
type TaskItemProps = Omit<AgentStepProps, "name" | "children"> & {
|
|
3675
|
+
children?: ReactNode;
|
|
3676
|
+
};
|
|
3677
|
+
/**
|
|
3678
|
+
* One line of the run summary — an `AgentStep` on the canonical rail.
|
|
3679
|
+
* Defaults to `status="complete"` (the task reports finished work) with the
|
|
3680
|
+
* badge hidden (the rail node carries the status; a badge per log line would
|
|
3681
|
+
* shout).
|
|
3682
|
+
*/
|
|
3683
|
+
declare const TaskItem: ({ children, status, hideBadge, ...props }: TaskItemProps) => react.JSX.Element;
|
|
3684
|
+
type TaskProps = ComponentProps<typeof Collapsible>;
|
|
3685
|
+
/** Collapsed by default since #192 (`defaultOpen` flipped `true`→`false`). */
|
|
3686
|
+
declare const Task: ({ className, ...props }: TaskProps) => react.JSX.Element;
|
|
3687
|
+
type TaskTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
3688
|
+
title: string;
|
|
3689
|
+
};
|
|
3690
|
+
declare const TaskTrigger: ({ children, className, title, ...props }: TaskTriggerProps) => react.JSX.Element;
|
|
3691
|
+
type TaskContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3692
|
+
declare const TaskContent: ({ children, className, ...props }: TaskContentProps) => react.JSX.Element;
|
|
3693
|
+
|
|
3694
|
+
type TerminalHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
3695
|
+
declare const TerminalHeader: ({ className, children, ...props }: TerminalHeaderProps) => react.JSX.Element;
|
|
3696
|
+
type TerminalTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
3697
|
+
declare const TerminalTitle: ({ className, children, ...props }: TerminalTitleProps) => react.JSX.Element;
|
|
3698
|
+
type TerminalStatusProps = HTMLAttributes<HTMLDivElement>;
|
|
3699
|
+
declare const TerminalStatus: ({ className, children, ...props }: TerminalStatusProps) => react.JSX.Element | null;
|
|
3700
|
+
type TerminalActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
3701
|
+
declare const TerminalActions: ({ className, children, ...props }: TerminalActionsProps) => react.JSX.Element;
|
|
3702
|
+
type TerminalCopyButtonProps = ComponentProps<typeof Button> & {
|
|
3703
|
+
onCopy?: () => void;
|
|
3704
|
+
onError?: (error: Error) => void;
|
|
3705
|
+
timeout?: number;
|
|
3706
|
+
};
|
|
3707
|
+
declare const TerminalCopyButton: ({ onCopy, onError, timeout, children, className, ...props }: TerminalCopyButtonProps) => react.JSX.Element;
|
|
3708
|
+
type TerminalClearButtonProps = ComponentProps<typeof Button>;
|
|
3709
|
+
declare const TerminalClearButton: ({ children, className, ...props }: TerminalClearButtonProps) => react.JSX.Element | null;
|
|
3710
|
+
type TerminalContentProps = HTMLAttributes<HTMLDivElement>;
|
|
3711
|
+
declare const TerminalContent: ({ className, children, ...props }: TerminalContentProps) => react.JSX.Element;
|
|
3712
|
+
type TerminalProps = HTMLAttributes<HTMLDivElement> & {
|
|
3713
|
+
output: string;
|
|
3714
|
+
isStreaming?: boolean;
|
|
3715
|
+
autoScroll?: boolean;
|
|
3716
|
+
onClear?: () => void;
|
|
3717
|
+
};
|
|
3718
|
+
declare const Terminal: ({ output, isStreaming, autoScroll, onClear, className, children, ...props }: TerminalProps) => react.JSX.Element;
|
|
3719
|
+
|
|
3720
|
+
type TestResultsHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
3721
|
+
declare const TestResultsHeader: ({ className, children, ...props }: TestResultsHeaderProps) => react.JSX.Element;
|
|
3722
|
+
type TestResultsDurationProps = HTMLAttributes<HTMLSpanElement>;
|
|
3723
|
+
declare const TestResultsDuration: ({ className, children, ...props }: TestResultsDurationProps) => react.JSX.Element | null;
|
|
3724
|
+
type TestResultsSummaryProps = HTMLAttributes<HTMLDivElement>;
|
|
3725
|
+
interface TestResultsSummary {
|
|
3726
|
+
passed: number;
|
|
3727
|
+
failed: number;
|
|
3728
|
+
skipped: number;
|
|
3729
|
+
total: number;
|
|
3730
|
+
duration?: number;
|
|
3731
|
+
}
|
|
3732
|
+
declare const TestResultsSummary: ({ className, children, ...props }: TestResultsSummaryProps) => react.JSX.Element | null;
|
|
3733
|
+
type TestResultsProps = HTMLAttributes<HTMLDivElement> & {
|
|
3734
|
+
summary?: TestResultsSummary;
|
|
3735
|
+
};
|
|
3736
|
+
declare const TestResults: ({ summary, className, children, ...props }: TestResultsProps) => react.JSX.Element;
|
|
3737
|
+
type TestResultsProgressProps = HTMLAttributes<HTMLDivElement>;
|
|
3738
|
+
declare const TestResultsProgress: ({ className, children, ...props }: TestResultsProgressProps) => react.JSX.Element | null;
|
|
3739
|
+
/**
|
|
3740
|
+
* TestResultsMeta — the summary badges + progress bar block that sits between
|
|
3741
|
+
* the header and the suite list. Provides consistent `px-4 pt-3 pb-4` padding
|
|
3742
|
+
* so callers do not need ad-hoc wrapper divs.
|
|
3743
|
+
*/
|
|
3744
|
+
type TestResultsMetaProps = HTMLAttributes<HTMLDivElement>;
|
|
3745
|
+
declare const TestResultsMeta: ({ className, children, ...props }: TestResultsMetaProps) => react.JSX.Element;
|
|
3746
|
+
/**
|
|
3747
|
+
* TestResultsContent — the suite list. Uses `divide-y` instead of `space-y`
|
|
3748
|
+
* so suites are separated by a single structural divider, not nested boxes.
|
|
3749
|
+
*/
|
|
3750
|
+
type TestResultsContentProps = HTMLAttributes<HTMLDivElement>;
|
|
3751
|
+
declare const TestResultsContent: ({ className, children, ...props }: TestResultsContentProps) => react.JSX.Element;
|
|
3752
|
+
type TestSuiteProps = ComponentProps<typeof Collapsible> & {
|
|
3753
|
+
name: string;
|
|
3754
|
+
status: TestStatus;
|
|
3755
|
+
};
|
|
3756
|
+
/**
|
|
3757
|
+
* TestSuite — one expandable file/suite row. Uses a quiet left rail
|
|
3758
|
+
* (`border-s-2`) as the sole focal separation gesture inside the divider-
|
|
3759
|
+
* separated list. No nested rounded box: that was redundant border-on-region
|
|
3760
|
+
* with no fill change (separation grammar).
|
|
3761
|
+
*/
|
|
3762
|
+
declare const TestSuite: ({ name, status, className, children, ...props }: TestSuiteProps) => react.JSX.Element;
|
|
3763
|
+
type TestSuiteNameProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
3764
|
+
declare const TestSuiteName: ({ className, children, ...props }: TestSuiteNameProps) => react.JSX.Element;
|
|
3765
|
+
type TestSuiteStatsProps = HTMLAttributes<HTMLDivElement> & {
|
|
3766
|
+
passed?: number;
|
|
3767
|
+
failed?: number;
|
|
3768
|
+
skipped?: number;
|
|
3769
|
+
};
|
|
3770
|
+
declare const TestSuiteStats: ({ passed, failed, skipped, className, children, ...props }: TestSuiteStatsProps) => react.JSX.Element;
|
|
3771
|
+
type TestSuiteContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3772
|
+
/**
|
|
3773
|
+
* TestSuiteContent — the rows inside an expanded suite. A left rail
|
|
3774
|
+
* (`border-s-2 border-s-border ms-6`) indents the block under the suite
|
|
3775
|
+
* trigger and separates it structurally without a box. Rows are divided by
|
|
3776
|
+
* `divide-y`.
|
|
3777
|
+
*/
|
|
3778
|
+
declare const TestSuiteContent: ({ className, children, ...props }: TestSuiteContentProps) => react.JSX.Element;
|
|
3779
|
+
type TestNameProps = HTMLAttributes<HTMLSpanElement>;
|
|
3780
|
+
declare const TestName: ({ className, children, ...props }: TestNameProps) => react.JSX.Element;
|
|
3781
|
+
type TestDurationProps = HTMLAttributes<HTMLSpanElement>;
|
|
3782
|
+
declare const TestDuration: ({ className, children, ...props }: TestDurationProps) => react.JSX.Element | null;
|
|
3783
|
+
type TestStatusProps = HTMLAttributes<HTMLSpanElement>;
|
|
3784
|
+
type TestStatus = "passed" | "failed" | "skipped" | "running";
|
|
3785
|
+
declare const TestStatus: ({ className, children, ...props }: TestStatusProps) => react.JSX.Element;
|
|
3786
|
+
type TestProps = HTMLAttributes<HTMLDivElement> & {
|
|
3787
|
+
name: string;
|
|
3788
|
+
status: TestStatus;
|
|
3789
|
+
duration?: number;
|
|
3790
|
+
};
|
|
3791
|
+
/**
|
|
3792
|
+
* Test — a single test-case row. `ps-10` aligns the status icon with the
|
|
3793
|
+
* suite's status icon (after the trigger's chevron + gap), giving a clean
|
|
3794
|
+
* left-column across the expansion.
|
|
3795
|
+
*/
|
|
3796
|
+
declare const Test: ({ name, status, duration, className, children, ...props }: TestProps) => react.JSX.Element;
|
|
3797
|
+
type TestErrorProps = HTMLAttributes<HTMLDivElement>;
|
|
3798
|
+
declare const TestError: ({ className, children, ...props }: TestErrorProps) => react.JSX.Element;
|
|
3799
|
+
type TestErrorMessageProps = HTMLAttributes<HTMLParagraphElement>;
|
|
3800
|
+
declare const TestErrorMessage: ({ className, children, ...props }: TestErrorMessageProps) => react.JSX.Element;
|
|
3801
|
+
type TestErrorStackProps = HTMLAttributes<HTMLPreElement>;
|
|
3802
|
+
declare const TestErrorStack: ({ className, children, ...props }: TestErrorStackProps) => react.JSX.Element;
|
|
3803
|
+
|
|
3804
|
+
type ToolProps = ComponentProps<typeof Collapsible>;
|
|
3805
|
+
declare const Tool: ({ className, ...props }: ToolProps) => react.JSX.Element;
|
|
3806
|
+
type ToolPart = ToolUIPart | DynamicToolUIPart;
|
|
3807
|
+
type ToolHeaderProps = {
|
|
3808
|
+
title?: string;
|
|
3809
|
+
/**
|
|
3810
|
+
* The business summary line ("3 documents found", "8 rows reconciled"),
|
|
3811
|
+
* shown beside the name + StatusBadge (#192, research 10 §B.5). Falls back
|
|
3812
|
+
* to nothing — the derived tool name still labels the row.
|
|
3813
|
+
*/
|
|
3814
|
+
summary?: ReactNode;
|
|
3815
|
+
className?: string;
|
|
3816
|
+
} & ({
|
|
3817
|
+
type: ToolUIPart["type"];
|
|
3818
|
+
state: ToolUIPart["state"];
|
|
3819
|
+
toolName?: never;
|
|
3820
|
+
} | {
|
|
3821
|
+
type: DynamicToolUIPart["type"];
|
|
3822
|
+
state: DynamicToolUIPart["state"];
|
|
3823
|
+
toolName: string;
|
|
3824
|
+
});
|
|
3825
|
+
/**
|
|
3826
|
+
* Map the AI-SDK `ToolUIPart` 7-state machine onto the canonical `Status`
|
|
3827
|
+
* enum (#189, research 10 §B.1 mapping a). Lives here — not in `@elabs-ai/components-ui` —
|
|
3828
|
+
* because it is typed against the SDK union; the `ai` import stays TYPES-ONLY
|
|
3829
|
+
* (D6, gate-enforced by `pnpm ai:types-only`).
|
|
3830
|
+
*/
|
|
3831
|
+
declare const statusFromToolState: (state: ToolPart["state"]) => Status;
|
|
3832
|
+
/** Same signature as before #189; renders the canonical StatusBadge. */
|
|
3833
|
+
declare const getStatusBadge: (status: ToolPart["state"]) => react.JSX.Element;
|
|
3834
|
+
declare const ToolHeader: ({ className, title, summary, type, state, toolName, ...props }: ToolHeaderProps) => react.JSX.Element;
|
|
3835
|
+
type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
3836
|
+
declare const ToolContent: ({ className, ...props }: ToolContentProps) => react.JSX.Element;
|
|
3837
|
+
type ToolDetailsProps = ComponentProps<typeof Collapsible> & {
|
|
3838
|
+
/** The disclosure label. */
|
|
3839
|
+
label?: ReactNode;
|
|
3840
|
+
};
|
|
3841
|
+
/**
|
|
3842
|
+
* The technical view, behind disclosure — the PACKAGE DEFAULT for tool JSON
|
|
3843
|
+
* (#192, research 10 §B.5): a nested collapsible, COLLAPSED by default,
|
|
3844
|
+
* holding `ToolInput`/`ToolOutput`. The header carries the business `summary`;
|
|
3845
|
+
* the raw payload is one expand away, never the headline.
|
|
3846
|
+
*/
|
|
3847
|
+
declare const ToolDetails: ({ className, label, defaultOpen, children, ...props }: ToolDetailsProps) => react.JSX.Element;
|
|
3848
|
+
type ToolInputProps = ComponentProps<"div"> & {
|
|
3849
|
+
input: ToolPart["input"];
|
|
3850
|
+
};
|
|
3851
|
+
declare const ToolInput: ({ className, input, ...props }: ToolInputProps) => react.JSX.Element;
|
|
3852
|
+
type ToolOutputProps = ComponentProps<"div"> & {
|
|
3853
|
+
/**
|
|
3854
|
+
* The tool result. Objects/strings render as JSON inside the technical view.
|
|
3855
|
+
*
|
|
3856
|
+
* @deprecated Passing a pre-rendered **React element** here (the "rich
|
|
3857
|
+
* output under a muted Result heading" path) is deprecated since #192
|
|
3858
|
+
* (research 10 §B.5): a produced artifact is the HEADLINE, not a technical
|
|
3859
|
+
* detail — host it in a `<ToolResultCard>` and keep `ToolOutput` for the
|
|
3860
|
+
* JSON payload behind `<ToolDetails>`. The element path still renders for
|
|
3861
|
+
* existing consumers (e.g. the copy-owned `ai-chart` registry block) but
|
|
3862
|
+
* will be removed in a future release.
|
|
3863
|
+
*/
|
|
3864
|
+
output: ToolPart["output"];
|
|
3865
|
+
errorText: ToolPart["errorText"];
|
|
3866
|
+
/**
|
|
3867
|
+
* The call has not produced output yet (loading-states.md `isStreaming`) —
|
|
3868
|
+
* derive it from the existing `statusFromToolState(state)` mapping
|
|
3869
|
+
* (`"input-streaming"`/`"input-available"` → not yet `"complete"`/`"failed"`)
|
|
3870
|
+
* rather than a second source of truth. While true and no `output`/
|
|
3871
|
+
* `errorText` has arrived, renders a layout-shaped skeleton in the Result
|
|
3872
|
+
* slot instead of `null`, so the technical view reserves its space. A
|
|
3873
|
+
* still-running call is never a terminal failure — the error branch is
|
|
3874
|
+
* suppressed while `isStreaming` per the loading-states.md error rule, even
|
|
3875
|
+
* if a stale `errorText` is still set from a previous render.
|
|
3876
|
+
* @default false
|
|
3877
|
+
*/
|
|
3878
|
+
isStreaming?: boolean;
|
|
3879
|
+
};
|
|
3880
|
+
declare const ToolOutput: ({ className, output, errorText, isStreaming, ...props }: ToolOutputProps) => react.JSX.Element | null;
|
|
3881
|
+
|
|
3882
|
+
interface ToolResultCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3883
|
+
/** Headline of the produced artifact (`text-subtitle`). */
|
|
3884
|
+
title?: ReactNode;
|
|
3885
|
+
/** The business summary line under the title (`text-meta`), not JSON. */
|
|
3886
|
+
summary?: ReactNode;
|
|
3887
|
+
/** Canonical execution status (closed enum); renders a `StatusBadge`. */
|
|
3888
|
+
status?: Status;
|
|
3889
|
+
/**
|
|
3890
|
+
* Controls scoped to the whole artifact — expand, download, open. Rendered in
|
|
3891
|
+
* the header row between the title and the status.
|
|
3892
|
+
*
|
|
3893
|
+
* A `ReactNode` slot, not a `role="toolbar"`: that role promises roving-tabindex
|
|
3894
|
+
* traversal, which this row does not implement. Keep the payload's own controls
|
|
3895
|
+
* out of here (see the note at the top of this file).
|
|
3896
|
+
*/
|
|
3897
|
+
actions?: ReactNode;
|
|
3898
|
+
/**
|
|
3899
|
+
* The technical view, kept behind disclosure — pass a default-collapsed
|
|
3900
|
+
* `<ToolDetails>` holding `ToolInput`/`ToolOutput` (research 10 §B.5).
|
|
3901
|
+
*/
|
|
3902
|
+
details?: ReactNode;
|
|
3903
|
+
}
|
|
3904
|
+
/** The produced artifact IS the headline; pass it as `children`. */
|
|
3905
|
+
declare const ToolResultCard: react.ForwardRefExoticComponent<ToolResultCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
3906
|
+
|
|
3907
|
+
type NodeToolbarProps = ComponentProps<typeof NodeToolbar$1>;
|
|
3908
|
+
/**
|
|
3909
|
+
* The floating control strip attached to a selected canvas NODE — it portals out
|
|
3910
|
+
* of the node and follows it, and it is meaningless outside a `<Canvas>`.
|
|
3911
|
+
*
|
|
3912
|
+
* Named `NodeToolbar` (after the React Flow primitive it wraps) because
|
|
3913
|
+
* `Toolbar` now means the general-purpose WAI-ARIA toolbar in
|
|
3914
|
+
* `@elabs-ai/components-ui`: a keyboard row with a roving tabindex.
|
|
3915
|
+
* The two solve unrelated problems, and the collision made "use the Toolbar"
|
|
3916
|
+
* ambiguous at every call site.
|
|
3917
|
+
*/
|
|
3918
|
+
declare const NodeToolbar: (props: NodeToolbarProps) => react.JSX.Element;
|
|
3919
|
+
/**
|
|
3920
|
+
* @deprecated Renamed to {@link NodeToolbar}. `Toolbar` is now the WAI-ARIA
|
|
3921
|
+
* toolbar in `@elabs-ai/components-ui`. This alias will be removed in
|
|
3922
|
+
* the next major.
|
|
3923
|
+
*/
|
|
3924
|
+
declare const Toolbar: (props: NodeToolbarProps) => react.JSX.Element;
|
|
3925
|
+
/** @deprecated Renamed to {@link NodeToolbarProps}. */
|
|
3926
|
+
type ToolbarProps = NodeToolbarProps;
|
|
3927
|
+
|
|
3928
|
+
type TranscriptionProps = Omit<ComponentProps<"div">, "children"> & {
|
|
3929
|
+
segments: TranscriptionSegment[];
|
|
3930
|
+
currentTime?: number;
|
|
3931
|
+
onSeek?: (time: number) => void;
|
|
3932
|
+
children: (segment: TranscriptionSegment, index: number) => ReactNode;
|
|
3933
|
+
};
|
|
3934
|
+
declare const Transcription: ({ segments, currentTime: externalCurrentTime, onSeek, className, children, ...props }: TranscriptionProps) => react.JSX.Element;
|
|
3935
|
+
type TranscriptionSegmentProps = ComponentProps<"button"> & {
|
|
3936
|
+
segment: TranscriptionSegment;
|
|
3937
|
+
index: number;
|
|
3938
|
+
};
|
|
3939
|
+
type TranscriptionSegment = Experimental_TranscriptionResult["segments"][number];
|
|
3940
|
+
declare const TranscriptionSegment: ({ segment, index, className, onClick, ...props }: TranscriptionSegmentProps) => react.JSX.Element;
|
|
3941
|
+
|
|
3942
|
+
interface VoiceSelectorContextValue {
|
|
3943
|
+
value: string | undefined;
|
|
3944
|
+
setValue: (value: string | undefined) => void;
|
|
3945
|
+
open: boolean;
|
|
3946
|
+
setOpen: (open: boolean) => void;
|
|
3947
|
+
}
|
|
3948
|
+
declare const useVoiceSelector: () => VoiceSelectorContextValue;
|
|
3949
|
+
type VoiceSelectorProps = ComponentProps<typeof Dialog> & {
|
|
3950
|
+
value?: string;
|
|
3951
|
+
defaultValue?: string;
|
|
3952
|
+
onValueChange?: (value: string | undefined) => void;
|
|
3953
|
+
};
|
|
3954
|
+
declare const VoiceSelector: ({ value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, children, ...props }: VoiceSelectorProps) => react.JSX.Element;
|
|
3955
|
+
type VoiceSelectorTriggerProps = ComponentProps<typeof DialogTrigger>;
|
|
3956
|
+
declare const VoiceSelectorTrigger: (props: VoiceSelectorTriggerProps) => react.JSX.Element;
|
|
3957
|
+
type VoiceSelectorContentProps = ComponentProps<typeof DialogContent> & {
|
|
3958
|
+
title?: ReactNode;
|
|
3959
|
+
};
|
|
3960
|
+
declare const VoiceSelectorContent: ({ className, children, title, ...props }: VoiceSelectorContentProps) => react.JSX.Element;
|
|
3961
|
+
type VoiceSelectorDialogProps = ComponentProps<typeof CommandDialog>;
|
|
3962
|
+
declare const VoiceSelectorDialog: (props: VoiceSelectorDialogProps) => react.JSX.Element;
|
|
3963
|
+
type VoiceSelectorInputProps = ComponentProps<typeof CommandInput>;
|
|
3964
|
+
declare const VoiceSelectorInput: ({ className, ...props }: VoiceSelectorInputProps) => react.JSX.Element;
|
|
3965
|
+
type VoiceSelectorListProps = ComponentProps<typeof CommandList>;
|
|
3966
|
+
declare const VoiceSelectorList: (props: VoiceSelectorListProps) => react.JSX.Element;
|
|
3967
|
+
type VoiceSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
3968
|
+
declare const VoiceSelectorEmpty: (props: VoiceSelectorEmptyProps) => react.JSX.Element;
|
|
3969
|
+
type VoiceSelectorGroupProps = ComponentProps<typeof CommandGroup>;
|
|
3970
|
+
declare const VoiceSelectorGroup: (props: VoiceSelectorGroupProps) => react.JSX.Element;
|
|
3971
|
+
type VoiceSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
3972
|
+
declare const VoiceSelectorItem: ({ className, ...props }: VoiceSelectorItemProps) => react.JSX.Element;
|
|
3973
|
+
type VoiceSelectorShortcutProps = ComponentProps<typeof CommandShortcut>;
|
|
3974
|
+
declare const VoiceSelectorShortcut: (props: VoiceSelectorShortcutProps) => react.JSX.Element;
|
|
3975
|
+
type VoiceSelectorSeparatorProps = ComponentProps<typeof CommandSeparator>;
|
|
3976
|
+
declare const VoiceSelectorSeparator: (props: VoiceSelectorSeparatorProps) => react.JSX.Element;
|
|
3977
|
+
type VoiceSelectorGenderProps = ComponentProps<"span"> & {
|
|
3978
|
+
value?: "male" | "female" | "transgender" | "androgyne" | "non-binary" | "intersex";
|
|
3979
|
+
};
|
|
3980
|
+
declare const VoiceSelectorGender: ({ className, value, children, ...props }: VoiceSelectorGenderProps) => react.JSX.Element;
|
|
3981
|
+
type VoiceSelectorAccentProps = ComponentProps<"span"> & {
|
|
3982
|
+
value?: "american" | "british" | "australian" | "canadian" | "irish" | "scottish" | "indian" | "south-african" | "new-zealand" | "spanish" | "french" | "german" | "italian" | "portuguese" | "brazilian" | "mexican" | "argentinian" | "japanese" | "chinese" | "korean" | "russian" | "arabic" | "dutch" | "swedish" | "norwegian" | "danish" | "finnish" | "polish" | "turkish" | "greek" | string;
|
|
3983
|
+
};
|
|
3984
|
+
declare const VoiceSelectorAccent: ({ className, value, children, ...props }: VoiceSelectorAccentProps) => react.JSX.Element;
|
|
3985
|
+
type VoiceSelectorAgeProps = ComponentProps<"span">;
|
|
3986
|
+
declare const VoiceSelectorAge: ({ className, ...props }: VoiceSelectorAgeProps) => react.JSX.Element;
|
|
3987
|
+
type VoiceSelectorNameProps = ComponentProps<"span">;
|
|
3988
|
+
declare const VoiceSelectorName: ({ className, ...props }: VoiceSelectorNameProps) => react.JSX.Element;
|
|
3989
|
+
type VoiceSelectorDescriptionProps = ComponentProps<"span">;
|
|
3990
|
+
declare const VoiceSelectorDescription: ({ className, ...props }: VoiceSelectorDescriptionProps) => react.JSX.Element;
|
|
3991
|
+
type VoiceSelectorAttributesProps = ComponentProps<"div">;
|
|
3992
|
+
declare const VoiceSelectorAttributes: ({ className, children, ...props }: VoiceSelectorAttributesProps) => react.JSX.Element;
|
|
3993
|
+
type VoiceSelectorBulletProps = ComponentProps<"span">;
|
|
3994
|
+
declare const VoiceSelectorBullet: ({ className, ...props }: VoiceSelectorBulletProps) => react.JSX.Element;
|
|
3995
|
+
type VoiceSelectorPreviewProps = Omit<ComponentProps<"button">, "children"> & {
|
|
3996
|
+
playing?: boolean;
|
|
3997
|
+
loading?: boolean;
|
|
3998
|
+
onPlay?: () => void;
|
|
3999
|
+
};
|
|
4000
|
+
declare const VoiceSelectorPreview: ({ className, playing, loading, onPlay, onClick, ...props }: VoiceSelectorPreviewProps) => react.JSX.Element;
|
|
4001
|
+
|
|
4002
|
+
interface WebPreviewContextValue {
|
|
4003
|
+
url: string;
|
|
4004
|
+
setUrl: (url: string) => void;
|
|
4005
|
+
consoleOpen: boolean;
|
|
4006
|
+
setConsoleOpen: (open: boolean) => void;
|
|
4007
|
+
}
|
|
4008
|
+
type WebPreviewProps = ComponentProps<"div"> & {
|
|
4009
|
+
defaultUrl?: string;
|
|
4010
|
+
onUrlChange?: (url: string) => void;
|
|
4011
|
+
};
|
|
4012
|
+
declare const WebPreview: ({ className, children, defaultUrl, onUrlChange, ...props }: WebPreviewProps) => react.JSX.Element;
|
|
4013
|
+
type WebPreviewNavigationProps = ComponentProps<"div">;
|
|
4014
|
+
declare const WebPreviewNavigation: ({ className, children, ...props }: WebPreviewNavigationProps) => react.JSX.Element;
|
|
4015
|
+
type WebPreviewNavigationButtonProps = ComponentProps<typeof Button> & {
|
|
4016
|
+
tooltip?: string;
|
|
4017
|
+
};
|
|
4018
|
+
declare const WebPreviewNavigationButton: ({ onClick, disabled, tooltip, children, ...props }: WebPreviewNavigationButtonProps) => react.JSX.Element;
|
|
4019
|
+
type WebPreviewUrlProps = ComponentProps<typeof Input>;
|
|
4020
|
+
declare const WebPreviewUrl: ({ value, onChange, onKeyDown, ...props }: WebPreviewUrlProps) => react.JSX.Element;
|
|
4021
|
+
type WebPreviewBodyProps = Omit<ComponentProps<"iframe">, "loading"> & {
|
|
4022
|
+
/**
|
|
4023
|
+
* Not-ready placeholder over the iframe (loading-states.md `loading`
|
|
4024
|
+
* signal). Pass `true` for the default layout-shaped Skeleton filling the
|
|
4025
|
+
* iframe box, or a ReactNode to override with custom placeholder content.
|
|
4026
|
+
* `false`/`undefined` (default) renders nothing. Shadows (rather than
|
|
4027
|
+
* forwards) the native `<iframe loading="eager"|"lazy">` attribute — this
|
|
4028
|
+
* component's box is always fully reserved, so lazy-loading the iframe
|
|
4029
|
+
* itself is not a use case here.
|
|
4030
|
+
* @default false
|
|
4031
|
+
*/
|
|
4032
|
+
loading?: boolean | ReactNode;
|
|
4033
|
+
};
|
|
4034
|
+
declare const WebPreviewBody: ({ className, loading, src, ...props }: WebPreviewBodyProps) => react.JSX.Element;
|
|
4035
|
+
type WebPreviewConsoleProps = ComponentProps<"div"> & {
|
|
4036
|
+
logs?: {
|
|
4037
|
+
level: "log" | "warn" | "error";
|
|
4038
|
+
message: string;
|
|
4039
|
+
timestamp: Date;
|
|
4040
|
+
}[];
|
|
4041
|
+
};
|
|
4042
|
+
declare const WebPreviewConsole: ({ className, logs, children, ...props }: WebPreviewConsoleProps) => react.JSX.Element;
|
|
4043
|
+
|
|
4044
|
+
interface ChatShellProps {
|
|
4045
|
+
/** Scrollable transcript — typically a <Conversation>. */
|
|
4046
|
+
children: ReactNode;
|
|
4047
|
+
/** Sticky composer — typically a <Composer> (the standard chat input). */
|
|
4048
|
+
composer?: ReactNode;
|
|
4049
|
+
/** Optional header row (title, model picker, actions). */
|
|
4050
|
+
header?: ReactNode;
|
|
4051
|
+
/** Optional right-side context rail (sources, files, memory). */
|
|
4052
|
+
aside?: ReactNode;
|
|
4053
|
+
/**
|
|
4054
|
+
* Layout treatment:
|
|
4055
|
+
* - `"card"` (default) — a self-contained rounded, bordered chat card. Use
|
|
4056
|
+
* when the shell sits on a page among other content and needs its own frame.
|
|
4057
|
+
* - `"bare"` — an immersive pane that fills its container with NO frame: the
|
|
4058
|
+
* transcript fades under the header and above the composer (a token-driven
|
|
4059
|
+
* top/bottom scrim) and the composer floats on the pane background instead
|
|
4060
|
+
* of a hard bordered bar. Use when the shell already lives inside a bounded
|
|
4061
|
+
* region (an AppShell `SidebarInset`, a full-page workspace) so it doesn't
|
|
4062
|
+
* draw a redundant second frame.
|
|
4063
|
+
*/
|
|
4064
|
+
variant?: "card" | "bare";
|
|
4065
|
+
className?: string;
|
|
4066
|
+
}
|
|
4067
|
+
/**
|
|
4068
|
+
* Layout shell for an AI chat built from the AI Elements: a header, a scrollable
|
|
4069
|
+
* transcript (give it a <Conversation>, which is `flex-1`), a sticky composer
|
|
4070
|
+
* (a <Composer>, the standard chat input), and an optional context rail. Fills
|
|
4071
|
+
* its parent's height.
|
|
4072
|
+
*
|
|
4073
|
+
* Two layout modes (`variant`): a framed `"card"` for in-page use, and a
|
|
4074
|
+
* frameless `"bare"` immersive pane for when the shell already sits inside a
|
|
4075
|
+
* bounded region and a second frame would just read as boxy.
|
|
4076
|
+
*/
|
|
4077
|
+
declare function ChatShell({ children, composer, header, aside, variant, className, }: ChatShellProps): react.JSX.Element;
|
|
4078
|
+
|
|
4079
|
+
export { Agent, AgentContent, type AgentContentProps, AgentHeader, type AgentHeaderProps, AgentInstructions, type AgentInstructionsProps, AgentMessage, type AgentMessageEmphasis, type AgentMessageProps, AgentOutput, type AgentOutputProps, type AgentProps, AgentStep, type AgentStepProps, AgentTimeline, type AgentTimelineProps, AgentTool, type AgentToolProps, AgentTools, type AgentToolsProps, ApprovalCard, ApprovalCardAccepted, type ApprovalCardAcceptedProps, ApprovalCardAction, type ApprovalCardActionProps, ApprovalCardActions, type ApprovalCardActionsProps, ApprovalCardApprove, type ApprovalCardApproveProps, ApprovalCardDeny, type ApprovalCardDenyProps, ApprovalCardDescription, type ApprovalCardDescriptionProps, type ApprovalCardProps, ApprovalCardRejected, type ApprovalCardRejectedProps, ApprovalCardRequest, type ApprovalCardRequestProps, ApprovalCardTitle, type ApprovalCardTitleProps, Artifact, ArtifactAction, type ArtifactActionProps, ArtifactActions, type ArtifactActionsProps, ArtifactClose, type ArtifactCloseProps, ArtifactContent, type ArtifactContentProps, ArtifactDescription, type ArtifactDescriptionProps, ArtifactHeader, type ArtifactHeaderProps, type ArtifactProps, ArtifactTitle, type ArtifactTitleProps, AssetPreview, type AssetPreviewMode, type AssetPreviewProps, type AssetPreviewRenderer, Attachment, type AttachmentData, AttachmentEmpty, type AttachmentEmptyProps, AttachmentHoverCard, AttachmentHoverCardContent, type AttachmentHoverCardContentProps, type AttachmentHoverCardProps, AttachmentHoverCardTrigger, type AttachmentHoverCardTriggerProps, AttachmentInfo, type AttachmentInfoProps, type AttachmentMediaCategory, AttachmentPreview, type AttachmentPreviewProps, type AttachmentProps, AttachmentRemove, type AttachmentRemoveProps, type AttachmentVariant, Attachments, type AttachmentsContext, type AttachmentsProps, AudioPlayer, AudioPlayerControlBar, type AudioPlayerControlBarProps, AudioPlayerDurationDisplay, type AudioPlayerDurationDisplayProps, AudioPlayerElement, type AudioPlayerElementProps, AudioPlayerMuteButton, type AudioPlayerMuteButtonProps, AudioPlayerPlayButton, type AudioPlayerPlayButtonProps, type AudioPlayerProps, AudioPlayerSeekBackwardButton, type AudioPlayerSeekBackwardButtonProps, AudioPlayerSeekForwardButton, type AudioPlayerSeekForwardButtonProps, AudioPlayerTimeDisplay, type AudioPlayerTimeDisplayProps, AudioPlayerTimeRange, type AudioPlayerTimeRangeProps, AudioPlayerVolumeRange, type AudioPlayerVolumeRangeProps, type BadgeTone, type BooleanFieldSpec, BrandMotionConfig, type BrandMotionConfigProps, Canvas, type CanvasProps, type CellFormat, ChainOfThought, ChainOfThoughtContent, type ChainOfThoughtContentProps, ChainOfThoughtHeader, type ChainOfThoughtHeaderProps, ChainOfThoughtImage, type ChainOfThoughtImageProps, type ChainOfThoughtProps, ChainOfThoughtSearchResult, type ChainOfThoughtSearchResultProps, ChainOfThoughtSearchResults, type ChainOfThoughtSearchResultsProps, ChainOfThoughtStep, type ChainOfThoughtStepProps, ChatGreeting, type ChatGreetingProps, ChatShell, type ChatShellProps, Checkpoint, CheckpointIcon, type CheckpointIconProps, type CheckpointProps, CheckpointTrigger, type CheckpointTriggerProps, CodeBlock, CodeBlockActions, CodeBlockContainer, CodeBlockContent, CodeBlockCopyButton, type CodeBlockCopyButtonProps, CodeBlockFilename, CodeBlockHeader, CodeBlockLanguageSelector, CodeBlockLanguageSelectorContent, type CodeBlockLanguageSelectorContentProps, CodeBlockLanguageSelectorItem, type CodeBlockLanguageSelectorItemProps, type CodeBlockLanguageSelectorProps, CodeBlockLanguageSelectorTrigger, type CodeBlockLanguageSelectorTriggerProps, CodeBlockLanguageSelectorValue, type CodeBlockLanguageSelectorValueProps, type CodeBlockProps, CodeBlockTitle, type ColumnSpec, Commit, CommitActions, type CommitActionsProps, CommitAuthor, CommitAuthorAvatar, type CommitAuthorAvatarProps, type CommitAuthorProps, CommitContent, type CommitContentProps, CommitCopyButton, type CommitCopyButtonProps, CommitFile, CommitFileAdditions, type CommitFileAdditionsProps, CommitFileChanges, type CommitFileChangesProps, CommitFileDeletions, type CommitFileDeletionsProps, CommitFileIcon, type CommitFileIconProps, CommitFileInfo, type CommitFileInfoProps, CommitFilePath, type CommitFilePathProps, type CommitFileProps, CommitFileStatus, type CommitFileStatusProps, CommitFiles, type CommitFilesProps, CommitHash, type CommitHashProps, CommitHeader, type CommitHeaderProps, CommitInfo, type CommitInfoProps, CommitMessage, type CommitMessageProps, CommitMetadata, type CommitMetadataProps, type CommitProps, CommitSeparator, type CommitSeparatorProps, CommitTimestamp, type CommitTimestampProps, Composer, type ComposerProps, Confirmation, ConfirmationAccepted, type ConfirmationAcceptedProps, ConfirmationAction, type ConfirmationActionProps, ConfirmationActions, type ConfirmationActionsProps, ConfirmationApprove, type ConfirmationApproveProps, ConfirmationDeny, type ConfirmationDenyProps, ConfirmationDescription, type ConfirmationDescriptionProps, type ConfirmationProps, ConfirmationRejected, type ConfirmationRejectedProps, ConfirmationRequest, type ConfirmationRequestProps, ConfirmationTitle, type ConfirmationTitleProps, Connection, Context, type ContextAsset, type ContextAssetType, ContextCacheUsage, type ContextCacheUsageProps, ContextContent, ContextContentBody, type ContextContentBodyProps, ContextContentFooter, type ContextContentFooterProps, ContextContentHeader, type ContextContentHeaderProps, type ContextContentProps, ContextInputUsage, type ContextInputUsageProps, ContextOutputUsage, type ContextOutputUsageProps, ContextPanel, ContextPanelBody, type ContextPanelBodyProps, type ContextPanelContextValue, ContextPanelDetail, type ContextPanelDetailProps, ContextPanelHeader, type ContextPanelHeaderProps, type ContextPanelProps, ContextPanelProvider, type ContextPanelProviderProps, ContextPanelSection, type ContextPanelSectionProps, ContextPanelTrigger, type ContextPanelTriggerProps, type ContextPanelView, type ContextProps, ContextReasoningUsage, type ContextReasoningUsageProps, ContextTrigger, type ContextTriggerProps, Controls, type ControlsProps, Conversation, ConversationContent, type ConversationContentProps, ConversationDownload, type ConversationDownloadProps, ConversationEmptyState, type ConversationEmptyStateProps, type ConversationProps, ConversationScrollButton, type ConversationScrollButtonProps, EMPTY_CELL, Edge, type EnumFieldSpec, type EnumOption, EnvironmentVariable, EnvironmentVariableCopyButton, type EnvironmentVariableCopyButtonProps, EnvironmentVariableGroup, type EnvironmentVariableGroupProps, EnvironmentVariableName, type EnvironmentVariableNameProps, type EnvironmentVariableProps, EnvironmentVariableRequired, type EnvironmentVariableRequiredProps, EnvironmentVariableValue, type EnvironmentVariableValueProps, EnvironmentVariables, EnvironmentVariablesContent, type EnvironmentVariablesContentProps, EnvironmentVariablesHeader, type EnvironmentVariablesHeaderProps, type EnvironmentVariablesProps, EnvironmentVariablesTitle, type EnvironmentVariablesTitleProps, EnvironmentVariablesToggle, type EnvironmentVariablesToggleProps, EvidenceChip, type EvidenceChipProps, type FeedbackType, type FieldSpec, FileTree, FileTreeActions, type FileTreeActionsProps, FileTreeFile, type FileTreeFileProps, FileTreeFolder, type FileTreeFolderProps, FileTreeIcon, type FileTreeIconProps, FileTreeName, type FileTreeNameProps, type FileTreeProps, type FileTreeVariant, type FormSpec, type FormSubmitState, type FormValue, type FormValues, Gallery, type GalleryImage, type GalleryMetaItem, type GalleryProps, type GetPartStatus, type GroupBy, type GroupByContext, type GroupKey, type GroupPartByTypeOptions, type GroupStatus, type GroupablePart, type GroupedNode, type GroupedPartRenderArgs, type GroupedPartRenderer, GroupedParts, type GroupedPartsProps, Image, type ImageProps, InlineCitation, InlineCitationCard, InlineCitationCardBody, type InlineCitationCardBodyProps, type InlineCitationCardProps, InlineCitationCardTrigger, type InlineCitationCardTriggerProps, InlineCitationCarousel, InlineCitationCarouselContent, type InlineCitationCarouselContentProps, InlineCitationCarouselHeader, type InlineCitationCarouselHeaderProps, InlineCitationCarouselIndex, type InlineCitationCarouselIndexProps, InlineCitationCarouselItem, type InlineCitationCarouselItemProps, InlineCitationCarouselNext, type InlineCitationCarouselNextProps, InlineCitationCarouselPrev, type InlineCitationCarouselPrevProps, type InlineCitationCarouselProps, type InlineCitationProps, InlineCitationQuote, type InlineCitationQuoteProps, InlineCitationSource, type InlineCitationSourceProps, type InlineCitationSourceRef, InlineCitationText, type InlineCitationTextProps, type IntegerFieldSpec, InteractiveTerminal, type InteractiveTerminalHandle, type InteractiveTerminalProps, JSXPreview, JSXPreviewContent, type JSXPreviewContentProps, JSXPreviewError, type JSXPreviewErrorProps, type JSXPreviewProps, JSXPreviewSkeleton, type JSXPreviewSkeletonProps, type JSXPreviewStatus, LocalReferencedSourcesContext, MODEL_SELECTOR_LOGO_BASE_URL, MarkdownView, type MarkdownViewProps, Message, MessageAction, type MessageActionProps, MessageActions, type MessageActionsProps, MessageAvatar, type MessageAvatarProps, MessageBranch, MessageBranchContent, type MessageBranchContentProps, MessageBranchNext, type MessageBranchNextProps, MessageBranchPage, type MessageBranchPageProps, MessageBranchPrevious, type MessageBranchPreviousProps, type MessageBranchProps, MessageBranchSelector, type MessageBranchSelectorProps, MessageContent, type MessageContentProps, MessageEdit, MessageEditContent, type MessageEditContentProps, MessageEditForm, type MessageEditFormProps, type MessageEditProps, MessageEditProvider, type MessageEditProviderProps, MessageEditTrigger, type MessageEditTriggerProps, MessageFeedback, type MessageFeedbackProps, MessageForm, MessageFormDescription, type MessageFormDescriptionProps, MessageFormFallback, type MessageFormFallbackProps, MessageFormField, type MessageFormFieldProps, MessageFormFields, type MessageFormFieldsProps, type MessageFormProps, MessageFormProvider, type MessageFormProviderProps, MessageFormRoot, type MessageFormRootProps, MessageFormSubmit, type MessageFormSubmitProps, MessageFormTitle, type MessageFormTitleProps, MessageHeader, type MessageHeaderProps, type MessageProps, MessageResponse, type MessageResponseProps, MessageTable, MessageTableFallback, type MessageTableFallbackProps, type MessageTableProps, MessageToolbar, type MessageToolbarProps, MicSelector, MicSelectorContent, type MicSelectorContentProps, MicSelectorEmpty, type MicSelectorEmptyProps, MicSelectorInput, type MicSelectorInputProps, MicSelectorItem, type MicSelectorItemProps, MicSelectorLabel, type MicSelectorLabelProps, MicSelectorList, type MicSelectorListProps, type MicSelectorProps, MicSelectorTrigger, type MicSelectorTriggerProps, MicSelectorValue, type MicSelectorValueProps, ModelSelector, ModelSelectorContent, type ModelSelectorContentProps, ModelSelectorDialog, type ModelSelectorDialogProps, ModelSelectorEmpty, type ModelSelectorEmptyProps, ModelSelectorGroup, type ModelSelectorGroupProps, ModelSelectorInput, type ModelSelectorInputProps, ModelSelectorItem, type ModelSelectorItemProps, ModelSelectorList, type ModelSelectorListProps, ModelSelectorLogo, ModelSelectorLogoGroup, type ModelSelectorLogoGroupProps, type ModelSelectorLogoProps, ModelSelectorName, type ModelSelectorNameProps, type ModelSelectorProps, ModelSelectorSeparator, type ModelSelectorSeparatorProps, ModelSelectorShortcut, type ModelSelectorShortcutProps, ModelSelectorTrigger, type ModelSelectorTriggerProps, type MultiEnumFieldSpec, Node, NodeAction, type NodeActionProps, NodeContent, type NodeContentProps, NodeDescription, type NodeDescriptionProps, NodeFooter, type NodeFooterProps, NodeHeader, type NodeHeaderProps, type NodeProps, NodeTitle, type NodeTitleProps, NodeToolbar, type NodeToolbarProps, type NormalizedFormSpec, type NormalizedTableSpec, type NumberFieldSpec, OpenIn, OpenInChatGPT, type OpenInChatGPTProps, OpenInClaude, type OpenInClaudeProps, OpenInContent, type OpenInContentProps, OpenInCursor, type OpenInCursorProps, OpenInItem, type OpenInItemProps, OpenInLabel, type OpenInLabelProps, type OpenInProps, OpenInScira, type OpenInSciraProps, OpenInSeparator, type OpenInSeparatorProps, OpenInT3, type OpenInT3Props, OpenInTrigger, type OpenInTriggerProps, OpenInv0, type OpenInv0Props, PERSONA_SOURCES, PRODUCED_ASSET_ICONS, PackageInfo, PackageInfoChangeType, type PackageInfoChangeTypeProps, PackageInfoContent, type PackageInfoContentProps, PackageInfoDependencies, type PackageInfoDependenciesProps, PackageInfoDependency, type PackageInfoDependencyProps, PackageInfoDescription, type PackageInfoDescriptionProps, PackageInfoHeader, type PackageInfoHeaderProps, PackageInfoName, type PackageInfoNameProps, type PackageInfoProps, PackageInfoVersion, type PackageInfoVersionProps, Panel, type PanelProps, type PartDisplay, type PartGroupNode, Persona, type PersonaProps, type PersonaState, type PersonaVariant, Plan, PlanAction, type PlanActionProps, PlanContent, type PlanContentProps, PlanDescription, type PlanDescriptionProps, PlanFooter, type PlanFooterProps, PlanHeader, type PlanHeaderProps, type PlanProps, PlanTitle, type PlanTitleProps, PlanTrigger, type PlanTriggerProps, ProducedAssetTree, type ProducedAssetTreeProps, PromptInput, PromptInputActionAddAttachments, type PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, type PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, type PromptInputActionMenuContentProps, PromptInputActionMenuItem, type PromptInputActionMenuItemProps, type PromptInputActionMenuProps, PromptInputActionMenuTrigger, type PromptInputActionMenuTriggerProps, PromptInputBody, type PromptInputBodyProps, PromptInputButton, type PromptInputButtonProps, type PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, type PromptInputCommandEmptyProps, PromptInputCommandGroup, type PromptInputCommandGroupProps, PromptInputCommandInput, type PromptInputCommandInputProps, PromptInputCommandItem, type PromptInputCommandItemProps, PromptInputCommandList, type PromptInputCommandListProps, type PromptInputCommandProps, PromptInputCommandSeparator, type PromptInputCommandSeparatorProps, type PromptInputControllerProps, PromptInputFooter, type PromptInputFooterProps, PromptInputHeader, type PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, type PromptInputHoverCardContentProps, type PromptInputHoverCardProps, PromptInputHoverCardTrigger, type PromptInputHoverCardTriggerProps, type PromptInputMessage, type PromptInputProps, PromptInputProvider, type PromptInputProviderProps, PromptInputSelect, PromptInputSelectContent, type PromptInputSelectContentProps, PromptInputSelectItem, type PromptInputSelectItemProps, type PromptInputSelectProps, PromptInputSelectTrigger, type PromptInputSelectTriggerProps, PromptInputSelectValue, type PromptInputSelectValueProps, PromptInputStop, type PromptInputStopProps, PromptInputSubmit, type PromptInputSubmitAction, type PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, type PromptInputTabBodyProps, PromptInputTabItem, type PromptInputTabItemProps, PromptInputTabLabel, type PromptInputTabLabelProps, type PromptInputTabProps, PromptInputTabsList, type PromptInputTabsListProps, PromptInputTextarea, type PromptInputTextareaProps, PromptInputTools, type PromptInputToolsProps, Queue, QueueItem, QueueItemAction, type QueueItemActionProps, QueueItemActions, type QueueItemActionsProps, QueueItemAttachment, type QueueItemAttachmentProps, QueueItemContent, type QueueItemContentProps, QueueItemDescription, type QueueItemDescriptionProps, QueueItemFile, type QueueItemFileProps, QueueItemImage, type QueueItemImageProps, QueueItemIndicator, type QueueItemIndicatorProps, type QueueItemProps, QueueList, type QueueListProps, type QueueMessage, type QueueMessagePart, type QueueProps, QueueSection, QueueSectionContent, type QueueSectionContentProps, QueueSectionLabel, type QueueSectionLabelProps, type QueueSectionProps, QueueSectionTrigger, type QueueSectionTriggerProps, type QueueTodo, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, type ReferencedSourcesContext, type RenderCell, Sandbox, SandboxContent, type SandboxContentProps, SandboxHeader, type SandboxHeaderProps, type SandboxProps, type SandboxRootProps, SandboxTabContent, type SandboxTabContentProps, SandboxTabs, SandboxTabsBar, type SandboxTabsBarProps, SandboxTabsList, type SandboxTabsListProps, type SandboxTabsProps, SandboxTabsTrigger, type SandboxTabsTriggerProps, SchemaDisplay, SchemaDisplayBody, type SchemaDisplayBodyProps, SchemaDisplayContent, type SchemaDisplayContentProps, SchemaDisplayDescription, type SchemaDisplayDescriptionProps, SchemaDisplayExample, type SchemaDisplayExampleProps, SchemaDisplayHeader, type SchemaDisplayHeaderProps, SchemaDisplayMethod, type SchemaDisplayMethodProps, SchemaDisplayParameter, type SchemaDisplayParameterProps, SchemaDisplayParameters, type SchemaDisplayParametersProps, SchemaDisplayPath, type SchemaDisplayPathProps, SchemaDisplayProperty, type SchemaDisplayPropertyProps, type SchemaDisplayProps, SchemaDisplayRequest, type SchemaDisplayRequestProps, SchemaDisplayResponse, type SchemaDisplayResponseProps, type SelectionSnapshot, SelectionToolbar, type SelectionToolbarProps, Shimmer, Snippet, SnippetAddon, type SnippetAddonProps, SnippetCopyButton, type SnippetCopyButtonProps, SnippetInput, type SnippetInputProps, type SnippetProps, SnippetText, type SnippetTextProps, Source, SourceList, type SourceListItem, type SourceListProps, type SourceProps, Sources, SourcesContent, type SourcesContentProps, type SourcesProps, SourcesTrigger, type SourcesTriggerProps, SpeechInput, type SpeechInputProps, StackTrace, StackTraceActions, type StackTraceActionsProps, StackTraceContent, type StackTraceContentProps, StackTraceCopyButton, type StackTraceCopyButtonProps, StackTraceError, StackTraceErrorMessage, type StackTraceErrorMessageProps, type StackTraceErrorProps, StackTraceErrorType, type StackTraceErrorTypeProps, StackTraceExpandButton, type StackTraceExpandButtonProps, StackTraceFrames, type StackTraceFramesProps, StackTraceHeader, type StackTraceHeaderProps, type StackTraceProps, StreamingSuggestions, type StreamingSuggestionsProps, type StringFieldSpec, Suggestion, SuggestionLoading, type SuggestionLoadingProps, type SuggestionProps, Suggestions, type SuggestionsProps, type TableRowData, type TableSort, type TableSpec, Task, TaskContent, type TaskContentProps, TaskItem, TaskItemFile, type TaskItemFileProps, type TaskItemProps, type TaskProps, TaskTrigger, type TaskTriggerProps, Terminal, TerminalActions, type TerminalActionsProps, TerminalClearButton, type TerminalClearButtonProps, TerminalContent, type TerminalContentProps, TerminalCopyButton, type TerminalCopyButtonProps, TerminalHeader, type TerminalHeaderProps, type TerminalProps, TerminalStatus, type TerminalStatusProps, TerminalTitle, type TerminalTitleProps, Test, TestDuration, type TestDurationProps, TestError, TestErrorMessage, type TestErrorMessageProps, type TestErrorProps, TestErrorStack, type TestErrorStackProps, TestName, type TestNameProps, type TestProps, TestResults, TestResultsContent, type TestResultsContentProps, TestResultsDuration, type TestResultsDurationProps, TestResultsHeader, type TestResultsHeaderProps, TestResultsMeta, type TestResultsMetaProps, TestResultsProgress, type TestResultsProgressProps, type TestResultsProps, TestResultsSummary, type TestResultsSummaryProps, TestStatus, type TestStatusProps, TestSuite, TestSuiteContent, type TestSuiteContentProps, TestSuiteName, type TestSuiteNameProps, type TestSuiteProps, TestSuiteStats, type TestSuiteStatsProps, type TextInputContext, type TextShimmerProps, Tool, ToolContent, type ToolContentProps, ToolDetails, type ToolDetailsProps, ToolHeader, type ToolHeaderProps, ToolInput, type ToolInputProps, ToolOutput, type ToolOutputProps, type ToolPart, type ToolProps, ToolResultCard, type ToolResultCardProps, Toolbar, type ToolbarProps, Transcription, type TranscriptionProps, TranscriptionSegment, type TranscriptionSegmentProps, UserMessage, type UserMessageProps, VoiceSelector, VoiceSelectorAccent, type VoiceSelectorAccentProps, VoiceSelectorAge, type VoiceSelectorAgeProps, VoiceSelectorAttributes, type VoiceSelectorAttributesProps, VoiceSelectorBullet, type VoiceSelectorBulletProps, VoiceSelectorContent, type VoiceSelectorContentProps, VoiceSelectorDescription, type VoiceSelectorDescriptionProps, VoiceSelectorDialog, type VoiceSelectorDialogProps, VoiceSelectorEmpty, type VoiceSelectorEmptyProps, VoiceSelectorGender, type VoiceSelectorGenderProps, VoiceSelectorGroup, type VoiceSelectorGroupProps, VoiceSelectorInput, type VoiceSelectorInputProps, VoiceSelectorItem, type VoiceSelectorItemProps, VoiceSelectorList, type VoiceSelectorListProps, VoiceSelectorName, type VoiceSelectorNameProps, VoiceSelectorPreview, type VoiceSelectorPreviewProps, type VoiceSelectorProps, VoiceSelectorSeparator, type VoiceSelectorSeparatorProps, VoiceSelectorShortcut, type VoiceSelectorShortcutProps, VoiceSelectorTrigger, type VoiceSelectorTriggerProps, WebPreview, WebPreviewBody, type WebPreviewBodyProps, WebPreviewConsole, type WebPreviewConsoleProps, type WebPreviewContextValue, WebPreviewNavigation, WebPreviewNavigationButton, type WebPreviewNavigationButtonProps, type WebPreviewNavigationProps, type WebPreviewProps, WebPreviewUrl, type WebPreviewUrlProps, agentMessageVariants, badgeToneForValue, booleanFieldSchema, buildInteractiveTerminalTheme, buildPartGroups, cellFormatSchema, columnSpecSchema, compareCellValues, createLazyMermaidPlugin, defaultPartStatus, enumFieldSchema, enumOptionSchema, fieldLabel, fieldSpecSchema, formSpecSchema, formatCellValue, getAttachmentLabel, getMediaCategory, getStatusBadge, groupPartByType, highlightCode, initialFormValues, inlineCitationSourceLabel, integerFieldSchema, isEmptyCell, isGroupNode, isNumericFormat, lazyMermaid, messageActionsVariants, messageFeedbackVariants, messagesToMarkdown, multiEnumFieldSchema, normalizeFormSpec, normalizeTableSpec, numberFieldSchema, optionLabel, optionValue, partsFingerprint, preloadMermaid, readSelectionWithin, rollupStatus, statusFromToolState, stringFieldSchema, tableSpecSchema, useAssetPreviewRenderer, useAttachmentContext, useAttachmentsContext, useAudioDevices, useContextPanel, useJSXPreview, useMessageEdit, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments, useReasoning, useVoiceSelector, validateField, validateForm };
|