@mcp-b/react-components 0.2.2 → 0.3.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 (51) hide show
  1. package/dist/{CodeBlock-BrCoypnc.js → CodeBlock-C2Xjxu9M.js} +1 -1
  2. package/dist/FileTree-D0c9Yj9U.js +310 -0
  3. package/dist/PromptInput-Dzn-fOPc.d.ts +444 -0
  4. package/dist/components/Activity.js +1 -1
  5. package/dist/components/AgentChat.d.ts +19 -9
  6. package/dist/components/AgentChat.js +27 -24
  7. package/dist/components/AgentConnection.js +2 -2
  8. package/dist/components/Artifact.js +1 -1
  9. package/dist/components/BrowserLiveView.d.ts +47 -0
  10. package/dist/components/BrowserLiveView.js +135 -0
  11. package/dist/components/BrowserReplay.d.ts +40 -0
  12. package/dist/components/BrowserReplay.js +187 -0
  13. package/dist/components/ChainOfThought.d.ts +1 -1
  14. package/dist/components/ChainOfThought.js +1 -1
  15. package/dist/components/CodeBlock.js +1 -1
  16. package/dist/components/Commit.js +1 -1
  17. package/dist/components/ContextMenu.js +1 -1
  18. package/dist/components/Conversation.js +1 -1
  19. package/dist/components/Dialog.js +1 -1
  20. package/dist/components/EnvironmentVariables.js +1 -1
  21. package/dist/components/FileTree.js +1 -309
  22. package/dist/components/Menubar.js +1 -1
  23. package/dist/components/Message.d.ts +2 -1
  24. package/dist/components/Message.js +1 -1
  25. package/dist/components/ModelSelector.js +1 -1
  26. package/dist/components/NavigationMenu.js +1 -1
  27. package/dist/components/PricingPage.js +1 -1
  28. package/dist/components/PromptInput.d.ts +2 -399
  29. package/dist/components/PromptInput.js +177 -2
  30. package/dist/components/Queue.js +1 -1
  31. package/dist/components/Reasoning.js +1 -1
  32. package/dist/components/Select.js +1 -1
  33. package/dist/components/Sources.js +1 -1
  34. package/dist/components/Stepper.js +1 -1
  35. package/dist/components/Task.js +1 -1
  36. package/dist/components/Terminal.js +2 -2
  37. package/dist/components/TestResults.js +1 -1
  38. package/dist/components/ThinkChat.d.ts +186 -0
  39. package/dist/components/ThinkChat.js +730 -0
  40. package/dist/components/Tool.d.ts +32 -28
  41. package/dist/components/Tool.js +29 -16
  42. package/dist/components/WebPreview.js +1 -1
  43. package/dist/components/WorkspaceExplorer.d.ts +102 -0
  44. package/dist/components/WorkspaceExplorer.js +352 -0
  45. package/dist/components/icons.d.ts +2 -2
  46. package/dist/components/icons.js +2 -2
  47. package/dist/{copy-button-DAPlB8Z0.js → copy-button-Dd6DEhOm.js} +1 -1
  48. package/dist/{icons-Bf7JMKk-.js → icons-DQC4Zw5R.js} +5 -1
  49. package/dist/{icons-BklFyZbx.d.ts → icons-ctdVxng0.d.ts} +2 -1
  50. package/dist/styles/prompt-input.css +149 -0
  51. package/package.json +26 -3
