@mcp-b/react-components 0.6.5 → 0.7.1

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 (91) hide show
  1. package/dist/AgentChat-403mckDG.d.ts +101 -0
  2. package/dist/BrowserLiveView-ZktFZiMD.d.ts +47 -0
  3. package/dist/BrowserReplay-6G-mnwcn.d.ts +40 -0
  4. package/dist/{CodeBlock-BK0sOAbV.js → CodeBlock-D9koxDA7.js} +1 -1
  5. package/dist/{FileTree-BWQZ0FSi.js → FileTree-BdK93Uuu.js} +1 -1
  6. package/dist/ModelSelector-MQvK-pNb.js +306 -0
  7. package/dist/PromptInput-D6-G24p7.d.ts +528 -0
  8. package/dist/ThinkChatActivity-CeHzk6-K.d.ts +73 -0
  9. package/dist/ThinkChatContext-CC94HL4u.d.ts +28 -0
  10. package/dist/ThinkChatToolParts-DnUiZgCC.d.ts +83 -0
  11. package/dist/components/Activity.js +1 -1
  12. package/dist/components/AgentChat.d.ts +1 -103
  13. package/dist/components/AgentChat.js +77 -58
  14. package/dist/components/AgentConnection.d.ts +43 -2
  15. package/dist/components/AgentConnection.js +154 -3
  16. package/dist/components/Artifact.js +1 -1
  17. package/dist/components/BrowserLiveView.d.ts +1 -46
  18. package/dist/components/BrowserLiveView.js +1 -1
  19. package/dist/components/BrowserReplay.d.ts +1 -39
  20. package/dist/components/BrowserReplay.js +1 -1
  21. package/dist/components/ChainOfThought.d.ts +1 -1
  22. package/dist/components/ChainOfThought.js +1 -1
  23. package/dist/components/ChatGptSignInScreen.d.ts +38 -0
  24. package/dist/components/ChatGptSignInScreen.js +201 -0
  25. package/dist/components/CodeBlock.js +1 -1
  26. package/dist/components/Commit.js +1 -1
  27. package/dist/components/Context.d.ts +6 -10
  28. package/dist/components/Context.js +4 -2
  29. package/dist/components/ContextMenu.js +1 -1
  30. package/dist/components/Conversation.d.ts +28 -28
  31. package/dist/components/Conversation.js +36 -55
  32. package/dist/components/Dialog.js +1 -1
  33. package/dist/components/EnvironmentVariables.js +1 -1
  34. package/dist/components/FileTree.js +1 -1
  35. package/dist/components/Marker.d.ts +57 -0
  36. package/dist/components/Marker.js +89 -0
  37. package/dist/components/McpServerPicker.js +1 -1
  38. package/dist/components/Menubar.js +1 -1
  39. package/dist/components/Message.js +1 -1
  40. package/dist/components/MessageScroller.d.ts +52 -0
  41. package/dist/components/MessageScroller.js +62 -0
  42. package/dist/components/ModelSelector.js +1 -305
  43. package/dist/components/NavigationMenu.js +1 -1
  44. package/dist/components/PromptInput.d.ts +2 -534
  45. package/dist/components/PromptInput.js +18 -12
  46. package/dist/components/Queue.js +1 -1
  47. package/dist/components/Reasoning.js +1 -1
  48. package/dist/components/Select.js +1 -1
  49. package/dist/components/Sources.js +1 -1
  50. package/dist/components/Stepper.js +1 -1
  51. package/dist/components/Task.js +1 -1
  52. package/dist/components/Terminal.js +2 -2
  53. package/dist/components/TestResults.js +1 -1
  54. package/dist/components/ThinkChat.d.ts +23 -80
  55. package/dist/components/ThinkChat.js +60 -857
  56. package/dist/components/ThinkChatActivity.d.ts +3 -0
  57. package/dist/components/ThinkChatActivity.js +429 -0
  58. package/dist/components/ThinkChatContext.d.ts +2 -0
  59. package/dist/components/ThinkChatContext.js +10 -0
  60. package/dist/components/ThinkChatToolPanels.d.ts +39 -0
  61. package/dist/components/ThinkChatToolPanels.js +355 -0
  62. package/dist/components/ThinkChatToolParts.d.ts +2 -0
  63. package/dist/components/ThinkChatToolParts.js +66 -0
  64. package/dist/components/ThinkFullApp.d.ts +23 -0
  65. package/dist/components/ThinkFullApp.js +175 -0
  66. package/dist/components/WebPreview.js +1 -1
  67. package/dist/components/WorkspaceExplorer.d.ts +1 -1
  68. package/dist/components/WorkspaceExplorer.js +3 -3
  69. package/dist/components/icons.d.ts +2 -2
  70. package/dist/components/icons.js +2 -2
  71. package/dist/components/useStickToBottom.d.ts +5 -2
  72. package/dist/components/useStickToBottom.js +5 -2
  73. package/dist/{copy-button-CB2MWcau.js → copy-button-TVhDAroI.js} +1 -1
  74. package/dist/{icons-BCNawx-T.js → icons-BAlTbWWP.js} +27 -1
  75. package/dist/{icons-BYpJY6L2.d.ts → icons-BRI54ATJ.d.ts} +2 -1
  76. package/dist/styles/agent-chat.css +15 -3
  77. package/dist/styles/agent-connection.css +33 -4
  78. package/dist/styles/chatgpt-sign-in-screen.css +224 -0
  79. package/dist/styles/code-block.css +6 -4
  80. package/dist/styles/conversation.css +10 -0
  81. package/dist/styles/index.css +4 -0
  82. package/dist/styles/marker.css +95 -0
  83. package/dist/styles/message-scroller.css +113 -0
  84. package/dist/styles/message.css +2 -1
  85. package/dist/styles/prompt-input.css +1 -0
  86. package/dist/styles/scrollbars.css +10 -2
  87. package/dist/styles/streamdown.css +2 -0
  88. package/dist/styles/think-full-app.css +318 -0
  89. package/dist/utils/mcp-server-catalog.d.ts +23 -1
  90. package/dist/utils/mcp-server-catalog.js +27 -1
  91. package/package.json +3 -2
