@constructive-io/ui 0.6.1 → 0.9.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.
Files changed (44) hide show
  1. package/dist/ai-CiaH2sfF.js +2840 -0
  2. package/dist/ai-CiaH2sfF.js.map +1 -0
  3. package/dist/ai-lAkichk8.cjs +3182 -0
  4. package/dist/ai-lAkichk8.cjs.map +1 -0
  5. package/dist/alert-BXuP0ayz.d.cts +19 -0
  6. package/dist/alert-BXuP0ayz.d.ts +19 -0
  7. package/dist/components/ai/index.cjs +61 -0
  8. package/dist/components/ai/index.d.cts +2 -0
  9. package/dist/components/ai/index.d.ts +2 -0
  10. package/dist/components/ai/index.js +4 -0
  11. package/dist/components/alert.d.cts +2 -19
  12. package/dist/components/alert.d.ts +2 -19
  13. package/dist/components/app-bar.cjs +1 -1
  14. package/dist/components/app-bar.js +1 -1
  15. package/dist/components/app-shell.cjs +1 -1
  16. package/dist/components/app-shell.js +1 -1
  17. package/dist/components/badge.d.cts +2 -2
  18. package/dist/components/badge.d.ts +2 -2
  19. package/dist/components/command.cjs +1 -1
  20. package/dist/components/command.cjs.map +1 -1
  21. package/dist/components/command.js +1 -1
  22. package/dist/components/command.js.map +1 -1
  23. package/dist/components/field.d.cts +1 -1
  24. package/dist/components/field.d.ts +1 -1
  25. package/dist/components/sheet.d.cts +1 -1
  26. package/dist/components/sheet.d.ts +1 -1
  27. package/dist/components/sidebar.cjs +1 -1
  28. package/dist/components/sidebar.d.cts +1 -1
  29. package/dist/components/sidebar.d.ts +1 -1
  30. package/dist/components/sidebar.js +1 -1
  31. package/dist/index-B0wXxIAb.d.ts +737 -0
  32. package/dist/index-CyaFaZe2.d.cts +737 -0
  33. package/dist/index.cjs +59 -1
  34. package/dist/index.d.cts +4 -3
  35. package/dist/index.d.ts +4 -3
  36. package/dist/index.js +3 -2
  37. package/dist/{sidebar-CPy_fibW.cjs → sidebar-BavjjJp0.cjs} +29 -12
  38. package/dist/sidebar-BavjjJp0.cjs.map +1 -0
  39. package/dist/{sidebar-Cfax0g0_.js → sidebar-DeoL2ttp.js} +30 -12
  40. package/dist/sidebar-DeoL2ttp.js.map +1 -0
  41. package/package.json +13 -2
  42. package/src/styles/globals.css +92 -0
  43. package/dist/sidebar-CPy_fibW.cjs.map +0 -1
  44. package/dist/sidebar-Cfax0g0_.js.map +0 -1