@@ -1,399 +1,2 @@
1
- import { A as SelectTriggerProps, M as SelectValueProps, S as SelectProps, f as SelectOption, j as SelectValue, r as SelectContentProps, s as SelectItemProps, t as Select } from "../Select-CRsKCJ9x.js";
2
- import { c as ComboboxGroup, d as ComboboxLabel, f as ComboboxList, g as ComboboxTrigger, h as ComboboxSeparator, l as ComboboxInput, m as ComboboxPositioner, p as ComboboxPopup, s as ComboboxEmpty, t as Combobox, u as ComboboxItem } from "../Combobox-D9anamNr.js";
3
- import { h as MenuItemProps, w as MenuProps, y as MenuPopupProps } from "../Menu-B5vDqZe_.js";
4
- import { c as TabsList, n as TabPanel, t as Tab } from "../Tabs-D9EAq09D.js";
5
- import { r as ButtonProps } from "../Button-Ct5I6aTu.js";
6
- import * as React from "react";
7
-
8
- //#region src/components/PromptInput.d.ts
9
- interface PromptInputFilePart {
10
- type: "file";
11
- id?: string;
12
- filename?: string;
13
- mediaType?: string;
14
- url?: string;
15
- }
16
- interface PromptInputReferencedSource {
17
- id?: string;
18
- title?: string;
19
- url?: string;
20
- [key: string]: unknown;
21
- }
22
- /** The payload produced when the prompt input is submitted. */
23
- interface PromptInputMessage {
24
- text: string;
25
- files: PromptInputFilePart[];
26
- }
27
- /** Lifecycle status of an in-flight model request. */
28
- type PromptInputStatus = "ready" | "submitted" | "streaming" | "error";
29
- interface AttachmentsContext {
30
- files: Array<PromptInputFilePart & {
31
- id: string;
32
- }>;
33
- add: (files: File[] | FileList) => void;
34
- remove: (id: string) => void;
35
- clear: () => void;
36
- openFileDialog: () => void;
37
- fileInputRef: React.RefObject<HTMLInputElement | null>;
38
- }
39
- interface TextInputContext {
40
- value: string;
41
- setInput: (value: string) => void;
42
- clear: () => void;
43
- }
44
- interface PromptInputControllerProps {
45
- textInput: TextInputContext;
46
- attachments: AttachmentsContext;
47
- __registerFileInput: (ref: React.RefObject<HTMLInputElement | null>, open: () => void) => void;
48
- }
49
- interface ReferencedSourcesContext {
50
- sources: Array<PromptInputReferencedSource & {
51
- id: string;
52
- }>;
53
- add: (sources: PromptInputReferencedSource[] | PromptInputReferencedSource) => void;
54
- remove: (id: string) => void;
55
- clear: () => void;
56
- }
57
- declare function usePromptInputController(): PromptInputControllerProps;
58
- declare function useProviderAttachments(): AttachmentsContext;
59
- declare function usePromptInputAttachments(): AttachmentsContext;
60
- declare function usePromptInputReferencedSources(): ReferencedSourcesContext;
61
- interface PromptInputProviderProps extends React.PropsWithChildren {
62
- initialInput?: string;
63
- }
64
- declare function PromptInputProvider({
65
- initialInput,
66
- children
67
- }: PromptInputProviderProps): React.JSX.Element;
68
- interface PromptInputProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "onError"> {
69
- /** Accepted file MIME types/extensions, passed to the hidden file input. */
70
- accept?: string;
71
- /** Allows multiple files in a single file picker/drop action. */
72
- multiple?: boolean;
73
- /** Listen for file drops on the whole document instead of only the form. */
74
- globalDrop?: boolean;
75
- /** Clears the hidden file input when attachments are cleared. */
76
- syncHiddenInput?: boolean;
77
- /** Maximum number of attached files. */
78
- maxFiles?: number;
79
- /** Maximum accepted file size in bytes. */
80
- maxFileSize?: number;
81
- /** Called when file validation rejects an attachment. */
82
- onError?: (error: {
83
- code: "max_files" | "max_file_size" | "accept";
84
- message: string;
85
- }) => void;
86
- /** Called with the trimmed message text and files when the form is submitted. */
87
- onSubmit?: (message: PromptInputMessage, event: React.FormEvent<HTMLFormElement>) => void | Promise<void>;
88
- }
89
- /**
90
- * Chat-style composer form. Wraps a textarea and footer controls, with
91
- * Enter-to-submit semantics, auto-resizing behavior, and optional attachments.
92
- * Adapted from Vercel AI Elements and restyled with Sigvelo CSS tokens.
93
- *
94
- * Use for assistant/chat submit forms. Do not use it as a generic textarea or
95
- * non-chat form. Sigvelo changes: uses shared Menu, Select, Combobox, Tabs,
96
- * Button, and Tooltip components; maps styles to CSS tokens; adds local
97
- * attachment and referenced-source helpers.
98
- *
99
- * The form handles Enter-to-submit while multiline editing remains in the
100
- * textarea. Attachment controls need accessible labels through their buttons
101
- * and menus. Add new shared tools here when multiple apps need them.
102
- *
103
- * @example
104
- * ```tsx
105
- * <PromptInput onSubmit={({ text, files }) => sendMessage(text, files)}>
106
- * <PromptInputBody>
107
- * <PromptInputTextarea placeholder="Ask Sigvelo..." />
108
- * </PromptInputBody>
109
- * <PromptInputFooter>
110
- * <PromptInputTools>
111
- * <PromptInputActionAddAttachments />
112
- * </PromptInputTools>
113
- * <PromptInputSubmit status="ready" />
114
- * </PromptInputFooter>
115
- * </PromptInput>
116
- * ```
117
- *
118
- * @see {@link https://elements.ai-sdk.dev/components/prompt-input | AI Elements Prompt Input}
119
- */
120
- declare function PromptInput({
121
- className,
122
- accept,
123
- multiple,
124
- globalDrop,
125
- syncHiddenInput,
126
- maxFiles,
127
- maxFileSize,
128
- onError,
129
- onSubmit,
130
- children,
131
- id,
132
- ref,
133
- ...props
134
- }: PromptInputProps & {
135
- ref?: React.Ref<HTMLFormElement>;
136
- }): React.JSX.Element;
137
- interface PromptInputHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
138
- declare function PromptInputHeader({
139
- className,
140
- children,
141
- ref,
142
- ...props
143
- }: PromptInputHeaderProps & {
144
- ref?: React.Ref<HTMLDivElement>;
145
- }): React.JSX.Element;
146
- interface PromptInputBodyProps extends React.HTMLAttributes<HTMLDivElement> {}
147
- declare function PromptInputBody({
148
- className,
149
- children,
150
- ref,
151
- ...props
152
- }: PromptInputBodyProps & {
153
- ref?: React.Ref<HTMLDivElement>;
154
- }): React.JSX.Element;
155
- interface PromptInputFooterProps extends React.HTMLAttributes<HTMLDivElement> {}
156
- declare function PromptInputFooter({
157
- className,
158
- children,
159
- ref,
160
- ...props
161
- }: PromptInputFooterProps & {
162
- ref?: React.Ref<HTMLDivElement>;
163
- }): React.JSX.Element;
164
- interface PromptInputToolsProps extends React.HTMLAttributes<HTMLDivElement> {}
165
- declare function PromptInputTools({
166
- className,
167
- children,
168
- ref,
169
- ...props
170
- }: PromptInputToolsProps & {
171
- ref?: React.Ref<HTMLDivElement>;
172
- }): React.JSX.Element;
173
- interface PromptInputTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
174
- minHeight?: number;
175
- maxHeight?: number;
176
- }
177
- declare function PromptInputTextarea({
178
- className,
179
- placeholder,
180
- rows,
181
- minHeight,
182
- maxHeight,
183
- onChange,
184
- onCompositionEnd,
185
- onCompositionStart,
186
- onKeyDown,
187
- onInput,
188
- onPaste,
189
- ref,
190
- ...props
191
- }: PromptInputTextareaProps & {
192
- ref?: React.Ref<HTMLTextAreaElement>;
193
- }): React.JSX.Element;
194
- type TooltipSide = "top" | "right" | "bottom" | "left";
195
- type PromptInputButtonTooltip = string | {
196
- content: React.ReactNode;
197
- shortcut?: string;
198
- side?: TooltipSide;
199
- };
200
- type PromptInputTooltipConfig = Exclude<PromptInputButtonTooltip, string>;
201
- interface PromptInputButtonProps extends Omit<ButtonProps, "children" | "className"> {
202
- className?: string;
203
- tooltip?: PromptInputButtonTooltip;
204
- children?: React.ReactNode;
205
- }
206
- declare function PromptInputButton({
207
- className,
208
- tooltip,
209
- variant,
210
- color,
211
- size,
212
- children,
213
- "aria-label": ariaLabel,
214
- ref,
215
- ...props
216
- }: PromptInputButtonProps & {
217
- ref?: React.Ref<HTMLButtonElement>;
218
- }): React.JSX.Element;
219
- type PromptInputActionMenuProps = MenuProps;
220
- declare function PromptInputActionMenu(props: PromptInputActionMenuProps): React.JSX.Element;
221
- type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
222
- declare function PromptInputActionMenuTrigger({
223
- className,
224
- children,
225
- ...props
226
- }: PromptInputActionMenuTriggerProps): React.JSX.Element;
227
- type PromptInputActionMenuContentProps = MenuPopupProps;
228
- declare function PromptInputActionMenuContent({
229
- className,
230
- children,
231
- ...props
232
- }: PromptInputActionMenuContentProps): React.JSX.Element;
233
- type PromptInputActionMenuItemProps = MenuItemProps;
234
- declare function PromptInputActionMenuItem({
235
- className,
236
- ...props
237
- }: PromptInputActionMenuItemProps): React.JSX.Element;
238
- interface PromptInputActionAddAttachmentsProps extends PromptInputActionMenuItemProps {
239
- label?: string;
240
- }
241
- declare function PromptInputActionAddAttachments({
242
- label,
243
- onClick,
244
- children,
245
- ...props
246
- }: PromptInputActionAddAttachmentsProps): React.JSX.Element;
247
- interface PromptInputActionAddScreenshotProps extends PromptInputActionMenuItemProps {
248
- label?: string;
249
- }
250
- declare function PromptInputActionAddScreenshot({
251
- label,
252
- onClick,
253
- children,
254
- ...props
255
- }: PromptInputActionAddScreenshotProps): React.JSX.Element;
256
- interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "className" | "type"> {
257
- className?: string;
258
- status?: PromptInputStatus;
259
- onStop?: () => void;
260
- children?: React.ReactNode;
261
- label?: string;
262
- }
263
- declare function PromptInputSubmit({
264
- className,
265
- status,
266
- onStop,
267
- variant,
268
- color,
269
- size,
270
- onClick,
271
- children,
272
- label,
273
- ref,
274
- ...props
275
- }: PromptInputSubmitProps & {
276
- ref?: React.Ref<HTMLButtonElement>;
277
- }): React.JSX.Element;
278
- type PromptInputSelectProps = SelectProps;
279
- declare const PromptInputSelect: typeof Select;
280
- type PromptInputSelectTriggerProps = SelectTriggerProps;
281
- declare function PromptInputSelectTrigger(props: PromptInputSelectTriggerProps): React.JSX.Element;
282
- type PromptInputSelectContentProps = SelectContentProps;
283
- declare function PromptInputSelectContent(props: PromptInputSelectContentProps): React.JSX.Element;
284
- type PromptInputSelectItemProps = SelectItemProps;
285
- declare const PromptInputSelectItem: typeof SelectOption;
286
- type PromptInputSelectValueProps = SelectValueProps;
287
- declare const PromptInputSelectValue: typeof SelectValue;
288
- interface PromptInputHoverCardProps extends React.HTMLAttributes<HTMLDivElement> {
289
- openDelay?: number;
290
- closeDelay?: number;
291
- }
292
- declare function PromptInputHoverCard({
293
- openDelay,
294
- closeDelay,
295
- className,
296
- children,
297
- ref,
298
- ...props
299
- }: PromptInputHoverCardProps & {
300
- ref?: React.Ref<HTMLDivElement>;
301
- }): React.JSX.Element;
302
- interface PromptInputHoverCardTriggerProps extends React.HTMLAttributes<HTMLSpanElement> {}
303
- declare function PromptInputHoverCardTrigger({
304
- className,
305
- ref,
306
- ...props
307
- }: PromptInputHoverCardTriggerProps & {
308
- ref?: React.Ref<HTMLSpanElement>;
309
- }): React.JSX.Element;
310
- interface PromptInputHoverCardContentProps extends React.HTMLAttributes<HTMLDivElement> {}
311
- declare function PromptInputHoverCardContent({
312
- className,
313
- ref,
314
- ...props
315
- }: PromptInputHoverCardContentProps & {
316
- ref?: React.Ref<HTMLDivElement>;
317
- }): React.JSX.Element | null;
318
- type PromptInputTabsListProps = React.ComponentPropsWithoutRef<typeof TabsList>;
319
- declare const PromptInputTabsList: typeof TabsList;
320
- type PromptInputTabProps = React.ComponentPropsWithoutRef<typeof Tab>;
321
- declare const PromptInputTab: typeof Tab;
322
- type PromptInputTabBodyProps = React.ComponentPropsWithoutRef<typeof TabPanel>;
323
- declare const PromptInputTabBody: typeof TabPanel;
324
- interface PromptInputTabLabelProps extends React.HTMLAttributes<HTMLHeadingElement> {}
325
- declare function PromptInputTabLabel({
326
- className,
327
- ref,
328
- ...props
329
- }: PromptInputTabLabelProps & {
330
- ref?: React.Ref<HTMLHeadingElement>;
331
- }): React.JSX.Element;
332
- interface PromptInputTabItemProps extends React.HTMLAttributes<HTMLDivElement> {}
333
- declare function PromptInputTabItem({
334
- className,
335
- ref,
336
- ...props
337
- }: PromptInputTabItemProps & {
338
- ref?: React.Ref<HTMLDivElement>;
339
- }): React.JSX.Element;
340
- type PromptInputCommandProps = React.ComponentPropsWithoutRef<typeof Combobox>;
341
- declare const PromptInputCommand: typeof import("@base-ui/react").ComboboxRoot & {
342
- Root: typeof import("@base-ui/react").ComboboxRoot;
343
- Input: typeof ComboboxInput;
344
- Trigger: typeof ComboboxTrigger;
345
- Clear: ({
346
- className,
347
- ref,
348
- ...props
349
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear>, "className"> & {
350
- className?: string;
351
- } & {
352
- ref?: React.Ref<HTMLButtonElement>;
353
- }) => React.JSX.Element;
354
- Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
355
- Positioner: typeof ComboboxPositioner;
356
- Popup: typeof ComboboxPopup;
357
- Content: typeof ComboboxPopup;
358
- List: typeof ComboboxList;
359
- Item: typeof ComboboxItem;
360
- ItemIndicator: ({
361
- className,
362
- ref,
363
- ...props
364
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator>, "className"> & {
365
- className?: string;
366
- } & {
367
- ref?: React.Ref<HTMLSpanElement>;
368
- }) => React.JSX.Element;
369
- Empty: typeof ComboboxEmpty;
370
- Group: typeof ComboboxGroup;
371
- GroupLabel: typeof ComboboxLabel;
372
- Label: typeof ComboboxLabel;
373
- Value: typeof import("@base-ui/react").ComboboxValue;
374
- Chips: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
375
- Chip: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
376
- ChipsInput: typeof ComboboxInput;
377
- Collection: typeof import("@base-ui/react").ComboboxCollection;
378
- Separator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
379
- };
380
- type PromptInputCommandInputProps = React.ComponentPropsWithoutRef<typeof ComboboxInput>;
381
- declare const PromptInputCommandInput: typeof ComboboxInput;
382
- interface PromptInputCommandListProps extends React.HTMLAttributes<HTMLDivElement> {}
383
- declare function PromptInputCommandList({
384
- className,
385
- ref,
386
- ...props
387
- }: PromptInputCommandListProps & {
388
- ref?: React.Ref<HTMLDivElement>;
389
- }): React.JSX.Element;
390
- type PromptInputCommandEmptyProps = React.ComponentPropsWithoutRef<typeof ComboboxEmpty>;
391
- declare const PromptInputCommandEmpty: typeof ComboboxEmpty;
392
- type PromptInputCommandGroupProps = React.ComponentPropsWithoutRef<typeof ComboboxGroup>;
393
- declare const PromptInputCommandGroup: typeof ComboboxGroup;
394
- type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof ComboboxItem>;
395
- declare const PromptInputCommandItem: typeof ComboboxItem;
396
- type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof ComboboxSeparator>;
397
- declare const PromptInputCommandSeparator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
398
- //#endregion
399
- export { AttachmentsContext, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputControllerProps, PromptInputFilePart, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReferencedSource, PromptInputSelect, PromptInputSelectContent, PromptInputSelectContentProps, PromptInputSelectItem, PromptInputSelectItemProps, PromptInputSelectProps, PromptInputSelectTrigger, PromptInputSelectTriggerProps, PromptInputSelectValue, PromptInputSelectValueProps, PromptInputStatus, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, ReferencedSourcesContext, TextInputContext, TooltipSide, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
1
+ import { $ as PromptInputProviderProps, A as PromptInputCommandInputProps, At as TextInputContext, B as PromptInputFooter, C as PromptInputButtonTooltip, Ct as PromptInputTabsListProps, D as PromptInputCommandGroup, Dt as PromptInputToolsProps, E as PromptInputCommandEmptyProps, Et as PromptInputTools, F as PromptInputCommandProps, Ft as usePromptInputReferencedSources, G as PromptInputHoverCardContent, H as PromptInputHeader, I as PromptInputCommandSeparator, It as useProviderAttachments, J as PromptInputHoverCardTrigger, K as PromptInputHoverCardContentProps, L as PromptInputCommandSeparatorProps, M as PromptInputCommandItemProps, Mt as getPendingToolApprovals, N as PromptInputCommandList, Nt as usePromptInputAttachments, O as PromptInputCommandGroupProps, Ot as PromptInputTooltipConfig, P as PromptInputCommandListProps, Pt as usePromptInputController, Q as PromptInputProvider, R as PromptInputControllerProps, S as PromptInputButtonProps, St as PromptInputTabsList, T as PromptInputCommandEmpty, Tt as PromptInputTextareaProps, U as PromptInputHeaderProps, V as PromptInputFooterProps, W as PromptInputHoverCard, X as PromptInputMessage, Y as PromptInputHoverCardTriggerProps, Z as PromptInputProps, _ as PromptInputApproval, _t as PromptInputTabItem, a as PromptInputActionAddAttachments, at as PromptInputSelectItemProps, b as PromptInputBodyProps, bt as PromptInputTabLabelProps, c as PromptInputActionAddScreenshotProps, ct as PromptInputSelectTriggerProps, d as PromptInputActionMenuContentProps, dt as PromptInputStatus, et as PromptInputReferencedSource, f as PromptInputActionMenuItem, ft as PromptInputSubmit, g as PromptInputActionMenuTriggerProps, gt as PromptInputTabBodyProps, h as PromptInputActionMenuTrigger, ht as PromptInputTabBody, i as PromptInput, it as PromptInputSelectItem, j as PromptInputCommandItem, jt as TooltipSide, k as PromptInputCommandInput, kt as ReferencedSourcesContext, l as PromptInputActionMenu, lt as PromptInputSelectValue, m as PromptInputActionMenuProps, mt as PromptInputTab, n as AttachmentsContext, nt as PromptInputSelectContent, o as PromptInputActionAddAttachmentsProps, ot as PromptInputSelectProps, p as PromptInputActionMenuItemProps, pt as PromptInputSubmitProps, q as PromptInputHoverCardProps, r as PendingToolApproval, rt as PromptInputSelectContentProps, s as PromptInputActionAddScreenshot, st as PromptInputSelectTrigger, t as ApprovalToolPart, tt as PromptInputSelect, u as PromptInputActionMenuContent, ut as PromptInputSelectValueProps, v as PromptInputApprovalProps, vt as PromptInputTabItemProps, w as PromptInputCommand, wt as PromptInputTextarea, x as PromptInputButton, xt as PromptInputTabProps, y as PromptInputBody, yt as PromptInputTabLabel, z as PromptInputFilePart } from "../PromptInput-Dzn-fOPc.js";
2
+ export { ApprovalToolPart, AttachmentsContext, PendingToolApproval, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputControllerProps, PromptInputFilePart, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReferencedSource, PromptInputSelect, PromptInputSelectContent, PromptInputSelectContentProps, PromptInputSelectItem, PromptInputSelectItemProps, PromptInputSelectProps, PromptInputSelectTrigger, PromptInputSelectTriggerProps, PromptInputSelectValue, PromptInputSelectValueProps, PromptInputStatus, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, ReferencedSourcesContext, TextInputContext, TooltipSide, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { A as SquareIcon, C as MonitorIcon, E as PlusIcon, M as WarningIcon, i as ArrowUpIcon, k as SpinnerIcon, v as ImageIcon } from "../icons-Bf7JMKk-.js";
2
+ import { A as SpinnerIcon, C as MonitorIcon, D as PlusIcon, N as WarningIcon, T as PencilIcon, i as ArrowUpIcon, j as SquareIcon, v as ImageIcon } from "../icons-DQC4Zw5R.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
5
5
  import { Combobox, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator } from "./Combobox.js";
@@ -8,6 +8,7 @@ import { Select, SelectContent, SelectItem, SelectPortal, SelectPositioner, Sele
8
8
  import { Tab, TabPanel, TabsList } from "./Tabs.js";
9
9
  import * as React from "react";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { getToolName, isToolOrDynamicToolUIPart } from "ai";
11
12
  //#region src/components/PromptInput.tsx
12
13
  const PromptInputContext = React.createContext(null);
13
14
  const PromptInputController = React.createContext(null);
@@ -548,6 +549,180 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
548
549
  children: children ?? defaultSubmitIcon(status)
549
550
  });
550
551
  }
552
+ /** Derives pending tool approvals straight from the messages — no app-owned shapes. */
553
+ function getPendingToolApprovals(messages) {
554
+ const pending = [];
555
+ messages.forEach((message, messageIndex) => {
556
+ message.parts.forEach((part, partIndex) => {
557
+ if (isToolOrDynamicToolUIPart(part) && part.state === "approval-requested") pending.push({
558
+ message,
559
+ messageIndex,
560
+ part,
561
+ partIndex
562
+ });
563
+ });
564
+ });
565
+ return pending;
566
+ }
567
+ function formatApprovalValue(value) {
568
+ if (typeof value === "string") return value;
569
+ return JSON.stringify(value);
570
+ }
571
+ /**
572
+ * The composer's approval state: when a tool call awaits human approval the
573
+ * prompt input area becomes the confirmation. "Yes" approves on click; typing
574
+ * in the "No, and tell the agent what to do differently" row selects deny and
575
+ * sends the text as the native approval `reason`. Submit (or Enter) sends the
576
+ * current selection — approve by default.
577
+ */
578
+ function PromptInputApproval({ part, onRespond, onSkip, question, count, className, ref, ...props }) {
579
+ const [selected, setSelected] = React.useState("approve");
580
+ const [reason, setReason] = React.useState("");
581
+ const [busy, setBusy] = React.useState(false);
582
+ const yesRef = React.useRef(null);
583
+ const reasonRef = React.useRef(null);
584
+ const approval = part.state === "approval-requested" ? part.approval : void 0;
585
+ const approvalId = approval?.id;
586
+ React.useEffect(() => {
587
+ setSelected("approve");
588
+ setReason("");
589
+ setBusy(false);
590
+ }, [approvalId]);
591
+ if (!approval) return null;
592
+ const toolName = getToolName(part);
593
+ const respond = (approved) => {
594
+ if (busy) return;
595
+ setBusy(true);
596
+ const trimmed = reason.trim();
597
+ onRespond({
598
+ id: approval.id,
599
+ approved,
600
+ reason: !approved && trimmed ? trimmed : void 0
601
+ });
602
+ };
603
+ const submit = () => respond(selected === "approve");
604
+ const input = "input" in part ? part.input : void 0;
605
+ const inputEntries = input && typeof input === "object" && !Array.isArray(input) ? Object.entries(input) : void 0;
606
+ return /* @__PURE__ */ jsxs("div", {
607
+ ref,
608
+ role: "group",
609
+ "aria-label": `Approve ${toolName}`,
610
+ className: cx("prompt-input__approval", className),
611
+ onKeyDown: (event) => {
612
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
613
+ event.preventDefault();
614
+ (selected === "approve" ? reasonRef : yesRef).current?.focus();
615
+ } else if (event.key === "1" && event.target !== reasonRef.current) yesRef.current?.focus();
616
+ },
617
+ ...props,
618
+ children: [
619
+ /* @__PURE__ */ jsxs("div", {
620
+ className: "prompt-input__approval-question",
621
+ children: [/* @__PURE__ */ jsx("span", { children: question ?? /* @__PURE__ */ jsxs(Fragment, { children: [
622
+ "Do you want to allow the agent to run ",
623
+ /* @__PURE__ */ jsx("code", { children: toolName }),
624
+ "?"
625
+ ] }) }), count && count > 1 ? /* @__PURE__ */ jsxs("span", {
626
+ className: "prompt-input__approval-count",
627
+ children: ["1 of ", count]
628
+ }) : null]
629
+ }),
630
+ input !== void 0 ? /* @__PURE__ */ jsx("div", {
631
+ className: "prompt-input__approval-preview",
632
+ children: inputEntries ? inputEntries.map(([key, value]) => /* @__PURE__ */ jsxs("div", {
633
+ className: "prompt-input__approval-preview-row",
634
+ children: [
635
+ /* @__PURE__ */ jsx("span", {
636
+ className: "prompt-input__approval-preview-key",
637
+ children: key
638
+ }),
639
+ " ",
640
+ formatApprovalValue(value)
641
+ ]
642
+ }, key)) : /* @__PURE__ */ jsx("div", {
643
+ className: "prompt-input__approval-preview-row",
644
+ children: formatApprovalValue(input)
645
+ })
646
+ }) : null,
647
+ /* @__PURE__ */ jsxs("div", {
648
+ className: "prompt-input__approval-options",
649
+ children: [/* @__PURE__ */ jsxs("button", {
650
+ ref: yesRef,
651
+ type: "button",
652
+ className: "prompt-input__approval-option",
653
+ "data-selected": selected === "approve" || void 0,
654
+ disabled: busy,
655
+ onClick: () => respond(true),
656
+ onFocus: () => setSelected("approve"),
657
+ children: [
658
+ /* @__PURE__ */ jsx("span", {
659
+ className: "prompt-input__approval-key",
660
+ children: "1"
661
+ }),
662
+ "Yes",
663
+ /* @__PURE__ */ jsx("span", {
664
+ className: "prompt-input__approval-arrows",
665
+ "aria-hidden": "true",
666
+ children: "↑↓"
667
+ })
668
+ ]
669
+ }), /* @__PURE__ */ jsxs("div", {
670
+ className: "prompt-input__approval-option prompt-input__approval-deny",
671
+ "data-selected": selected === "deny" || void 0,
672
+ children: [
673
+ /* @__PURE__ */ jsx("span", {
674
+ className: "prompt-input__approval-key",
675
+ "aria-hidden": "true",
676
+ children: /* @__PURE__ */ jsx(PencilIcon, { size: 11 })
677
+ }),
678
+ /* @__PURE__ */ jsx("input", {
679
+ ref: reasonRef,
680
+ type: "text",
681
+ className: "prompt-input__approval-reason",
682
+ "aria-label": `Deny ${toolName} and tell the agent what to do differently`,
683
+ placeholder: "No, and tell the agent what to do differently",
684
+ value: reason,
685
+ disabled: busy,
686
+ onFocus: () => setSelected("deny"),
687
+ onChange: (event) => {
688
+ setSelected("deny");
689
+ setReason(event.currentTarget.value);
690
+ },
691
+ onKeyDown: (event) => {
692
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
693
+ event.preventDefault();
694
+ respond(false);
695
+ }
696
+ }
697
+ }),
698
+ onSkip ? /* @__PURE__ */ jsx(Button, {
699
+ type: "button",
700
+ size: "sm",
701
+ variant: "ghost",
702
+ color: "neutral",
703
+ className: "prompt-input__approval-skip",
704
+ disabled: busy,
705
+ onClick: onSkip,
706
+ children: "Skip"
707
+ }) : null,
708
+ /* @__PURE__ */ jsxs(Button, {
709
+ type: "button",
710
+ size: "sm",
711
+ color: "primary",
712
+ className: "prompt-input__approval-submit",
713
+ disabled: busy,
714
+ onClick: submit,
715
+ children: [selected === "approve" ? "Approve" : "Submit", /* @__PURE__ */ jsx("kbd", {
716
+ className: "prompt-input__approval-kbd",
717
+ children: "⏎"
718
+ })]
719
+ })
720
+ ]
721
+ })]
722
+ })
723
+ ]
724
+ });
725
+ }
551
726
  const PromptInputSelect = Select;