@@ -1,534 +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, l as MenuContentProps, w as MenuProps } 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
- import { ChatAddToolApproveResponseFunction, ChatStatus, DynamicToolUIPart, FileUIPart, ToolUIPart, UIMessage } from "ai";
8
-
9
- //#region src/components/PromptInput.d.ts
10
- /**
11
- * The AI SDK's `FileUIPart`, taken whole — an attachment IS the `file` part
12
- * that ends up on the sent message, so submitted files feed straight into
13
- * `sendMessage({ text, files })`.
14
- */
15
- type PromptInputFilePart = FileUIPart;
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 — the AI SDK's `ChatStatus`. */
28
- type PromptInputStatus = ChatStatus;
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 PromptInputAttachmentProps extends React.HTMLAttributes<HTMLDivElement> {
147
- /** The pending attachment — the AI SDK `file` part plus the local list id. */
148
- file: PromptInputFilePart & {
149
- id: string;
150
- };
151
- }
152
- /**
153
- * One pending attachment chip: image files show a thumbnail, everything else
154
- * a file icon and name. The corner button removes it from the pending list.
155
- */
156
- declare function PromptInputAttachment({
157
- file,
158
- className,
159
- ref,
160
- ...props
161
- }: PromptInputAttachmentProps & {
162
- ref?: React.Ref<HTMLDivElement>;
163
- }): React.JSX.Element;
164
- interface PromptInputAttachmentsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
165
- /** Override chip rendering per attachment. */
166
- children?: (file: PromptInputFilePart & {
167
- id: string;
168
- }) => React.ReactNode;
169
- }
170
- /**
171
- * The pending-attachment chip row. Renders nothing while the list is empty,
172
- * so it can sit in the composer unconditionally — files added via the file
173
- * dialog, paste, or drop appear here until submit sends and clears them.
174
- */
175
- declare function PromptInputAttachments({
176
- className,
177
- children,
178
- ref,
179
- ...props
180
- }: PromptInputAttachmentsProps & {
181
- ref?: React.Ref<HTMLDivElement>;
182
- }): React.JSX.Element | null;
183
- interface PromptInputBodyProps extends React.HTMLAttributes<HTMLDivElement> {}
184
- declare function PromptInputBody({
185
- className,
186
- children,
187
- ref,
188
- ...props
189
- }: PromptInputBodyProps & {
190
- ref?: React.Ref<HTMLDivElement>;
191
- }): React.JSX.Element;
192
- interface PromptInputFooterProps extends React.HTMLAttributes<HTMLDivElement> {}
193
- declare function PromptInputFooter({
194
- className,
195
- children,
196
- ref,
197
- ...props
198
- }: PromptInputFooterProps & {
199
- ref?: React.Ref<HTMLDivElement>;
200
- }): React.JSX.Element;
201
- interface PromptInputToolsProps extends React.HTMLAttributes<HTMLDivElement> {}
202
- declare function PromptInputTools({
203
- className,
204
- children,
205
- ref,
206
- ...props
207
- }: PromptInputToolsProps & {
208
- ref?: React.Ref<HTMLDivElement>;
209
- }): React.JSX.Element;
210
- interface PromptInputTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
211
- minHeight?: number;
212
- maxHeight?: number;
213
- }
214
- declare function PromptInputTextarea({
215
- className,
216
- placeholder,
217
- rows,
218
- minHeight,
219
- maxHeight,
220
- onChange,
221
- onCompositionEnd,
222
- onCompositionStart,
223
- onKeyDown,
224
- onInput,
225
- onPaste,
226
- ref,
227
- ...props
228
- }: PromptInputTextareaProps & {
229
- ref?: React.Ref<HTMLTextAreaElement>;
230
- }): React.JSX.Element;
231
- type TooltipSide = "top" | "right" | "bottom" | "left";
232
- type PromptInputButtonTooltip = string | {
233
- content: React.ReactNode;
234
- shortcut?: string;
235
- side?: TooltipSide;
236
- };
237
- type PromptInputTooltipConfig = Exclude<PromptInputButtonTooltip, string>;
238
- interface PromptInputButtonProps extends Omit<ButtonProps, "children" | "className"> {
239
- className?: string;
240
- tooltip?: PromptInputButtonTooltip;
241
- children?: React.ReactNode;
242
- }
243
- declare function PromptInputButton({
244
- className,
245
- tooltip,
246
- variant,
247
- color,
248
- size,
249
- children,
250
- "aria-label": ariaLabel,
251
- ref,
252
- ...props
253
- }: PromptInputButtonProps & {
254
- ref?: React.Ref<HTMLButtonElement>;
255
- }): React.JSX.Element;
256
- type PromptInputActionMenuProps = MenuProps;
257
- declare function PromptInputActionMenu(props: PromptInputActionMenuProps): React.JSX.Element;
258
- type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
259
- declare function PromptInputActionMenuTrigger({
260
- className,
261
- children,
262
- ...props
263
- }: PromptInputActionMenuTriggerProps): React.JSX.Element;
264
- type PromptInputActionMenuContentProps = MenuContentProps;
265
- declare function PromptInputActionMenuContent({
266
- className,
267
- children,
268
- ...props
269
- }: PromptInputActionMenuContentProps): React.JSX.Element;
270
- type PromptInputActionMenuItemProps = MenuItemProps;
271
- declare function PromptInputActionMenuItem({
272
- className,
273
- ...props
274
- }: PromptInputActionMenuItemProps): React.JSX.Element;
275
- interface PromptInputActionAddAttachmentsProps extends PromptInputActionMenuItemProps {
276
- label?: string;
277
- }
278
- declare function PromptInputActionAddAttachments({
279
- label,
280
- onClick,
281
- children,
282
- ...props
283
- }: PromptInputActionAddAttachmentsProps): React.JSX.Element;
284
- interface PromptInputActionAddScreenshotProps extends PromptInputActionMenuItemProps {
285
- label?: string;
286
- }
287
- declare function PromptInputActionAddScreenshot({
288
- label,
289
- onClick,
290
- children,
291
- ...props
292
- }: PromptInputActionAddScreenshotProps): React.JSX.Element;
293
- /** How the agent's approval requests are handled. */
294
- type PermissionMode = "ask" | "bypass";
295
- interface PromptInputPermissionSelectorProps {
296
- /** Current mode. `"ask"` surfaces approvals in the composer; `"bypass"` auto-approves. */
297
- value: PermissionMode;
298
- onValueChange: (mode: PermissionMode) => void;
299
- /** Overrides the menu's header question. */
300
- question?: string;
301
- }
302
- /**
303
- * Footer control for choosing how approval requests are handled — ask each
304
- * time, or bypass. Purely a picker: the auto-approve behavior lives with
305
- * whoever owns the approvals (`AgentChat` wires both ends).
306
- */
307
- declare function PromptInputPermissionSelector({
308
- value,
309
- onValueChange,
310
- question
311
- }: PromptInputPermissionSelectorProps): React.JSX.Element;
312
- interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "className" | "type"> {
313
- className?: string;
314
- status?: PromptInputStatus;
315
- onStop?: () => void;
316
- children?: React.ReactNode;
317
- label?: string;
318
- }
319
- declare function PromptInputSubmit({
320
- className,
321
- status,
322
- onStop,
323
- variant,
324
- color,
325
- size,
326
- onClick,
327
- children,
328
- label,
329
- ref,
330
- ...props
331
- }: PromptInputSubmitProps & {
332
- ref?: React.Ref<HTMLButtonElement>;
333
- }): React.JSX.Element;
334
- /** A tool part that may carry a pending approval request. Upstream AI SDK types, taken whole. */
335
- type ApprovalToolPart = ToolUIPart | DynamicToolUIPart;
336
- /**
337
- * Resolve paused codemode executions (`execute` / `browser_execute`) in the
338
- * same composer approval UI as AI SDK tool approvals. Wire to the Think
339
- * agent's client-callable RPCs — they ride the `useAgent` stub, not the chat
340
- * socket, which is why this package can't reach them itself:
341
- *
342
- * ```tsx
343
- * executionApprovals={{
344
- * approve: (id) => agent.stub.approveExecution(id),
345
- * reject: (id, reason) => agent.stub.rejectExecution(id, reason),
346
- * }}
347
- * ```
348
- *
349
- * On approve, upstream resumes the run, replaces the paused tool output in the
350
- * transcript, and auto-continues the chat — no client bookkeeping needed.
351
- * Both RPCs are idempotent, so a stale click resolves to "already handled".
352
- */
353
- interface ExecutionApprovals {
354
- approve: (executionId: string) => unknown;
355
- reject: (executionId: string, reason?: string) => unknown;
356
- }
357
- /** The id a response must carry: the approval id, or the paused run's executionId. */
358
- declare function getApprovalRequestId(part: ApprovalToolPart): string | undefined;
359
- /** Component-local identity: paused executions can ask for multiple approvals. */
360
- declare function getApprovalStateKey(part: ApprovalToolPart): string | undefined;
361
- interface PendingToolApproval<MessageT extends UIMessage = UIMessage> {
362
- message: MessageT;
363
- messageIndex: number;
364
- part: ApprovalToolPart;
365
- partIndex: number;
366
- }
367
- /** Derives pending tool approvals straight from the messages — no app-owned shapes. */
368
- declare function getPendingToolApprovals<MessageT extends UIMessage>(messages: readonly MessageT[], {
369
- pausedExecutions
370
- }?: {
371
- pausedExecutions?: boolean;
372
- }): Array<PendingToolApproval<MessageT>>;
373
- interface PromptInputApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
374
- /**
375
- * The `approval-requested` tool part — or a paused codemode execution —
376
- * passed whole. Renders nothing for other states.
377
- */
378
- part: ApprovalToolPart;
379
- /** Pass `addToolApprovalResponse` from `useAgentChat`/`useChat` directly. */
380
- onRespond?: ChatAddToolApproveResponseFunction;
381
- /** Resolves paused executions instead of `onRespond`. See {@link ExecutionApprovals}. */
382
- executionApprovals?: ExecutionApprovals;
383
- /**
384
- * Renders a Skip action that dismisses the confirmation without responding —
385
- * the approval stays pending upstream.
386
- */
387
- onSkip?: () => void;
388
- /** Overrides the default "Do you want to allow…" question. */
389
- question?: React.ReactNode;
390
- /** Total pending approvals, for the "1 of N" hint. */
391
- count?: number;
392
- }
393
- /**
394
- * The composer's approval state: when a tool call awaits human approval the
395
- * prompt input area becomes the confirmation. "Yes" approves on click; typing
396
- * in the "No, and tell the agent what to do differently" row selects deny and
397
- * sends the text as the native approval `reason`. Submit (or Enter) sends the
398
- * current selection — approve by default.
399
- */
400
- declare function PromptInputApproval({
401
- part,
402
- onRespond,
403
- executionApprovals,
404
- onSkip,
405
- question,
406
- count,
407
- className,
408
- ref,
409
- ...props
410
- }: PromptInputApprovalProps & {
411
- ref?: React.Ref<HTMLDivElement>;
412
- }): React.JSX.Element | null;
413
- type PromptInputSelectProps = SelectProps;
414
- declare const PromptInputSelect: typeof Select;
415
- type PromptInputSelectTriggerProps = SelectTriggerProps;
416
- declare function PromptInputSelectTrigger(props: PromptInputSelectTriggerProps): React.JSX.Element;
417
- type PromptInputSelectContentProps = SelectContentProps;
418
- declare function PromptInputSelectContent(props: PromptInputSelectContentProps): React.JSX.Element;
419
- type PromptInputSelectItemProps = SelectItemProps;
420
- declare const PromptInputSelectItem: typeof SelectOption;
421
- type PromptInputSelectValueProps = SelectValueProps;
422
- declare const PromptInputSelectValue: typeof SelectValue;
423
- interface PromptInputHoverCardProps extends React.HTMLAttributes<HTMLDivElement> {
424
- openDelay?: number;
425
- closeDelay?: number;
426
- }
427
- declare function PromptInputHoverCard({
428
- openDelay,
429
- closeDelay,
430
- className,
431
- children,
432
- ref,
433
- ...props
434
- }: PromptInputHoverCardProps & {
435
- ref?: React.Ref<HTMLDivElement>;
436
- }): React.JSX.Element;
437
- interface PromptInputHoverCardTriggerProps extends React.HTMLAttributes<HTMLSpanElement> {}
438
- declare function PromptInputHoverCardTrigger({
439
- className,
440
- ref,
441
- ...props
442
- }: PromptInputHoverCardTriggerProps & {
443
- ref?: React.Ref<HTMLSpanElement>;
444
- }): React.JSX.Element;
445
- interface PromptInputHoverCardContentProps extends React.HTMLAttributes<HTMLDivElement> {}
446
- declare function PromptInputHoverCardContent({
447
- className,
448
- ref,
449
- ...props
450
- }: PromptInputHoverCardContentProps & {
451
- ref?: React.Ref<HTMLDivElement>;
452
- }): React.JSX.Element | null;
453
- type PromptInputTabsListProps = React.ComponentPropsWithoutRef<typeof TabsList>;
454
- declare const PromptInputTabsList: typeof TabsList;
455
- type PromptInputTabProps = React.ComponentPropsWithoutRef<typeof Tab>;
456
- declare const PromptInputTab: typeof Tab;
457
- type PromptInputTabBodyProps = React.ComponentPropsWithoutRef<typeof TabPanel>;
458
- declare const PromptInputTabBody: typeof TabPanel;
459
- interface PromptInputTabLabelProps extends React.HTMLAttributes<HTMLHeadingElement> {}
460
- declare function PromptInputTabLabel({
461
- className,
462
- ref,
463
- ...props
464
- }: PromptInputTabLabelProps & {
465
- ref?: React.Ref<HTMLHeadingElement>;
466
- }): React.JSX.Element;
467
- interface PromptInputTabItemProps extends React.HTMLAttributes<HTMLDivElement> {}
468
- declare function PromptInputTabItem({
469
- className,
470
- ref,
471
- ...props
472
- }: PromptInputTabItemProps & {
473
- ref?: React.Ref<HTMLDivElement>;
474
- }): React.JSX.Element;
475
- type PromptInputCommandProps = React.ComponentPropsWithoutRef<typeof Combobox>;
476
- declare const PromptInputCommand: typeof import("@base-ui/react").ComboboxRoot & {
477
- Root: typeof import("@base-ui/react").ComboboxRoot;
478
- Input: typeof ComboboxInput;
479
- Trigger: typeof ComboboxTrigger;
480
- Clear: ({
481
- className,
482
- ref,
483
- ...props
484
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear>, "className"> & {
485
- className?: string;
486
- } & {
487
- ref?: React.Ref<HTMLButtonElement>;
488
- }) => React.JSX.Element;
489
- Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
490
- Positioner: typeof ComboboxPositioner;
491
- Popup: typeof ComboboxPopup;
492
- Content: typeof ComboboxPopup;
493
- List: typeof ComboboxList;
494
- Item: typeof ComboboxItem;
495
- ItemIndicator: ({
496
- className,
497
- ref,
498
- ...props
499
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator>, "className"> & {
500
- className?: string;
501
- } & {
502
- ref?: React.Ref<HTMLSpanElement>;
503
- }) => React.JSX.Element;
504
- Empty: typeof ComboboxEmpty;
505
- Group: typeof ComboboxGroup;
506
- GroupLabel: typeof ComboboxLabel;
507
- Label: typeof ComboboxLabel;
508
- Value: typeof import("@base-ui/react").ComboboxValue;
509
- Chips: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
510
- Chip: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
511
- ChipsInput: typeof ComboboxInput;
512
- Collection: typeof import("@base-ui/react").ComboboxCollection;
513
- Separator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
514
- };
515
- type PromptInputCommandInputProps = React.ComponentPropsWithoutRef<typeof ComboboxInput>;
516
- declare const PromptInputCommandInput: typeof ComboboxInput;
517
- interface PromptInputCommandListProps extends React.HTMLAttributes<HTMLDivElement> {}
518
- declare function PromptInputCommandList({
519
- className,
520
- ref,
521
- ...props
522
- }: PromptInputCommandListProps & {
523
- ref?: React.Ref<HTMLDivElement>;
524
- }): React.JSX.Element;
525
- type PromptInputCommandEmptyProps = React.ComponentPropsWithoutRef<typeof ComboboxEmpty>;
526
- declare const PromptInputCommandEmpty: typeof ComboboxEmpty;
527
- type PromptInputCommandGroupProps = React.ComponentPropsWithoutRef<typeof ComboboxGroup>;
528
- declare const PromptInputCommandGroup: typeof ComboboxGroup;
529
- type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof ComboboxItem>;
530
- declare const PromptInputCommandItem: typeof ComboboxItem;
531
- type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof ComboboxSeparator>;
532
- declare const PromptInputCommandSeparator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
533
- //#endregion
534
- export { ApprovalToolPart, AttachmentsContext, ExecutionApprovals, PendingToolApproval, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, 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, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, 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, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
1
+ import { $ as PromptInputHoverCardTriggerProps, A as PromptInputCommandEmpty, At as PromptInputTextareaProps, B as PromptInputCommandProps, Bt as usePromptInputAttachments, C as PromptInputAttachmentsProps, Ct as PromptInputTabItemProps, D as PromptInputButtonProps, Dt as PromptInputTabsList, E as PromptInputButton, Et as PromptInputTabProps, F as PromptInputCommandInputProps, Ft as TextInputContext, G as PromptInputFooterProps, H as PromptInputCommandSeparatorProps, Ht as usePromptInputReferencedSources, I as PromptInputCommandItem, It as TooltipSide, J as PromptInputHoverCard, K as PromptInputHeader, L as PromptInputCommandItemProps, Lt as getApprovalRequestId, M as PromptInputCommandGroup, Mt as PromptInputToolsProps, N as PromptInputCommandGroupProps, Nt as PromptInputTooltipConfig, O as PromptInputButtonTooltip, Ot as PromptInputTabsListProps, P as PromptInputCommandInput, Pt as ReferencedSourcesContext, Q as PromptInputHoverCardTrigger, R as PromptInputCommandList, Rt as getApprovalStateKey, S as PromptInputAttachments, St as PromptInputTabItem, T as PromptInputBodyProps, Tt as PromptInputTabLabelProps, U as PromptInputControllerProps, Ut as useProviderAttachments, V as PromptInputCommandSeparator, Vt as usePromptInputController, W as PromptInputFooter, X as PromptInputHoverCardContentProps, Y as PromptInputHoverCardContent, Z as PromptInputHoverCardProps, _ as PromptInputActionMenuTriggerProps, _t as PromptInputSubmit, a as PromptInput, at as PromptInputProviderProps, b as PromptInputAttachment, bt as PromptInputTabBody, c as PromptInputActionAddScreenshot, ct as PromptInputSelectContent, d as PromptInputActionMenuContent, dt as PromptInputSelectItemProps, et as PromptInputMessage, f as PromptInputActionMenuContentProps, ft as PromptInputSelectProps, g as PromptInputActionMenuTrigger, gt as PromptInputSelectValueProps, h as PromptInputActionMenuProps, ht as PromptInputSelectValue, i as PermissionMode, it as PromptInputProvider, j as PromptInputCommandEmptyProps, jt as PromptInputTools, k as PromptInputCommand, kt as PromptInputTextarea, l as PromptInputActionAddScreenshotProps, lt as PromptInputSelectContentProps, m as PromptInputActionMenuItemProps, mt as PromptInputSelectTriggerProps, n as ExecutionApprovals, nt as PromptInputPermissionSelectorProps, o as PromptInputActionAddAttachments, ot as PromptInputReferencedSource, p as PromptInputActionMenuItem, pt as PromptInputSelectTrigger, q as PromptInputHeaderProps, r as PendingToolApproval, rt as PromptInputProps, s as PromptInputActionAddAttachmentsProps, st as PromptInputSelect, t as AttachmentsContext, tt as PromptInputPermissionSelector, u as PromptInputActionMenu, ut as PromptInputSelectItem, v as PromptInputApproval, vt as PromptInputSubmitProps, w as PromptInputBody, wt as PromptInputTabLabel, x as PromptInputAttachmentProps, xt as PromptInputTabBodyProps, y as PromptInputApprovalProps, yt as PromptInputTab, z as PromptInputCommandListProps, zt as getPendingToolApprovals } from "../PromptInput-D6-G24p7.js";
2
+ export { AttachmentsContext, ExecutionApprovals, PendingToolApproval, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputControllerProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReferencedSource, PromptInputSelect, PromptInputSelectContent, PromptInputSelectContentProps, PromptInputSelectItem, PromptInputSelectItemProps, PromptInputSelectProps, PromptInputSelectTrigger, PromptInputSelectTriggerProps, PromptInputSelectValue, PromptInputSelectValueProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, ReferencedSourcesContext, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { A as SpinnerIcon, C as PaperclipIcon, D as PlusIcon, F as XIcon, N as WarningIcon, S as MonitorIcon, T as PencilIcon, i as ArrowUpIcon, j as SquareIcon, m as FileIcon, o as ChevronDownIcon } from "../icons-BCNawx-T.js";
2
+ import { C as MonitorIcon, E as PencilIcon, I as XIcon, M as SquareIcon, O as PlusIcon, P as WarningIcon, h as FileIcon, i as ArrowUpIcon, j as SpinnerIcon, o as ChevronDownIcon, w as PaperclipIcon } from "../icons-BAlTbWWP.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
5
5
  import { t as AttachmentPreview } from "../attachment-preview-ChtC3HiU.js";
@@ -9,7 +9,7 @@ import { Select, SelectContent, SelectItem, SelectPortal, SelectPositioner, Sele
9
9
  import { Tab, TabPanel, TabsList } from "./Tabs.js";
10
10
  import * as React from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
- import { getToolName, isToolOrDynamicToolUIPart } from "ai";
12
+ import { getToolName, isToolUIPart } from "ai";
13
13
  //#region src/components/PromptInput.tsx
14
14
  const PromptInputContext = React.createContext(null);
15
15
  const PromptInputController = React.createContext(null);
@@ -124,7 +124,7 @@ function PromptInputProvider({ initialInput = "", children }) {
124
124
  *
125
125
  * @example
126
126
  * ```tsx
127
- * <PromptInput onSubmit={({ text, files }) => sendMessage(text, files)}>
127
+ * <PromptInput onSubmit={({ text, files }) => sendMessage({ text, files })}>
128
128
  * <PromptInputBody>
129
129
  * <PromptInputTextarea placeholder="Ask Sigvelo..." />
130
130
  * </PromptInputBody>
@@ -680,7 +680,7 @@ function getPendingToolApprovals(messages, { pausedExecutions = false } = {}) {
680
680
  const pending = [];
681
681
  messages.forEach((message, messageIndex) => {
682
682
  message.parts.forEach((part, partIndex) => {
683
- if (isToolOrDynamicToolUIPart(part) && (part.state === "approval-requested" || pausedExecutions && getPausedExecution(part))) pending.push({
683
+ if (isToolUIPart(part) && (part.state === "approval-requested" || pausedExecutions && getPausedExecution(part))) pending.push({
684
684
  message,
685
685
  messageIndex,
686
686
  part,
@@ -701,22 +701,23 @@ function formatApprovalValue(value) {
701
701
  * sends the text as the native approval `reason`. Submit (or Enter) sends the
702
702
  * current selection — approve by default.
703
703
  */
704
- function PromptInputApproval({ part, onRespond, executionApprovals, onSkip, question, count, className, ref, ...props }) {
704
+ function PromptInputApproval({ part, approval: durableApproval, onRespond, executionApprovals, onSkip, question, count, className, ref, ...props }) {
705
705
  const [selected, setSelected] = React.useState("approve");
706
706
  const [reason, setReason] = React.useState("");
707
707
  const [busy, setBusy] = React.useState(false);
708
708
  const yesRef = React.useRef(null);
709
709
  const reasonRef = React.useRef(null);
710
- const approval = part.state === "approval-requested" ? part.approval : void 0;
711
- const paused = getPausedExecution(part);
712
- const approvalId = getApprovalStateKey(part);
710
+ const approval = part?.state === "approval-requested" ? part.approval : void 0;
711
+ const paused = part ? getPausedExecution(part) : void 0;
712
+ const approvalId = part ? getApprovalStateKey(part) : durableApproval?.executionId;
713
713
  React.useEffect(() => {
714
714
  setSelected("approve");
715
715
  setReason("");
716
716
  setBusy(false);
717
717
  }, [approvalId]);
718
- if (approval ? !onRespond : !(paused && executionApprovals)) return null;
719
- const toolName = getToolName(part);
718
+ if (!part && !durableApproval) return null;
719
+ if (approval ? !onRespond : !(executionApprovals && (paused || durableApproval))) return null;
720
+ const toolName = durableApproval?.descriptor.action ?? (part ? getToolName(part) : "action");
720
721
  const respond = async (approved) => {
721
722
  if (busy) return;
722
723
  setBusy(true);
@@ -729,12 +730,13 @@ function PromptInputApproval({ part, onRespond, executionApprovals, onSkip, ques
729
730
  reason: denyReason
730
731
  });
731
732
  else if (paused) await (approved ? executionApprovals?.approve(paused.executionId) : executionApprovals?.reject(paused.executionId, denyReason));
733
+ else if (durableApproval) await (approved ? executionApprovals?.approve(durableApproval.executionId) : executionApprovals?.reject(durableApproval.executionId, denyReason));
732
734
  } finally {
733
735
  setBusy(false);
734
736
  }
735
737
  };
736
738
  const submit = () => void respond(selected === "approve");
737
- const input = "input" in part ? part.input : void 0;
739
+ const input = durableApproval?.descriptor.input ?? (part && "input" in part ? part.input : void 0);
738
740
  const inputEntries = input && typeof input === "object" && !Array.isArray(input) ? Object.entries(input) : void 0;
739
741
  return /* @__PURE__ */ jsxs("div", {
740
742
  ref,
@@ -751,7 +753,11 @@ function PromptInputApproval({ part, onRespond, executionApprovals, onSkip, ques
751
753
  children: [
752
754
  /* @__PURE__ */ jsxs("div", {
753
755
  className: "prompt-input__approval-question",
754
- children: [/* @__PURE__ */ jsx("span", { children: question ?? (paused ? /* @__PURE__ */ jsx(Fragment, { children: "The agent's code is paused on these calls. Allow it to continue?" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
756
+ children: [/* @__PURE__ */ jsx("span", { children: question ?? (durableApproval ? /* @__PURE__ */ jsxs(Fragment, { children: [
757
+ "Do you want to allow ",
758
+ /* @__PURE__ */ jsx("code", { children: durableApproval.descriptor.summary }),
759
+ "?"
760
+ ] }) : paused ? /* @__PURE__ */ jsx(Fragment, { children: "The agent's code is paused on these calls. Allow it to continue?" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
755
761
  "Do you want to allow the agent to run ",
756
762
  /* @__PURE__ */ jsx("code", { children: toolName }),
757
763
  "?"
@@ -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 CheckIcon, c as ChevronRightIcon, m as FileIcon, u as DotIcon } from "../icons-BCNawx-T.js";
3
+ import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, u as DotIcon } from "../icons-BAlTbWWP.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 { c as ChevronRightIcon } from "../icons-BCNawx-T.js";
3
+ import { c as ChevronRightIcon } from "../icons-BAlTbWWP.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 { a as CheckIcon, i as ArrowUpIcon, t as ArrowDownIcon } from "../icons-BCNawx-T.js";
1
+ import { a as CheckIcon, i as ArrowUpIcon, t as ArrowDownIcon } from "../icons-BAlTbWWP.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 { c as ChevronRightIcon, y as LinkIcon } from "../icons-BCNawx-T.js";
3
+ import { b as LinkIcon, c as ChevronRightIcon } from "../icons-BAlTbWWP.js";
4
4
  import "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/Sources.tsx