@@ -0,0 +1,737 @@
1
+ import { t as Tooltip } from "./tooltip-CTRQoN1A.js";
2
+ import { t as Alert } from "./alert-BXuP0ayz.js";
3
+ import * as React$1 from "react";
4
+ //#region src/components/ai/text-shimmer.d.ts
5
+ type TextShimmerProps = React$1.ComponentProps<'span'> & {
6
+ /** When false, renders static muted text (useful after a stream settles). */
7
+ active?: boolean;
8
+ };
9
+ /**
10
+ * Sweeping-gradient status text for in-flight agent states.
11
+ * CSS-only animation so it does not re-render on a timer.
12
+ */
13
+ declare function TextShimmer({ className, active, children, ...props }: TextShimmerProps): React$1.JSX.Element;
14
+ //#endregion
15
+ //#region src/components/ai/agent-loader.d.ts
16
+ type PixelVariant = 'drive' | 'dots' | 'orbit';
17
+ type SimpleVariant = 'circular' | 'bounce-dots' | 'typing' | 'wave' | 'pulse-dot' | 'text-shimmer' | 'loading-dots';
18
+ type AgentLoaderVariant = PixelVariant | SimpleVariant;
19
+ type AgentLoaderProps = {
20
+ variant?: AgentLoaderVariant;
21
+ /** Status label (pixel + text variants). */
22
+ label?: string;
23
+ /** Show a live elapsed timer next to the pixel loader. */
24
+ showElapsed?: boolean;
25
+ /** When provided, use this elapsed ms instead of an internal clock. */
26
+ elapsedMs?: number;
27
+ size?: 'sm' | 'md' | 'lg';
28
+ className?: string;
29
+ text?: string;
30
+ };
31
+ /**
32
+ * Agent loading indicator. Pixel variants (drive / dots / orbit) match the
33
+ * Beautiful UI craft; simple variants cover common chat spinners.
34
+ */
35
+ declare function AgentLoader({ variant, label, showElapsed, elapsedMs, size, className, text }: AgentLoaderProps): React$1.JSX.Element;
36
+ /** @deprecated Prefer AgentLoader — alias kept for prompt-kit familiarity. */
37
+ declare const Loader: typeof AgentLoader;
38
+ //#endregion
39
+ //#region src/components/ai/prompt-input.d.ts
40
+ type PromptInputContextValue = {
41
+ isLoading: boolean;
42
+ value: string;
43
+ setValue: (value: string) => void;
44
+ maxHeight: number | string;
45
+ onSubmit?: () => void;
46
+ disabled?: boolean;
47
+ textareaRef: React$1.RefObject<HTMLTextAreaElement | null>;
48
+ };
49
+ declare function usePromptInput(): PromptInputContextValue;
50
+ type PromptInputProps = React$1.ComponentProps<'div'> & {
51
+ isLoading?: boolean;
52
+ value?: string;
53
+ onValueChange?: (value: string) => void;
54
+ maxHeight?: number | string;
55
+ onSubmit?: () => void;
56
+ disabled?: boolean;
57
+ /** Visual shell. `default` uses Constructive radius; `pill` is more rounded. */
58
+ shape?: 'default' | 'pill';
59
+ };
60
+ /**
61
+ * Compound chat composer shell. Host owns submit/streaming; this owns layout,
62
+ * autosize context, and action slots.
63
+ */
64
+ declare function PromptInput({ className, isLoading, maxHeight, value, onValueChange, onSubmit, children, disabled, shape, onClick, ...props }: PromptInputProps): React$1.JSX.Element;
65
+ type PromptInputTextareaProps = Omit<React$1.ComponentProps<'textarea'>, 'value' | 'onChange'> & {
66
+ disableAutosize?: boolean;
67
+ };
68
+ declare function PromptInputTextarea({ className, onKeyDown, disableAutosize, ...props }: PromptInputTextareaProps): React$1.JSX.Element;
69
+ type PromptInputActionsProps = React$1.ComponentProps<'div'>;
70
+ declare function PromptInputActions({ className, ...props }: PromptInputActionsProps): React$1.JSX.Element;
71
+ type PromptInputActionProps = {
72
+ tooltip: React$1.ReactNode;
73
+ side?: 'top' | 'bottom' | 'left' | 'right';
74
+ children: React$1.ReactNode;
75
+ className?: string;
76
+ } & Omit<React$1.ComponentProps<typeof Tooltip>, 'children'>;
77
+ declare function PromptInputAction({ tooltip, children, className, side, ...props }: PromptInputActionProps): React$1.JSX.Element;
78
+ type PromptInputBodyProps = React$1.ComponentProps<'div'>;
79
+ declare function PromptInputBody({ className, ...props }: PromptInputBodyProps): React$1.JSX.Element;
80
+ //#endregion
81
+ //#region src/components/ai/message.d.ts
82
+ type MessageProps = React$1.ComponentProps<'div'> & {
83
+ /** Visual role for default density / alignment helpers. */
84
+ from?: 'user' | 'assistant' | 'system';
85
+ };
86
+ declare function Message({ className, from, ...props }: MessageProps): React$1.JSX.Element;
87
+ type MessageAvatarProps = {
88
+ src?: string;
89
+ alt?: string;
90
+ fallback?: string;
91
+ className?: string;
92
+ delay?: number;
93
+ };
94
+ declare function MessageAvatar({ src, alt, fallback, className, delay }: MessageAvatarProps): React$1.JSX.Element;
95
+ type MessageContentProps = React$1.ComponentProps<'div'> & {
96
+ markdown?: boolean;
97
+ /** While true, markdown re-renders are throttled (see Markdown). */
98
+ streaming?: boolean;
99
+ };
100
+ declare function MessageContent({ className, markdown, streaming, children, ...props }: MessageContentProps): React$1.JSX.Element;
101
+ type MessageActionsProps = React$1.ComponentProps<'div'>;
102
+ declare function MessageActions({ className, ...props }: MessageActionsProps): React$1.JSX.Element;
103
+ type MessageActionProps = {
104
+ tooltip: React$1.ReactNode;
105
+ side?: 'top' | 'bottom' | 'left' | 'right';
106
+ children: React$1.ReactNode;
107
+ className?: string;
108
+ } & Omit<React$1.ComponentProps<typeof Tooltip>, 'children'>;
109
+ declare function MessageAction({ tooltip, children, className, side, ...props }: MessageActionProps): React$1.JSX.Element;
110
+ //#endregion
111
+ //#region src/components/ai/markdown.d.ts
112
+ type MarkdownProps = React$1.ComponentProps<'div'> & {
113
+ children: string;
114
+ /** Throttle re-renders while tokens arrive. */
115
+ streaming?: boolean;
116
+ };
117
+ /**
118
+ * Lightweight markdown → HTML without hard deps.
119
+ * Handles paragraphs, bold, italic, inline code, fenced code, links, lists.
120
+ * Hosts that need full GFM can pass pre-rendered HTML via a future `html` prop
121
+ * or wrap with their own marked+DOMPurify pipeline.
122
+ */
123
+ declare function renderBasicMarkdown(source: string): string;
124
+ /**
125
+ * Markdown renderer for assistant messages. Throttles while streaming.
126
+ * Uses a zero-dependency subset suitable for most agent replies; swap for a
127
+ * host-level marked pipeline when you need tables/footnotes.
128
+ */
129
+ declare function Markdown({ className, children, streaming, ...props }: MarkdownProps): React$1.JSX.Element;
130
+ //#endregion
131
+ //#region src/components/ai/code-block.d.ts
132
+ type CodeBlockProps = React$1.ComponentProps<'div'> & {
133
+ code: string;
134
+ language?: string;
135
+ /** Optional filename shown in the header. */
136
+ filename?: string;
137
+ /** Show the copy control (default true). */
138
+ showCopy?: boolean;
139
+ /**
140
+ * Syntax highlighting via sugar-high (~1 kB). Default true.
141
+ * Disable for ultra-hot streaming paths if the host re-highlights later.
142
+ */
143
+ highlight?: boolean;
144
+ /**
145
+ * Max lines shown while collapsed. Pass `false` to always show full code.
146
+ * Default 12. Collapse only engages when the source is longer.
147
+ */
148
+ maxCollapsedLines?: number | false;
149
+ /**
150
+ * When expanded, cap height and scroll inside the block.
151
+ * Pass `false` for fully unconstrained height. Default ~28rem / 70vh.
152
+ */
153
+ maxExpandedHeight?: string | false;
154
+ /** Controlled expand state. */
155
+ expanded?: boolean;
156
+ /** Uncontrolled initial expand. Default false. */
157
+ defaultExpanded?: boolean;
158
+ onExpandedChange?: (expanded: boolean) => void;
159
+ /** Reveal code line-by-line for demos / progressive stream. */
160
+ streamingLines?: boolean;
161
+ /** Lines revealed per tick when streamingLines is true. */
162
+ lineIntervalMs?: number;
163
+ };
164
+ /**
165
+ * Agent code surface with lightweight sugar-high highlighting, elegant header,
166
+ * copy action, and collapse/expand for long sources.
167
+ */
168
+ declare function CodeBlock({ code, language, filename, showCopy, highlight: highlightEnabled, maxCollapsedLines, maxExpandedHeight, expanded: expandedProp, defaultExpanded, onExpandedChange, streamingLines, lineIntervalMs, className, ...props }: CodeBlockProps): React$1.JSX.Element;
169
+ //#endregion
170
+ //#region src/components/ai/response-stream.d.ts
171
+ type ResponseStreamMode = 'typewriter' | 'fade';
172
+ type ResponseStreamProps = {
173
+ text: string;
174
+ /** Client-side reveal for fixtures/demos. Real hosts should stream tokens into `text`. */
175
+ mode?: ResponseStreamMode;
176
+ /** Characters per tick for typewriter mode. */
177
+ speed?: number;
178
+ className?: string;
179
+ /** Render as markdown once revealed. */
180
+ markdown?: boolean;
181
+ onComplete?: () => void;
182
+ };
183
+ /**
184
+ * Progressive text reveal for demos and offline fixtures.
185
+ * Production streaming should feed tokens into Markdown/MessageContent instead.
186
+ */
187
+ declare function ResponseStream({ text, mode, speed, className, markdown, onComplete }: ResponseStreamProps): React$1.JSX.Element;
188
+ //#endregion
189
+ //#region src/components/ai/chat-container.d.ts
190
+ type ChatContainerContextValue = {
191
+ scrollRef: React$1.RefObject<HTMLDivElement | null>;
192
+ isAtBottom: boolean;
193
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
194
+ };
195
+ declare function useChatContainer(): ChatContainerContextValue;
196
+ type ChatContainerProps = React$1.ComponentProps<'div'> & {
197
+ /** Pixels from the bottom that still count as "pinned". */
198
+ bottomThreshold?: number;
199
+ /** Auto-follow new content while pinned to the bottom. */
200
+ autoScroll?: boolean;
201
+ };
202
+ /**
203
+ * Scroll region for chat transcripts with stick-to-bottom tracking.
204
+ * Pair with ScrollButton for jump-to-latest.
205
+ */
206
+ declare function ChatContainer({ className, children, bottomThreshold, autoScroll, ...props }: ChatContainerProps): React$1.JSX.Element;
207
+ type ChatContainerContentProps = React$1.ComponentProps<'div'>;
208
+ declare function ChatContainerContent({ className, ...props }: ChatContainerContentProps): React$1.JSX.Element;
209
+ //#endregion
210
+ //#region src/components/ai/scroll-button.d.ts
211
+ type ScrollButtonProps = Omit<React$1.ComponentProps<'button'>, 'children'> & {
212
+ /** Override visibility; defaults to !isAtBottom from ChatContainer. */
213
+ visible?: boolean;
214
+ /** Accessible name (also used if a visible label is shown later). */
215
+ label?: string;
216
+ };
217
+ /**
218
+ * Floating jump-to-latest control. Appears when the transcript is scrolled up.
219
+ * Must render inside ChatContainer (reads pin state via context).
220
+ *
221
+ * Visual: single soft ring + ambient shadow — not the outline Button chrome
222
+ * (which stacks border + inset pseudo and reads as a double border).
223
+ */
224
+ declare function ScrollButton({ className, visible, label, onClick, type, ...props }: ScrollButtonProps): React$1.JSX.Element | null;
225
+ //#endregion
226
+ //#region src/components/ai/system-message.d.ts
227
+ type SystemMessageProps = React$1.ComponentProps<typeof Alert> & {
228
+ title?: React$1.ReactNode;
229
+ };
230
+ /**
231
+ * Banner-style notice for app-injected transcript messages (errors, hints).
232
+ * Not an assistant reply — keep it visually distinct via Alert variants.
233
+ */
234
+ declare function SystemMessage({ className, title, variant, children, ...props }: SystemMessageProps): React$1.JSX.Element;
235
+ //#endregion
236
+ //#region src/components/ai/use-throttled-text.d.ts
237
+ /** Default stream throttle (~15fps) — bounds markdown re-parse cost. */
238
+ declare const STREAM_THROTTLE_MS = 66;
239
+ /**
240
+ * Throttle `text` updates while `streaming` is true; flush immediately when
241
+ * streaming ends so settled content is never delayed.
242
+ */
243
+ declare function useThrottledText(text: string, streaming: boolean, intervalMs?: number): string;
244
+ //#endregion
245
+ //#region src/components/ai/reasoning.d.ts
246
+ type ReasoningProps = {
247
+ children?: React$1.ReactNode;
248
+ /** Raw thinking text; used when children are omitted. */
249
+ content?: string;
250
+ isStreaming?: boolean;
251
+ /** Elapsed thinking time in ms (settled). */
252
+ durationMs?: number | null;
253
+ open?: boolean;
254
+ onOpenChange?: (open: boolean) => void;
255
+ /** Render content as markdown. */
256
+ markdown?: boolean;
257
+ className?: string;
258
+ /** Override trigger label while streaming. */
259
+ streamingLabel?: string;
260
+ /** Override settled label when no duration. */
261
+ doneLabel?: string;
262
+ };
263
+ /**
264
+ * Collapsible model reasoning / thinking block.
265
+ * Auto-opens while streaming; auto-collapses when settled unless the user toggled.
266
+ */
267
+ declare function Reasoning({ children, content, isStreaming, durationMs, open: openProp, onOpenChange, markdown, className, streamingLabel, doneLabel }: ReasoningProps): React$1.JSX.Element | null;
268
+ type ThinkingBarProps = {
269
+ className?: string;
270
+ text?: string;
271
+ onStop?: () => void;
272
+ stopLabel?: string;
273
+ onClick?: () => void;
274
+ };
275
+ /** Compact “Thinking…” line with optional stop action (prompt-kit style). */
276
+ declare function ThinkingBar({ className, text, onStop, stopLabel, onClick }: ThinkingBarProps): React$1.JSX.Element;
277
+ //#endregion
278
+ //#region src/components/ai/thinking-trace.d.ts
279
+ type ThinkingTraceMode = 'steps' | 'reasoning' | 'search' | 'coding';
280
+ type ThinkingTraceRow = {
281
+ primary: string;
282
+ secondary?: string;
283
+ mono?: boolean;
284
+ href?: string;
285
+ add?: number;
286
+ del?: number;
287
+ };
288
+ type ThinkingTraceProps = {
289
+ mode?: ThinkingTraceMode;
290
+ /** Active header while working. */
291
+ activeLabel?: string;
292
+ /** Settled header (overridden by durationMs when set). */
293
+ doneLabel?: string;
294
+ durationMs?: number | null;
295
+ isStreaming?: boolean;
296
+ rows: ThinkingTraceRow[];
297
+ /** Optional search query shown in search mode. */
298
+ query?: string;
299
+ open?: boolean;
300
+ onOpenChange?: (open: boolean) => void;
301
+ className?: string;
302
+ /** How many rows are visible while streaming (progressive reveal). */
303
+ visibleCount?: number;
304
+ };
305
+ /**
306
+ * Beautiful UI–style expandable agent trace with mode variants.
307
+ * Production hosts pass rows + streaming; demos can drive visibleCount.
308
+ */
309
+ declare function ThinkingTrace({ mode, activeLabel, doneLabel, durationMs, isStreaming, rows, query, open: openProp, onOpenChange, className, visibleCount }: ThinkingTraceProps): React$1.JSX.Element;
310
+ //#endregion
311
+ //#region src/components/ai/steps.d.ts
312
+ type StepStatus = 'pending' | 'running' | 'done' | 'error';
313
+ type StepsProps = {
314
+ children: React$1.ReactNode;
315
+ className?: string;
316
+ open?: boolean;
317
+ onOpenChange?: (open: boolean) => void;
318
+ defaultOpen?: boolean;
319
+ /** Header label when collapsed/expanded. */
320
+ title?: React$1.ReactNode;
321
+ };
322
+ /**
323
+ * Quiet timeline with gapped segments (not a continuous spine through icons):
324
+ *
325
+ * ```
326
+ * ✓
327
+ * ↕ GAP
328
+ * │ ≥ MIN_SEGMENT
329
+ * ↕ GAP
330
+ * ◌
331
+ * ```
332
+ *
333
+ * Each step (except last) draws its own connector. The rail enforces a minimum
334
+ * height so short title-only steps still show a readable segment.
335
+ */
336
+ declare function Steps({ children, className, open, onOpenChange, defaultOpen, title }: StepsProps): React$1.JSX.Element;
337
+ type StepProps = {
338
+ children?: React$1.ReactNode;
339
+ title: React$1.ReactNode;
340
+ description?: React$1.ReactNode;
341
+ status?: StepStatus;
342
+ className?: string;
343
+ };
344
+ declare function Step({ children, title, description, status, className }: StepProps): React$1.JSX.Element;
345
+ /** Alias for prompt-kit chain-of-thought naming. */
346
+ declare const ChainOfThought: typeof Steps;
347
+ declare const ChainOfThoughtStep: typeof Step;
348
+ //#endregion
349
+ //#region src/components/ai/types.d.ts
350
+ /** Shared presentation types for agent surfaces (host-runtime agnostic). */
351
+ type ToolStatus = 'pending' | 'running' | 'success' | 'error' | 'aborted' | 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
352
+ type NormalizedToolStatus = 'pending' | 'running' | 'success' | 'error' | 'aborted';
353
+ declare function normalizeToolStatus(status: ToolStatus | string | undefined): NormalizedToolStatus;
354
+ type PlanStepStatus = 'pending' | 'in_progress' | 'done';
355
+ type PlanStep = {
356
+ label: string;
357
+ status: PlanStepStatus;
358
+ };
359
+ type Plan = {
360
+ steps: PlanStep[];
361
+ };
362
+ type ContextUsage = {
363
+ /** null while recomputing after compaction */
364
+ tokens: number | null;
365
+ percent?: number | null;
366
+ contextWindow: number;
367
+ };
368
+ type DiffFileChip = {
369
+ file: string;
370
+ add?: number;
371
+ del?: number;
372
+ };
373
+ type InlineDiffSource = {
374
+ before: string;
375
+ after: string;
376
+ fileName?: string;
377
+ };
378
+ //#endregion
379
+ //#region src/components/ai/tool.d.ts
380
+ type ToolVariant = 'card' | 'chip' | 'row';
381
+ type ToolProps = {
382
+ name: string;
383
+ status?: ToolStatus | string;
384
+ /** Short summary / path chip (e.g. file name). */
385
+ summary?: React$1.ReactNode;
386
+ input?: unknown;
387
+ output?: unknown;
388
+ errorText?: string;
389
+ /** Compact detail lines for chip/row expand. */
390
+ detail?: Array<{
391
+ text: string;
392
+ tone?: 'add' | 'default';
393
+ }>;
394
+ diff?: DiffFileChip | DiffFileChip[];
395
+ variant?: ToolVariant;
396
+ defaultOpen?: boolean;
397
+ open?: boolean;
398
+ onOpenChange?: (open: boolean) => void;
399
+ className?: string;
400
+ children?: React$1.ReactNode;
401
+ };
402
+ declare function StatusIcon({ status }: {
403
+ status: ReturnType<typeof normalizeToolStatus>;
404
+ }): React$1.JSX.Element;
405
+ /**
406
+ * Tool call presentation in card, chip, or compact row density.
407
+ */
408
+ declare function Tool({ name, status: statusProp, summary, input, output, errorText, detail, diff, variant, defaultOpen, open, onOpenChange, className, children }: ToolProps): React$1.JSX.Element;
409
+ type ToolGroupProps = {
410
+ /** e.g. "4 tool calls, 2 messages" */
411
+ label: React$1.ReactNode;
412
+ children: React$1.ReactNode;
413
+ defaultOpen?: boolean;
414
+ className?: string;
415
+ };
416
+ declare function ToolGroup({ label, children, defaultOpen, className }: ToolGroupProps): React$1.JSX.Element;
417
+ //#endregion
418
+ //#region src/components/ai/approval-card.d.ts
419
+ type ApprovalOption = {
420
+ id: string;
421
+ label: React$1.ReactNode;
422
+ description?: React$1.ReactNode;
423
+ };
424
+ type ApprovalQuestion = {
425
+ id: string;
426
+ prompt: React$1.ReactNode;
427
+ type?: 'single' | 'multiple';
428
+ options: ApprovalOption[];
429
+ };
430
+ type ApprovalCardProps = {
431
+ /** Single-shot confirm (desktop tool-confirm style). */
432
+ title?: React$1.ReactNode;
433
+ description?: React$1.ReactNode;
434
+ /** Multi-step questions (Beautiful approval). */
435
+ questions?: ApprovalQuestion[];
436
+ confirmLabel?: string;
437
+ skipLabel?: string;
438
+ destructive?: boolean;
439
+ /** Preview node under the title (tables, diffs, etc.). */
440
+ preview?: React$1.ReactNode;
441
+ onConfirm?: (payload: {
442
+ answers?: Record<string, string[]>;
443
+ }) => void;
444
+ onSkip?: () => void;
445
+ onDismiss?: () => void;
446
+ className?: string;
447
+ /** Controlled sent state for demos. */
448
+ defaultSent?: boolean;
449
+ };
450
+ /**
451
+ * Human-in-the-loop approval: simple confirm/skip or multi-question flow.
452
+ */
453
+ declare function ApprovalCard({ title, description, questions, confirmLabel, skipLabel, destructive, preview, onConfirm, onSkip, onDismiss, className, defaultSent }: ApprovalCardProps): React$1.JSX.Element;
454
+ //#endregion
455
+ //#region src/components/ai/source.d.ts
456
+ type SourceProps = {
457
+ href?: string;
458
+ title: string;
459
+ description?: string;
460
+ favicon?: string;
461
+ domain?: string;
462
+ className?: string;
463
+ };
464
+ declare function Source({ href, title, description, favicon, domain, className }: SourceProps): React$1.JSX.Element;
465
+ type SourcesProps = {
466
+ children: React$1.ReactNode;
467
+ className?: string;
468
+ label?: React$1.ReactNode;
469
+ };
470
+ declare function Sources({ children, className, label }: SourcesProps): React$1.JSX.Element;
471
+ //#endregion
472
+ //#region src/components/ai/inline-diff.d.ts
473
+ type InlineDiffProps = {
474
+ source: InlineDiffSource;
475
+ className?: string;
476
+ /** Max lines shown before collapse. */
477
+ maxLines?: number;
478
+ };
479
+ type DiffLine = {
480
+ type: 'context' | 'add' | 'del';
481
+ text: string;
482
+ };
483
+ /** Naive line diff for presentation (not a full Myers algorithm). */
484
+ declare function lineDiff(before: string, after: string): DiffLine[];
485
+ declare function InlineDiff({ source, className, maxLines }: InlineDiffProps): React$1.JSX.Element;
486
+ //#endregion
487
+ //#region src/components/ai/streaming-text.d.ts
488
+ type StreamToken = {
489
+ type: 'text';
490
+ text: string;
491
+ } | {
492
+ type: 'cite';
493
+ id: string;
494
+ };
495
+ type StreamingTextSource = {
496
+ id: string;
497
+ title: string;
498
+ href?: string;
499
+ description?: string;
500
+ };
501
+ type StreamingTextProps = {
502
+ /** Full text to reveal (word/token based). */
503
+ text?: string;
504
+ /** Structured tokens with inline citations. */
505
+ tokens?: StreamToken[];
506
+ sources?: StreamingTextSource[];
507
+ followUps?: string[];
508
+ onFollowUp?: (text: string) => void;
509
+ /** When true, reveals progressively; when false, shows all. */
510
+ streaming?: boolean;
511
+ /** ms per word while streaming client-side. Hosts should prefer real token props. */
512
+ wordIntervalMs?: number;
513
+ showActions?: boolean;
514
+ onCopy?: () => void;
515
+ className?: string;
516
+ };
517
+ /**
518
+ * Streamed answer with blur-resolve words, citation chips, actions, follow-ups.
519
+ * For production, drive `streaming` + full `text` from the host; the interval
520
+ * path is for demos when tokens arrive as a finished string.
521
+ */
522
+ declare function StreamingText({ text, tokens, sources, followUps, onFollowUp, streaming, wordIntervalMs, showActions, onCopy, className }: StreamingTextProps): React$1.JSX.Element;
523
+ //#endregion
524
+ //#region src/components/ai/diff-table.d.ts
525
+ type DiffTableColumn<T> = {
526
+ id: string;
527
+ header: React$1.ReactNode;
528
+ /** Cell render for base rows. */
529
+ cell: (row: T) => React$1.ReactNode;
530
+ /** Optional mono / width hint. */
531
+ className?: string;
532
+ };
533
+ type DiffTableRowBase = {
534
+ id: string;
535
+ /** Mark for removal highlight. */
536
+ removed?: boolean;
537
+ };
538
+ type DiffTableAddedRow = {
539
+ id: string;
540
+ cells: React$1.ReactNode[];
541
+ };
542
+ type DiffTableProps<T extends DiffTableRowBase> = {
543
+ title?: React$1.ReactNode;
544
+ columns: DiffTableColumn<T>[];
545
+ rows: T[];
546
+ /** Rows that appear as green additions. */
547
+ addedRows?: DiffTableAddedRow[];
548
+ /**
549
+ * When true, play a simple enter animation (removed tint → added row).
550
+ * Hosts that drive state live should leave this false.
551
+ */
552
+ animate?: boolean;
553
+ className?: string;
554
+ };
555
+ /**
556
+ * Table of proposed AI edits: removed rows tint destructive, added rows tint success.
557
+ */
558
+ declare function DiffTable<T extends DiffTableRowBase>({ title, columns, rows, addedRows, animate, className }: DiffTableProps<T>): React$1.JSX.Element;
559
+ //#endregion
560
+ //#region src/components/ai/plan-tracker.d.ts
561
+ type PlanTrackerProps = {
562
+ plan?: Plan | null;
563
+ streaming?: boolean;
564
+ className?: string;
565
+ /** Flush bottom corners when stacked on a composer. */
566
+ flushBottom?: boolean;
567
+ defaultOpen?: boolean;
568
+ open?: boolean;
569
+ onOpenChange?: (open: boolean) => void;
570
+ };
571
+ /**
572
+ * Live agent plan checklist, typically pinned above the composer.
573
+ */
574
+ declare function PlanTracker({ plan, streaming, className, flushBottom, defaultOpen, open, onOpenChange }: PlanTrackerProps): React$1.JSX.Element | null;
575
+ //#endregion
576
+ //#region src/components/ai/context-ring.d.ts
577
+ type ContextRingProps = {
578
+ usage?: ContextUsage | null;
579
+ /** Drawn diameter in px. Default 24. */
580
+ size?: number;
581
+ /**
582
+ * Kept for API compatibility. Scales bar thickness and length.
583
+ * Default 2.
584
+ */
585
+ stroke?: number;
586
+ className?: string;
587
+ };
588
+ declare function formatCompact(n: number): string;
589
+ /**
590
+ * Compact context-window meter: linear segmented bar, bent into a ring.
591
+ * Filled ticks glow; remaining ticks stay quiet.
592
+ */
593
+ declare function ContextRing({ usage, size, stroke, className }: ContextRingProps): React$1.JSX.Element;
594
+ //#endregion
595
+ //#region src/components/ai/task-row.d.ts
596
+ type TaskStatus = 'pending' | 'running' | 'completed' | 'failed';
597
+ type TaskDetail = {
598
+ label: React$1.ReactNode;
599
+ meta?: React$1.ReactNode;
600
+ };
601
+ type TaskRowProps = {
602
+ label: React$1.ReactNode;
603
+ meta?: React$1.ReactNode;
604
+ status: TaskStatus;
605
+ /** 0–100 while running. */
606
+ progress?: number;
607
+ details?: TaskDetail[];
608
+ onRetry?: () => void;
609
+ className?: string;
610
+ defaultOpen?: boolean;
611
+ /** Stagger index for enter animation. */
612
+ index?: number;
613
+ };
614
+ declare function TaskRow({ label, meta, status, progress, details, onRetry, className, defaultOpen, index }: TaskRowProps): React$1.JSX.Element;
615
+ type TaskListProps = {
616
+ children: React$1.ReactNode;
617
+ className?: string;
618
+ };
619
+ declare function TaskList({ children, className }: TaskListProps): React$1.JSX.Element;
620
+ //#endregion
621
+ //#region src/components/ai/context-card.d.ts
622
+ type ContextCardProps = {
623
+ title: React$1.ReactNode;
624
+ body: React$1.ReactNode;
625
+ /** Character count or size label. */
626
+ meta?: React$1.ReactNode;
627
+ /** Source kind badge (PDF, CSV, …). */
628
+ sourceType?: string;
629
+ sourceName?: React$1.ReactNode;
630
+ className?: string;
631
+ index?: number;
632
+ };
633
+ declare function ContextCard({ title, body, meta, sourceType, sourceName, className, index }: ContextCardProps): React$1.JSX.Element;
634
+ type ContextCardsProps = {
635
+ children: React$1.ReactNode;
636
+ className?: string;
637
+ label?: React$1.ReactNode;
638
+ count?: number;
639
+ };
640
+ declare function ContextCards({ children, className, label, count }: ContextCardsProps): React$1.JSX.Element;
641
+ //#endregion
642
+ //#region src/components/ai/recommendation-card.d.ts
643
+ type RecommendationOption = {
644
+ id: string;
645
+ label: React$1.ReactNode;
646
+ description?: React$1.ReactNode;
647
+ /** e.g. "Needs review" */
648
+ badge?: React$1.ReactNode;
649
+ };
650
+ type RecommendationCardProps = {
651
+ title?: React$1.ReactNode;
652
+ /** Primary recommendation body (supports mono spans via children). */
653
+ body: React$1.ReactNode;
654
+ /** 0–1 confidence */
655
+ confidence?: number;
656
+ confidenceLabel?: React$1.ReactNode;
657
+ alternatives?: RecommendationOption[];
658
+ acceptLabel?: string;
659
+ onAccept?: (optionId: string) => void;
660
+ className?: string;
661
+ /** Controlled selected option id. */
662
+ selectedId?: string;
663
+ defaultSelectedId?: string;
664
+ };
665
+ /**
666
+ * Agent suggestion with confidence meter and optional alternatives drawer.
667
+ */
668
+ declare function RecommendationCard({ title, body, confidence, confidenceLabel, alternatives, acceptLabel, onAccept, className, selectedId: selectedProp, defaultSelectedId }: RecommendationCardProps): React$1.JSX.Element;
669
+ //#endregion
670
+ //#region src/components/ai/feedback-bar.d.ts
671
+ type FeedbackValue = 'up' | 'down' | null;
672
+ type FeedbackBarProps = {
673
+ className?: string;
674
+ onCopy?: () => void | Promise<void>;
675
+ onRegenerate?: () => void;
676
+ onFeedback?: (value: FeedbackValue) => void;
677
+ copyText?: string;
678
+ showCopy?: boolean;
679
+ showRegenerate?: boolean;
680
+ showFeedback?: boolean;
681
+ };
682
+ /**
683
+ * Message action row: copy, regenerate, thumbs.
684
+ */
685
+ declare function FeedbackBar({ className, onCopy, onRegenerate, onFeedback, copyText, showCopy, showRegenerate, showFeedback }: FeedbackBarProps): React$1.JSX.Element;
686
+ //#endregion
687
+ //#region src/components/ai/prompt-suggestion.d.ts
688
+ type PromptSuggestionProps = {
689
+ children: React$1.ReactNode;
690
+ onClick?: () => void;
691
+ className?: string;
692
+ };
693
+ declare function PromptSuggestion({ children, onClick, className }: PromptSuggestionProps): React$1.JSX.Element;
694
+ type PromptSuggestionsProps = {
695
+ children: React$1.ReactNode;
696
+ className?: string;
697
+ label?: React$1.ReactNode;
698
+ };
699
+ declare function PromptSuggestions({ children, className, label }: PromptSuggestionsProps): React$1.JSX.Element;
700
+ //#endregion
701
+ //#region src/components/ai/file-upload.d.ts
702
+ type FileUploadProps = {
703
+ files?: File[];
704
+ onFilesChange?: (files: File[]) => void;
705
+ multiple?: boolean;
706
+ accept?: string;
707
+ disabled?: boolean;
708
+ className?: string;
709
+ /** Compact trigger only (no dropzone chrome). */
710
+ variant?: 'dropzone' | 'button';
711
+ children?: React$1.ReactNode;
712
+ };
713
+ /**
714
+ * Drag-and-drop / file picker for chat attachments.
715
+ */
716
+ declare function FileUpload({ files: filesProp, onFilesChange, multiple, accept, disabled, className, variant, children }: FileUploadProps): React$1.JSX.Element;
717
+ //#endregion
718
+ //#region src/components/ai/image.d.ts
719
+ type AiImageProps = Omit<React$1.ComponentProps<'img'>, 'src'> & {
720
+ /** Base64 payload without data-url prefix, or full data URL. */
721
+ data?: string;
722
+ mimeType?: string;
723
+ src?: string;
724
+ /** Bytes as Uint8Array. */
725
+ bytes?: Uint8Array;
726
+ };
727
+ /**
728
+ * Display AI-generated or user-uploaded images from base64 / bytes / URL.
729
+ */
730
+ declare function AiImage({ data, mimeType, src, bytes, alt, className, ...props }: AiImageProps): React$1.JSX.Element | null;
731
+ //#endregion
732
+ //#region src/components/ai/format-duration.d.ts
733
+ /** Format elapsed ms for "Thought for …" / "Worked for …" labels. */
734
+ declare function formatDuration(ms: number): string;
735
+ //#endregion
736
+ export { ToolGroup as $, MessageContent as $t, PlanTrackerProps as A, SystemMessageProps as At, InlineDiff as B, ResponseStreamProps as Bt, TaskRow as C, Reasoning as Ct, ContextRingProps as D, STREAM_THROTTLE_MS as Dt, ContextRing as E, ThinkingBarProps as Et, DiffTableRowBase as F, ChatContainerContentProps as Ft, Sources as G, renderBasicMarkdown as Gt, lineDiff as H, CodeBlockProps as Ht, StreamToken as I, ChatContainerProps as It, ApprovalCardProps as J, MessageActionProps as Jt, SourcesProps as K, Message as Kt, StreamingText as L, useChatContainer as Lt, DiffTableAddedRow as M, ScrollButtonProps as Mt, DiffTableColumn as N, ChatContainer as Nt, formatCompact as O, useThrottledText as Ot, DiffTableProps as P, ChatContainerContent as Pt, Tool as Q, MessageAvatarProps as Qt, StreamingTextProps as R, ResponseStream as Rt, TaskListProps as S, ThinkingTraceRow as St, TaskStatus as T, ThinkingBar as Tt, Source as U, Markdown as Ut, InlineDiffProps as V, CodeBlock as Vt, SourceProps as W, MarkdownProps as Wt, ApprovalQuestion as X, MessageActionsProps as Xt, ApprovalOption as Y, MessageActions as Yt, StatusIcon as Z, MessageAvatar as Zt, ContextCardProps as _, PixelVariant as _n, Steps as _t, FileUploadProps as a, PromptInputActions as an, InlineDiffSource as at, TaskDetail as b, TextShimmerProps as bn, ThinkingTraceMode as bt, PromptSuggestions as c, PromptInputBodyProps as cn, PlanStep as ct, FeedbackBarProps as d, PromptInputTextareaProps as dn, normalizeToolStatus as dt, MessageContentProps as en, ToolGroupProps as et, FeedbackValue as f, usePromptInput as fn, ChainOfThought as ft, ContextCard as g, Loader as gn, StepStatus as gt, RecommendationOption as h, AgentLoaderVariant as hn, StepProps as ht, FileUpload as i, PromptInputActionProps as in, DiffFileChip as it, DiffTable as j, ScrollButton as jt, PlanTracker as k, SystemMessage as kt, PromptSuggestionsProps as l, PromptInputProps as ln, PlanStepStatus as lt, RecommendationCardProps as m, AgentLoaderProps as mn, Step as mt, AiImage as n, PromptInput as nn, ToolVariant as nt, PromptSuggestion as o, PromptInputActionsProps as on, NormalizedToolStatus as ot, RecommendationCard as p, AgentLoader as pn, ChainOfThoughtStep as pt, ApprovalCard as q, MessageAction as qt, AiImageProps as r, PromptInputAction as rn, ContextUsage as rt, PromptSuggestionProps as s, PromptInputBody as sn, Plan as st, formatDuration as t, MessageProps as tn, ToolProps as tt, FeedbackBar as u, PromptInputTextarea as un, ToolStatus as ut, ContextCards as v, SimpleVariant as vn, StepsProps as vt, TaskRowProps as w, ReasoningProps as wt, TaskList as x, ThinkingTraceProps as xt, ContextCardsProps as y, TextShimmer as yn, ThinkingTrace as yt, StreamingTextSource as z, ResponseStreamMode as zt };
737
+ //# sourceMappingURL=index-B0wXxIAb.d.ts.map