552
727
  function PromptInputSelectTrigger(props) {
553
728
  return /* @__PURE__ */ jsx(SelectTrigger, { ...props });
@@ -734,4 +909,4 @@ function createId() {
734
909
  return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
735
910
  }
736
911
  //#endregion
737
- export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputProvider, PromptInputSelect, PromptInputSelectContent, PromptInputSelectItem, PromptInputSelectTrigger, PromptInputSelectValue, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
912
+ export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputProvider, PromptInputSelect, PromptInputSelectContent, PromptInputSelectItem, PromptInputSelectTrigger, PromptInputSelectValue, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { d as DotIcon, h as FileIcon, l as ChevronRightIcon, o as CheckIcon } from "../icons-Bf7JMKk-.js";
3
+ import { d as DotIcon, h as FileIcon, l as ChevronRightIcon, o as CheckIcon } from "../icons-DQC4Zw5R.js";
4
4
  import { Button } from "./Button.js";
5
5
  import { Badge } from "./Badge.js";
6
6
  import { ScrollArea } from "./ScrollArea.js";
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { a as BrainIcon, l as ChevronRightIcon } from "../icons-Bf7JMKk-.js";
3
+ import { a as BrainIcon, l as ChevronRightIcon } from "../icons-DQC4Zw5R.js";
4
4
  import * as React from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { cjk } from "@streamdown/cjk";
@@ -1,4 +1,4 @@
1
- import { i as ArrowUpIcon, o as CheckIcon, t as ArrowDownIcon } from "../icons-Bf7JMKk-.js";
1
+ import { i as ArrowUpIcon, o as CheckIcon, t as ArrowDownIcon } from "../icons-DQC4Zw5R.js";
2
2
  import * as React from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Select as Select$1 } from "@base-ui/react/select";
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { b as LinkIcon, l as ChevronRightIcon } from "../icons-Bf7JMKk-.js";
3
+ import { b as LinkIcon, l as ChevronRightIcon } from "../icons-DQC4Zw5R.js";
4
4
  import "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/Sources.tsx
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { k as SpinnerIcon, o as CheckIcon } from "../icons-Bf7JMKk-.js";
2
+ import { A as SpinnerIcon, o as CheckIcon } from "../icons-DQC4Zw5R.js";
3
3
  import * as React from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/components/Stepper.tsx
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { O as SearchIcon, h as FileIcon, l as ChevronRightIcon } from "../icons-Bf7JMKk-.js";
3
+ import { h as FileIcon, k as SearchIcon, l as ChevronRightIcon } from "../icons-DQC4Zw5R.js";
4
4
  import "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/Task.tsx