@truefoundry/agent-ui-sdk 0.0.1 → 0.0.2

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 (79) hide show
  1. package/README.md +192 -80
  2. package/dist/index.d.ts +228 -281
  3. package/dist/index.js +1823 -1791
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +2 -0
  6. package/package.json +36 -19
  7. package/src/atoms/AskUserPrompt.tsx +0 -102
  8. package/src/atoms/AttachmentCard.tsx +0 -92
  9. package/src/atoms/AttachmentPickerButton.tsx +0 -19
  10. package/src/atoms/AttachmentPreviewDialog.tsx +0 -34
  11. package/src/atoms/BranchIndicator.tsx +0 -41
  12. package/src/atoms/CodeBlockHeader.tsx +0 -44
  13. package/src/atoms/ComposerShell.tsx +0 -112
  14. package/src/atoms/Markdown.test.tsx +0 -28
  15. package/src/atoms/Markdown.tsx +0 -288
  16. package/src/atoms/McpAuthPrompt.tsx +0 -60
  17. package/src/atoms/MessageActionBar.tsx +0 -60
  18. package/src/atoms/MessageBubble.tsx +0 -80
  19. package/src/atoms/MessageErrorBanner.tsx +0 -26
  20. package/src/atoms/MessageIndicator.tsx +0 -23
  21. package/src/atoms/OpenUIBlock.test.tsx +0 -37
  22. package/src/atoms/OpenUIBlock.tsx +0 -50
  23. package/src/atoms/ReasoningCard.tsx +0 -52
  24. package/src/atoms/SandboxArtifactList.tsx +0 -63
  25. package/src/atoms/ScrollToBottomButton.tsx +0 -34
  26. package/src/atoms/Skeletons.tsx +0 -32
  27. package/src/atoms/ThreadListMisc.tsx +0 -76
  28. package/src/atoms/ThreadListRow.tsx +0 -81
  29. package/src/atoms/ThreadShell.tsx +0 -93
  30. package/src/atoms/Toast.tsx +0 -60
  31. package/src/atoms/ToolApprovalBar.tsx +0 -92
  32. package/src/atoms/ToolCallCard.tsx +0 -186
  33. package/src/atoms/ToolGroupCard.tsx +0 -52
  34. package/src/atoms/UserMessageActionBar.tsx +0 -62
  35. package/src/atoms/WelcomeScreen.tsx +0 -22
  36. package/src/atoms/lib/cn.ts +0 -6
  37. package/src/atoms/primitives/Avatar.tsx +0 -57
  38. package/src/atoms/primitives/Button.tsx +0 -73
  39. package/src/atoms/primitives/Collapsible.tsx +0 -32
  40. package/src/atoms/primitives/Dialog.tsx +0 -152
  41. package/src/atoms/primitives/IconButton.tsx +0 -43
  42. package/src/atoms/primitives/Skeleton.tsx +0 -17
  43. package/src/atoms/primitives/Tooltip.tsx +0 -58
  44. package/src/containers/AskUserContainer.tsx +0 -49
  45. package/src/containers/AssistantMessageContainer.test.tsx +0 -56
  46. package/src/containers/AssistantMessageContainer.tsx +0 -128
  47. package/src/containers/AssistantTextContainer.test.tsx +0 -111
  48. package/src/containers/AssistantTextContainer.tsx +0 -54
  49. package/src/containers/AttachmentsContainer.tsx +0 -83
  50. package/src/containers/ComposerContainer.tsx +0 -66
  51. package/src/containers/ErrorToasterContainer.tsx +0 -76
  52. package/src/containers/McpAuthContainer.test.tsx +0 -100
  53. package/src/containers/McpAuthContainer.tsx +0 -22
  54. package/src/containers/MessageImageContainer.tsx +0 -37
  55. package/src/containers/ReasoningContainer.tsx +0 -32
  56. package/src/containers/RuntimeHarness.tsx +0 -39
  57. package/src/containers/Thread.tsx +0 -9
  58. package/src/containers/ThreadContainer.test.tsx +0 -52
  59. package/src/containers/ThreadContainer.tsx +0 -87
  60. package/src/containers/ThreadListContainer.tsx +0 -63
  61. package/src/containers/ToolCallContainer.test.tsx +0 -135
  62. package/src/containers/ToolCallContainer.tsx +0 -167
  63. package/src/containers/ToolGroupContainer.test.tsx +0 -56
  64. package/src/containers/ToolGroupContainer.tsx +0 -24
  65. package/src/containers/UserEditComposerContainer.test.tsx +0 -52
  66. package/src/containers/UserEditComposerContainer.tsx +0 -86
  67. package/src/containers/UserMessageContainer.test.tsx +0 -99
  68. package/src/containers/UserMessageContainer.tsx +0 -26
  69. package/src/containers/nestedApprovalBridge.ts +0 -20
  70. package/src/containers/useAttachmentPreviewSrc.ts +0 -42
  71. package/src/hooks/useComposerBusyState.test.ts +0 -78
  72. package/src/hooks/useComposerBusyState.ts +0 -69
  73. package/src/index.ts +0 -193
  74. package/src/testSetup.ts +0 -42
  75. package/src/theme/SlotsProvider.test.tsx +0 -64
  76. package/src/theme/SlotsProvider.tsx +0 -41
  77. package/src/theme/defaultSlots.ts +0 -131
  78. package/src/theme/tokens.ts +0 -98
  79. package/src/theme/useClassDarkMode.ts +0 -24
package/dist/index.d.ts CHANGED
@@ -1,37 +1,95 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, ComponentProps, ComponentPropsWithRef, PropsWithChildren } from 'react';
3
- import * as class_variance_authority_types from 'class-variance-authority/types';
4
- import { VariantProps } from 'class-variance-authority';
5
- import { Avatar as Avatar$1, Tooltip as Tooltip$1, Dialog as Dialog$1, Collapsible as Collapsible$1 } from 'radix-ui';
2
+ import react__default, { ReactNode, HTMLAttributes, ComponentPropsWithRef, PropsWithChildren } from 'react';
3
+ import { Accordion, AccordionSummary, AccordionDetails } from 'tfy-web-components/components/atoms/Accordion';
4
+ export { Accordion, AccordionDetails, AccordionSummary, AccordionSummaryProps } from 'tfy-web-components/components/atoms/Accordion';
5
+ import Button, { ButtonProps } from 'tfy-web-components/components/atoms/Button';
6
+ export { Button, ButtonProps, ButtonSize, DestructiveButton, GhostButton, PrimaryButton, SecondaryButton, TertiaryButton } from 'tfy-web-components/components/atoms/Button';
7
+ import IconButton, { IconButtonProps } from 'tfy-web-components/components/atoms/IconButton';
8
+ export { default as IconButton, IconButtonProps } from 'tfy-web-components/components/atoms/IconButton';
9
+ import Modal from 'tfy-web-components/components/atoms/Modal';
10
+ export { default as Modal, ModalProps } from 'tfy-web-components/components/atoms/Modal';
11
+ import Skeleton from 'tfy-web-components/components/atoms/Skeleton';
12
+ export { default as Skeleton } from 'tfy-web-components/components/atoms/Skeleton';
13
+ import { LightTooltip } from 'tfy-web-components/components/atoms/Tooltip';
14
+ export { LightTooltip, TooltipProps } from 'tfy-web-components/components/atoms/Tooltip';
15
+ import Dialog from 'tfy-web-components/components/molecules/Dialog';
16
+ export { default as Dialog } from 'tfy-web-components/components/molecules/Dialog';
17
+ export { IconProp, default as IconProvider, registerIcons, registerImgIcons } from 'tfy-web-components/components/atoms/IconProvider';
18
+ import { UserMessageEditProps as UserMessageEditProps$1 } from 'tfy-web-components/components/molecules/agent-chat/UserMessageEdit';
19
+ import { ToolCallCardProps as ToolCallCardProps$1, ToolCallContentBlockProps as ToolCallContentBlockProps$1, ToolApprovalBlockProps, ReasoningCardProps, AskUserQuestionCardProps, McpAuthCardProps } from 'tfy-web-components/components/molecules/agent-chat';
20
+ export { AskUserAnswerDraft, AnsweredQuestion as AskUserAnsweredQuestion, Question as AskUserQuestion, McpServer as McpAuthServer, ReasoningCardProps } from 'tfy-web-components/components/molecules/agent-chat';
6
21
  import { ToolCallMessagePartComponent, MessagePrimitive } from '@assistant-ui/react';
7
22
 
23
+ type ComposerLeftSectionProps = {
24
+ disabled: boolean;
25
+ isRunning: boolean;
26
+ onAttach?: () => void;
27
+ };
28
+ type ComposerRightSectionProps = {
29
+ disabled: boolean;
30
+ isRunning: boolean;
31
+ };
32
+ type ComposerSendButtonProps = {
33
+ disabled: boolean;
34
+ canSubmit: boolean;
35
+ isRunning: boolean;
36
+ onSubmit: () => void;
37
+ onCancel?: () => void;
38
+ };
39
+ declare function ComposerLeftSection({ onAttach }: ComposerLeftSectionProps): react.JSX.Element | null;
40
+ declare function ComposerRightSection(_: ComposerRightSectionProps): null;
41
+ declare function ComposerSendButton({ canSubmit, isRunning, onSubmit, onCancel, }: ComposerSendButtonProps): react.JSX.Element;
42
+
43
+ /**
44
+ * This SDK's default atom implementations, keyed by slot name. Populated
45
+ * incrementally as atoms are added under `src/atoms/**`; each atom module
46
+ * augments `AtomSlots` and this object gains the matching entry in the same
47
+ * milestone.
48
+ */
49
+ declare const defaultSlots: AtomSlots;
50
+ declare module "./SlotsProvider.js" {
51
+ interface AtomSlots {
52
+ Button: typeof Button;
53
+ IconButton: typeof IconButton;
54
+ Skeleton: typeof Skeleton;
55
+ LightTooltip: typeof LightTooltip;
56
+ Modal: typeof Modal;
57
+ Dialog: typeof Dialog;
58
+ Accordion: typeof Accordion;
59
+ AccordionSummary: typeof AccordionSummary;
60
+ AccordionDetails: typeof AccordionDetails;
61
+ }
62
+ }
63
+
8
64
  /**
9
65
  * Registry of atom-name -> atom-implementation. Empty by default; each atom module
10
66
  * augments this interface via `declare module "../theme/SlotsProvider"` when it is
11
67
  * introduced, so adding an atom never requires editing this file or any container.
12
68
  */
13
69
  interface AtomSlots {
14
- }
15
- type SlotOverrides = Partial<AtomSlots>;
70
+ ComposerLeftSection: ComposerLeftSectionSlot;
71
+ ComposerRightSection: ComposerRightSectionSlot;
72
+ ComposerSendButton: ComposerSendButtonSlot;
73
+ }
74
+ type ComposerLeftSectionSlot = (props: ComposerLeftSectionProps) => ReactNode;
75
+ type ComposerRightSectionSlot = (props: ComposerRightSectionProps) => ReactNode;
76
+ type ComposerSendButtonSlot = (props: ComposerSendButtonProps) => ReactNode;
77
+ type SlotOverrides = Partial<AtomSlots> & Record<string, unknown>;
78
+ type ThemeMode = "light" | "dark";
16
79
  /**
17
80
  * Wrap a subtree to override one or more atoms with a different design system.
18
81
  * Containers never reference concrete atoms directly -- they resolve everything
19
82
  * through `useSlot`, so this is the only thing a design-system swap has to touch.
20
83
  */
21
- declare function SlotsProvider({ overrides, children, }: {
84
+ declare function SlotsProvider({ overrides, theme, children, }: {
22
85
  overrides?: SlotOverrides;
86
+ theme?: ThemeMode;
23
87
  children: ReactNode;
24
88
  }): react.JSX.Element;
25
89
  /** Resolves the atom implementation registered for `name` -- default unless overridden. */
26
90
  declare function useSlot<K extends keyof AtomSlots>(name: K): AtomSlots[K];
27
-
28
- /**
29
- * This SDK's default atom implementations, keyed by slot name. Populated
30
- * incrementally as atoms are added under `src/atoms/**`; each atom module
31
- * augments `AtomSlots` and this object gains the matching entry in the same
32
- * milestone.
33
- */
34
- declare const defaultSlots: AtomSlots;
91
+ /** Resolves the light or dark theme mode supplied by the SDK consumer. */
92
+ declare function useThemeMode(): ThemeMode;
35
93
 
36
94
  /**
37
95
  * Semantic color roles. Atoms reference these instead of raw hex/HSL values so a
@@ -65,39 +123,14 @@ declare function TokensProvider({ tokens, children, }: {
65
123
  /** Atoms may call this for theme-driven values; it is not an assistant-ui/runtime hook. */
66
124
  declare function useTokens(): DesignTokens;
67
125
 
68
- declare const buttonVariants: (props?: ({
69
- variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
70
- size?: "default" | "sm" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
71
- } & class_variance_authority_types.ClassProp) | undefined) => string;
72
- type ButtonProps = ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
73
- asChild?: boolean;
74
- };
75
- declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react.JSX.Element;
76
- declare module "../../theme/SlotsProvider.js" {
77
- interface AtomSlots {
78
- Button: typeof Button;
79
- }
80
- }
81
-
82
- type IconButtonProps = ComponentPropsWithRef<typeof Button> & {
83
- tooltip: string;
84
- side?: "top" | "bottom" | "left" | "right";
85
- };
86
- declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
87
- declare module "../../theme/SlotsProvider.js" {
88
- interface AtomSlots {
89
- IconButton: typeof IconButton;
90
- }
91
- }
92
-
93
- type AvatarProps = ComponentProps<typeof Avatar$1.Root> & {
126
+ type AvatarProps = react__default.HTMLAttributes<HTMLDivElement> & {
94
127
  size?: "default" | "sm" | "lg";
95
128
  };
96
- declare function Avatar({ className, size, ...props }: AvatarProps): react.JSX.Element;
97
- type AvatarImageProps = ComponentProps<typeof Avatar$1.Image>;
98
- declare function AvatarImage({ className, ...props }: AvatarImageProps): react.JSX.Element;
99
- type AvatarFallbackProps = ComponentProps<typeof Avatar$1.Fallback>;
100
- declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react.JSX.Element;
129
+ declare function Avatar({ className, size, ...props }: AvatarProps): react__default.JSX.Element;
130
+ type AvatarImageProps = react__default.ImgHTMLAttributes<HTMLImageElement>;
131
+ declare function AvatarImage({ className, ...props }: AvatarImageProps): react__default.JSX.Element;
132
+ type AvatarFallbackProps = react__default.HTMLAttributes<HTMLDivElement>;
133
+ declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react__default.JSX.Element;
101
134
  declare module "../../theme/SlotsProvider.js" {
102
135
  interface AtomSlots {
103
136
  Avatar: typeof Avatar;
@@ -106,162 +139,55 @@ declare module "../../theme/SlotsProvider.js" {
106
139
  }
107
140
  }
108
141
 
109
- type TooltipProviderProps = ComponentProps<typeof Tooltip$1.Provider>;
110
- declare function TooltipProvider({ delayDuration, ...props }: TooltipProviderProps): react.JSX.Element;
111
- type TooltipProps = ComponentProps<typeof Tooltip$1.Root>;
112
- declare function Tooltip(props: TooltipProps): react.JSX.Element;
113
- type TooltipTriggerProps = ComponentProps<typeof Tooltip$1.Trigger>;
114
- declare function TooltipTrigger(props: TooltipTriggerProps): react.JSX.Element;
115
- type TooltipContentProps = ComponentProps<typeof Tooltip$1.Content>;
116
- declare function TooltipContent({ className, sideOffset, children, ...props }: TooltipContentProps): react.JSX.Element;
117
- declare module "../../theme/SlotsProvider.js" {
118
- interface AtomSlots {
119
- TooltipProvider: typeof TooltipProvider;
120
- Tooltip: typeof Tooltip;
121
- TooltipTrigger: typeof TooltipTrigger;
122
- TooltipContent: typeof TooltipContent;
123
- }
124
- }
125
-
126
- type DialogProps = ComponentProps<typeof Dialog$1.Root>;
127
- declare function Dialog(props: DialogProps): react.JSX.Element;
128
- type DialogTriggerProps = ComponentProps<typeof Dialog$1.Trigger>;
129
- declare function DialogTrigger(props: DialogTriggerProps): react.JSX.Element;
130
- type DialogPortalProps = ComponentProps<typeof Dialog$1.Portal>;
131
- declare function DialogPortal(props: DialogPortalProps): react.JSX.Element;
132
- type DialogCloseProps = ComponentProps<typeof Dialog$1.Close>;
133
- declare function DialogClose(props: DialogCloseProps): react.JSX.Element;
134
- type DialogOverlayProps = ComponentProps<typeof Dialog$1.Overlay>;
135
- declare function DialogOverlay({ className, ...props }: DialogOverlayProps): react.JSX.Element;
136
- type DialogContentProps = ComponentProps<typeof Dialog$1.Content> & {
137
- showCloseButton?: boolean;
138
- };
139
- declare function DialogContent({ className, children, showCloseButton, ...props }: DialogContentProps): react.JSX.Element;
140
- type DialogHeaderProps = ComponentProps<"div">;
141
- declare function DialogHeader({ className, ...props }: DialogHeaderProps): react.JSX.Element;
142
- type DialogFooterProps = ComponentProps<"div"> & {
143
- showCloseButton?: boolean;
144
- };
145
- declare function DialogFooter({ className, showCloseButton, children, ...props }: DialogFooterProps): react.JSX.Element;
146
- type DialogTitleProps = ComponentProps<typeof Dialog$1.Title>;
147
- declare function DialogTitle({ className, ...props }: DialogTitleProps): react.JSX.Element;
148
- type DialogDescriptionProps = ComponentProps<typeof Dialog$1.Description>;
149
- declare function DialogDescription({ className, ...props }: DialogDescriptionProps): react.JSX.Element;
150
- declare module "../../theme/SlotsProvider.js" {
151
- interface AtomSlots {
152
- Dialog: typeof Dialog;
153
- DialogTrigger: typeof DialogTrigger;
154
- DialogPortal: typeof DialogPortal;
155
- DialogClose: typeof DialogClose;
156
- DialogOverlay: typeof DialogOverlay;
157
- DialogContent: typeof DialogContent;
158
- DialogHeader: typeof DialogHeader;
159
- DialogFooter: typeof DialogFooter;
160
- DialogTitle: typeof DialogTitle;
161
- DialogDescription: typeof DialogDescription;
162
- }
163
- }
164
-
165
- type CollapsibleProps = ComponentProps<typeof Collapsible$1.Root>;
166
- declare function Collapsible(props: CollapsibleProps): react.JSX.Element;
167
- type CollapsibleTriggerProps = ComponentProps<typeof Collapsible$1.CollapsibleTrigger>;
168
- declare function CollapsibleTrigger(props: CollapsibleTriggerProps): react.JSX.Element;
169
- type CollapsibleContentProps = ComponentProps<typeof Collapsible$1.CollapsibleContent>;
170
- declare function CollapsibleContent(props: CollapsibleContentProps): react.JSX.Element;
171
- declare module "../../theme/SlotsProvider.js" {
172
- interface AtomSlots {
173
- Collapsible: typeof Collapsible;
174
- CollapsibleTrigger: typeof CollapsibleTrigger;
175
- CollapsibleContent: typeof CollapsibleContent;
176
- }
177
- }
178
-
179
- type SkeletonProps = ComponentProps<"div">;
180
- declare function Skeleton({ className, ...props }: SkeletonProps): react.JSX.Element;
181
- declare module "../../theme/SlotsProvider.js" {
182
- interface AtomSlots {
183
- Skeleton: typeof Skeleton;
184
- }
185
- }
186
-
187
142
  type MarkdownProps = {
188
143
  content: string;
189
- className?: string;
190
- isStreaming?: boolean;
191
- onDownloadArtifact?: (path: string) => void | Promise<unknown>;
192
- };
193
- declare function Markdown({ content, className, isStreaming, onDownloadArtifact }: MarkdownProps): react.JSX.Element;
194
- declare module "../theme/SlotsProvider.js" {
195
- interface AtomSlots {
196
- Markdown: typeof Markdown;
197
- }
198
- }
199
-
200
- type ThemeMode = "light" | "dark";
201
-
202
- type OpenUIBlockProps = {
203
- source: string;
204
144
  isStreaming?: boolean;
145
+ /** Base URL for resolving sandbox artifact download paths (e.g. gateway file endpoint). */
146
+ fileDownloadBaseUrl?: string;
147
+ /** Custom download handler that receives the original sandbox artifact path. */
148
+ onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
149
+ /** When true, download actions in sandbox artifact blocks are hidden/disabled. */
150
+ readOnly?: boolean;
205
151
  className?: string;
206
- /** Override light/dark mode. Defaults to syncing with a `.dark` class on `<html>`. */
207
- mode?: ThemeMode;
208
152
  };
209
- /** Renders an OpenUI Lang fenced code block (```openui ... ```). */
210
- declare const OpenUIBlock: react.NamedExoticComponent<OpenUIBlockProps>;
153
+ declare function Markdown({ content, isStreaming, fileDownloadBaseUrl, onDownloadArtifact, readOnly, className, }: MarkdownProps): react.JSX.Element;
211
154
  declare module "../theme/SlotsProvider.js" {
212
155
  interface AtomSlots {
213
- OpenUIBlock: typeof OpenUIBlock;
156
+ Markdown: typeof Markdown;
214
157
  }
215
158
  }
216
159
 
217
- type SandboxArtifactLink = {
218
- label: string;
219
- path: string;
220
- };
221
- type SandboxArtifactListProps = {
222
- artifacts: SandboxArtifactLink[];
223
- onDownload?: (path: string) => void | Promise<unknown>;
160
+ type UserMessageBubbleProps = {
161
+ text: string;
162
+ attachments?: ReactNode;
163
+ editAction?: ReactNode;
224
164
  className?: string;
225
165
  };
226
- declare function SandboxArtifactList({ artifacts, onDownload, className }: SandboxArtifactListProps): react.JSX.Element;
166
+ declare function UserMessageBubble({ text, attachments, editAction, className }: UserMessageBubbleProps): react.JSX.Element;
227
167
  declare module "../theme/SlotsProvider.js" {
228
168
  interface AtomSlots {
229
- SandboxArtifactList: typeof SandboxArtifactList;
169
+ UserMessageBubble: typeof UserMessageBubble;
230
170
  }
231
171
  }
232
172
 
233
- type CodeBlockHeaderProps = {
234
- language: string;
235
- code: string;
236
- };
237
- declare function CodeBlockHeader({ language, code }: CodeBlockHeaderProps): react.JSX.Element;
173
+ type UserMessageEditProps = Pick<UserMessageEditProps$1, "timestamp" | "attachments" | "input" | "footer" | "className">;
174
+ declare const UserMessageEdit: react.ForwardRefExoticComponent<UserMessageEditProps & HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
238
175
  declare module "../theme/SlotsProvider.js" {
239
176
  interface AtomSlots {
240
- CodeBlockHeader: typeof CodeBlockHeader;
177
+ UserMessageEdit: typeof UserMessageEdit;
241
178
  }
242
179
  }
243
180
 
244
181
  type AssistantMessageBubbleProps = {
245
- variant: "assistant";
246
182
  children: ReactNode;
247
183
  error?: ReactNode;
248
- branchIndicator?: ReactNode;
249
184
  actionBar?: ReactNode;
250
185
  className?: string;
251
186
  };
252
- type UserMessageBubbleProps = {
253
- variant: "user";
254
- children: ReactNode;
255
- attachments?: ReactNode;
256
- branchIndicator?: ReactNode;
257
- actionBar?: ReactNode;
258
- className?: string;
259
- };
260
- type MessageBubbleProps = AssistantMessageBubbleProps | UserMessageBubbleProps;
261
- declare function MessageBubble(props: MessageBubbleProps): react.JSX.Element;
187
+ declare function AssistantMessageBubble({ children, error, actionBar, className, }: AssistantMessageBubbleProps): react.JSX.Element;
262
188
  declare module "../theme/SlotsProvider.js" {
263
189
  interface AtomSlots {
264
- MessageBubble: typeof MessageBubble;
190
+ AssistantMessageBubble: typeof AssistantMessageBubble;
265
191
  }
266
192
  }
267
193
 
@@ -279,37 +205,32 @@ declare module "../theme/SlotsProvider.js" {
279
205
  type MessageActionBarProps = {
280
206
  isCopied: boolean;
281
207
  onCopy: () => void;
282
- onExportMarkdown: () => void;
283
208
  className?: string;
284
209
  };
285
- declare function MessageActionBar({ isCopied, onCopy, onExportMarkdown, className }: MessageActionBarProps): react.JSX.Element;
210
+ declare function MessageActionBar({ isCopied, onCopy, className }: MessageActionBarProps): react.JSX.Element;
286
211
  declare module "../theme/SlotsProvider.js" {
287
212
  interface AtomSlots {
288
213
  MessageActionBar: typeof MessageActionBar;
289
214
  }
290
215
  }
291
216
 
292
- type UserMessageActionBarProps = {
217
+ type MessageTimestampProps = {
293
218
  className?: string;
294
219
  };
295
- declare function UserMessageActionBar({ className }: UserMessageActionBarProps): react.JSX.Element;
220
+ declare function MessageTimestamp({ className }: MessageTimestampProps): react.JSX.Element | null;
296
221
  declare module "../theme/SlotsProvider.js" {
297
222
  interface AtomSlots {
298
- UserMessageActionBar: typeof UserMessageActionBar;
223
+ MessageTimestamp: typeof MessageTimestamp;
299
224
  }
300
225
  }
301
226
 
302
- type BranchIndicatorProps = {
303
- index: number;
304
- count: number;
305
- onPrevious: () => void;
306
- onNext: () => void;
227
+ type UserMessageActionBarProps = {
307
228
  className?: string;
308
229
  };
309
- declare function BranchIndicator({ index, count, onPrevious, onNext, className }: BranchIndicatorProps): react.JSX.Element | null;
230
+ declare function UserMessageActionBar({ className }: UserMessageActionBarProps): react.JSX.Element;
310
231
  declare module "../theme/SlotsProvider.js" {
311
232
  interface AtomSlots {
312
- BranchIndicator: typeof BranchIndicator;
233
+ UserMessageActionBar: typeof UserMessageActionBar;
313
234
  }
314
235
  }
315
236
 
@@ -344,8 +265,8 @@ declare module "../theme/SlotsProvider.js" {
344
265
  }
345
266
  }
346
267
 
347
- type ScrollToBottomButtonProps = Omit<IconButtonProps, "tooltip" | "children">;
348
- declare const ScrollToBottomButton: react.ForwardRefExoticComponent<Omit<ScrollToBottomButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
268
+ type ScrollToBottomButtonProps = Omit<IconButtonProps, "tooltip" | "icon">;
269
+ declare const ScrollToBottomButton: react.ForwardRefExoticComponent<ScrollToBottomButtonProps & react.RefAttributes<HTMLSpanElement>>;
349
270
  declare module "../theme/SlotsProvider.js" {
350
271
  interface AtomSlots {
351
272
  ScrollToBottomButton: typeof ScrollToBottomButton;
@@ -374,66 +295,71 @@ declare module "../theme/SlotsProvider.js" {
374
295
  }
375
296
 
376
297
  type ToolCallStatus = "running" | "success" | "error";
377
- type ToolCallCardBaseProps = {
378
- variant: "tool" | "sub-agent" | "mcp-listing";
379
- name: string;
380
- status: ToolCallStatus;
381
- expanded: boolean;
382
- onToggle: () => void;
383
- /** Not in the Section 6 screenshot contract; ported from the reference's live per-call timer. */
384
- durationText?: string;
385
- className?: string;
386
- };
387
- type ToolCallCardToolProps = ToolCallCardBaseProps & {
388
- variant: "tool";
389
- argsText?: string;
390
- result?: string;
391
- isError?: boolean;
392
- /**
393
- * Extends the Section 6 contract: renders the pending tool-approval / ask-user
394
- * UI when this call requires action. The reference screenshots didn't include
395
- * an in-flight approval state, so this slot was inferred rather than observed.
396
- */
298
+ type ToolCallCardProps = Omit<ToolCallCardProps$1, "className"> & {
397
299
  approvalSlot?: ReactNode;
300
+ requestSlot?: ReactNode;
301
+ responseSlot?: ReactNode;
302
+ className?: string;
398
303
  };
399
- type ToolCallCardSubAgentProps = ToolCallCardBaseProps & {
400
- variant: "sub-agent";
304
+ declare function ToolCallCard(props: ToolCallCardProps): react.JSX.Element;
305
+ declare module "../theme/SlotsProvider.js" {
306
+ interface AtomSlots {
307
+ ToolCallCard: typeof ToolCallCard;
308
+ }
309
+ }
310
+
311
+ type ToolCallContentBlockProps = ToolCallContentBlockProps$1;
312
+ declare function ToolCallContentBlock(props: ToolCallContentBlockProps): react.JSX.Element;
313
+ declare module "../theme/SlotsProvider.js" {
314
+ interface AtomSlots {
315
+ ToolCallContentBlock: typeof ToolCallContentBlock;
316
+ }
317
+ }
318
+
319
+ type SubAgentCardProps = {
401
320
  agentName: string;
402
321
  instruction: string;
403
322
  stepCount: number;
323
+ status: ToolCallStatus;
324
+ expanded: boolean;
325
+ onToggle: () => void;
326
+ durationText?: string;
404
327
  children?: ReactNode;
328
+ className?: string;
405
329
  };
406
- type ToolCallCardMcpProps = ToolCallCardBaseProps & {
407
- variant: "mcp-listing";
408
- serverName: string;
409
- description: string;
410
- argsText: string;
411
- resultText: string;
412
- };
413
- type ToolCallCardProps = ToolCallCardToolProps | ToolCallCardSubAgentProps | ToolCallCardMcpProps;
414
- declare function ToolCallCard(props: ToolCallCardProps): react.JSX.Element;
330
+ declare function SubAgentCard({ agentName, instruction, stepCount, status, expanded, onToggle, durationText, children, className, }: SubAgentCardProps): react.JSX.Element;
415
331
  declare module "../theme/SlotsProvider.js" {
416
332
  interface AtomSlots {
417
- ToolCallCard: typeof ToolCallCard;
333
+ SubAgentCard: typeof SubAgentCard;
418
334
  }
419
335
  }
420
336
 
421
- type ToolApprovalOption = {
422
- id: string;
423
- label: string;
424
- isAllow: boolean;
425
- grants?: readonly string[];
426
- confirm?: {
427
- title?: string;
428
- description?: string;
429
- };
430
- };
431
- type ToolApprovalBarProps = {
432
- options: ToolApprovalOption[];
433
- onSelectOption: (optionId: string) => void;
337
+ type SandboxToolCallCardProps = {
338
+ name: string;
339
+ intent?: string;
340
+ status: ToolCallStatus;
341
+ expanded: boolean;
342
+ onToggle: () => void;
343
+ command?: string;
344
+ exitCode?: number | null;
345
+ argsJson?: string;
346
+ resultText?: string;
347
+ resultJson?: string;
348
+ viewMode?: "terminal" | "code";
349
+ hasContent?: boolean;
350
+ onViewModeChange?: (viewMode: "terminal" | "code") => void;
351
+ durationText?: string;
434
352
  className?: string;
435
353
  };
436
- declare function ToolApprovalBar({ options, onSelectOption, className }: ToolApprovalBarProps): react.JSX.Element;
354
+ declare function SandboxToolCallCard({ name, intent, status, expanded, onToggle, command, exitCode, argsJson, resultText, resultJson, viewMode, hasContent, onViewModeChange, durationText, className, }: SandboxToolCallCardProps): react.JSX.Element;
355
+ declare module "../theme/SlotsProvider.js" {
356
+ interface AtomSlots {
357
+ SandboxToolCallCard: typeof SandboxToolCallCard;
358
+ }
359
+ }
360
+
361
+ type ToolApprovalBarProps = ToolApprovalBlockProps;
362
+ declare function ToolApprovalBar({ className, ...props }: ToolApprovalBarProps): react.JSX.Element;
437
363
  declare module "../theme/SlotsProvider.js" {
438
364
  interface AtomSlots {
439
365
  ToolApprovalBar: typeof ToolApprovalBar;
@@ -455,15 +381,9 @@ declare module "../theme/SlotsProvider.js" {
455
381
  }
456
382
  }
457
383
 
458
- type ReasoningCardProps = {
459
- streaming: boolean;
460
- expanded: boolean;
461
- onToggle: () => void;
462
- children: ReactNode;
463
- className?: string;
464
- };
465
- declare function ReasoningCard({ streaming, expanded, onToggle, children, className }: ReasoningCardProps): react.JSX.Element;
466
- declare module "../theme/SlotsProvider.js" {
384
+ /** Typed SDK slot adapter over tfy-web-components ReasoningCard. */
385
+ declare function ReasoningCard(props: ReasoningCardProps): react.JSX.Element;
386
+ declare module "../../theme/SlotsProvider.js" {
467
387
  interface AtomSlots {
468
388
  ReasoningCard: typeof ReasoningCard;
469
389
  }
@@ -491,50 +411,30 @@ declare module "../theme/SlotsProvider.js" {
491
411
  }
492
412
  }
493
413
 
494
- type AskUserOption = {
495
- id: string;
496
- label: string;
497
- };
498
- type AskUserPromptProps = {
499
- question: string;
500
- options: AskUserOption[];
501
- allowOther: boolean;
502
- selectedOptionId?: string;
503
- otherValue: string;
504
- disabled: boolean;
505
- onSelectOption: (optionId: string) => void;
506
- onOtherValueChange: (value: string) => void;
507
- onSubmit: () => void;
508
- className?: string;
509
- };
510
- declare function AskUserPrompt({ question, options, allowOther, selectedOptionId, otherValue, disabled, onSelectOption, onOtherValueChange, onSubmit, className, }: AskUserPromptProps): react.JSX.Element;
511
- declare module "../theme/SlotsProvider.js" {
414
+ type AskUserPromptProps = AskUserQuestionCardProps;
415
+
416
+ /** Typed SDK slot adapter over tfy-web-components AskUserQuestionCard. */
417
+ declare function AskUserPrompt(props: AskUserPromptProps): react.JSX.Element;
418
+ declare module "../../theme/SlotsProvider.js" {
512
419
  interface AtomSlots {
513
420
  AskUserPrompt: typeof AskUserPrompt;
514
421
  }
515
422
  }
516
423
 
517
- type McpAuthServer = {
518
- id: string;
519
- name: string;
520
- authUrl: string;
521
- };
522
- type McpAuthPromptProps = {
523
- servers: McpAuthServer[];
524
- disabled: boolean;
525
- onContinue: () => void;
526
- className?: string;
527
- };
528
- declare function McpAuthPrompt({ servers, disabled, onContinue, className }: McpAuthPromptProps): react.JSX.Element;
529
- declare module "../theme/SlotsProvider.js" {
424
+ type McpAuthPromptProps = McpAuthCardProps;
425
+
426
+ /** Typed SDK slot adapter over tfy-web-components McpAuthCard. */
427
+ declare function McpAuthPrompt(props: McpAuthPromptProps): react.JSX.Element;
428
+ declare module "../../theme/SlotsProvider.js" {
530
429
  interface AtomSlots {
531
430
  McpAuthPrompt: typeof McpAuthPrompt;
532
431
  }
533
432
  }
534
433
 
535
- type AttachmentCardSize = "chip" | "preview";
536
434
  /** Fixed preview bounds for attachments rendered in user message bubbles. */
537
435
  declare const USER_MESSAGE_ATTACHMENT_PREVIEW_REM = 12;
436
+
437
+ type AttachmentCardSize = "chip" | "preview";
538
438
  type AttachmentCardProps = {
539
439
  name: string;
540
440
  contentType?: string;
@@ -564,7 +464,7 @@ declare module "../theme/SlotsProvider.js" {
564
464
  }
565
465
  }
566
466
 
567
- type AttachmentPickerButtonProps = Omit<IconButtonProps, "tooltip" | "children">;
467
+ type AttachmentPickerButtonProps = Omit<IconButtonProps, "tooltip" | "icon">;
568
468
  declare function AttachmentPickerButton(props: AttachmentPickerButtonProps): react.JSX.Element;
569
469
  declare module "../theme/SlotsProvider.js" {
570
470
  interface AtomSlots {
@@ -587,7 +487,7 @@ declare module "../theme/SlotsProvider.js" {
587
487
  }
588
488
  }
589
489
 
590
- type ThreadListNewButtonProps = Omit<ButtonProps, "children">;
490
+ type ThreadListNewButtonProps = Omit<ButtonProps, "text" | "icon">;
591
491
  declare function ThreadListNewButton({ className, ...rest }: ThreadListNewButtonProps): react.JSX.Element;
592
492
  type ThreadListRowSkeletonProps = {
593
493
  count?: number;
@@ -621,7 +521,7 @@ type ToastProps = {
621
521
  onOpenChange: (open: boolean) => void;
622
522
  className?: string;
623
523
  };
624
- declare function Toast({ title, description, open, onOpenChange, className }: ToastProps): react.JSX.Element;
524
+ declare function Toast({ title, description, open, onOpenChange, className }: ToastProps): react.JSX.Element | null;
625
525
  type ToastStackProps = {
626
526
  children: ReactNode;
627
527
  duration?: number;
@@ -654,16 +554,38 @@ declare function AssistantTextContainer(): react.JSX.Element;
654
554
 
655
555
  declare const ToolCallContainer: ToolCallMessagePartComponent;
656
556
 
557
+ declare function ToolCallContentBlockContainer(props: ToolCallContentBlockProps): react.JSX.Element;
558
+
559
+ type ToolApprovalOption = {
560
+ id: string;
561
+ label: string;
562
+ isAllow: boolean;
563
+ grants?: readonly string[];
564
+ confirm?: {
565
+ title?: string;
566
+ description?: string;
567
+ };
568
+ };
569
+ type ToolApprovalContainerProps = {
570
+ toolName?: string;
571
+ options: ToolApprovalOption[];
572
+ onSelectOption: (optionId: string, reason?: string) => void;
573
+ };
574
+ declare function ToolApprovalContainer({ toolName, options, onSelectOption, }: ToolApprovalContainerProps): react.JSX.Element;
575
+
657
576
  type ThreadGroupPart = MessagePrimitive.GroupedParts.GroupPart;
658
- declare function ToolGroupContainer({ group, children }: PropsWithChildren<{
577
+ declare function ToolGroupContainer({ children, group, }: PropsWithChildren<{
659
578
  group: ThreadGroupPart;
660
579
  }>): react.JSX.Element;
661
580
 
662
- declare function ReasoningContainer({ group, children }: PropsWithChildren<{
581
+ declare function ReasoningContainer({ group }: {
663
582
  group: ThreadGroupPart;
664
- }>): react.JSX.Element;
583
+ }): react.JSX.Element;
665
584
 
666
- declare function ComposerContainer(): react.JSX.Element;
585
+ type ComposerContainerProps = {
586
+ placeholder?: string;
587
+ };
588
+ declare function ComposerContainer({ placeholder, }: ComposerContainerProps): react.JSX.Element;
667
589
 
668
590
  type ComposerBusyState = {
669
591
  /** True while submitting or while the turn stream is active. */
@@ -686,6 +608,31 @@ declare function ComposerBusyProvider({ children }: {
686
608
  */
687
609
  declare function useComposerBusyState(): ComposerBusyState;
688
610
 
611
+ type ThreadPauseState = {
612
+ thread: {
613
+ messages: readonly {
614
+ role: string;
615
+ status?: {
616
+ type: string;
617
+ };
618
+ metadata?: {
619
+ custom?: unknown;
620
+ };
621
+ }[];
622
+ };
623
+ };
624
+ /** Returns true when the latest assistant message is paused for MCP authorization. */
625
+ declare function threadHasPendingMcpAuth(s: ThreadPauseState): boolean;
626
+ type ComposerPauseView = {
627
+ kind: "mcp";
628
+ } | {
629
+ kind: "ask-user";
630
+ } | {
631
+ kind: "compose";
632
+ };
633
+ /** Shared composer pause detection for default and custom composer containers. */
634
+ declare function useComposerPauseView(): ComposerPauseView;
635
+
689
636
  declare function AskUserContainer(): react.JSX.Element | null;
690
637
 
691
638
  declare function McpAuthContainer(): react.JSX.Element | null;
@@ -715,4 +662,4 @@ declare function useErrorToasterOptional(): ErrorToasterContextValue | null;
715
662
  /** The full assembled thread view: message list + composer. */
716
663
  declare function Thread(): react.JSX.Element;
717
664
 
718
- export { AskUserContainer, type AskUserOption, AskUserPrompt, type AskUserPromptProps, type AssistantMessageBubbleProps, AssistantMessageContainer, AssistantTextContainer, type AtomSlots, AttachmentCard, type AttachmentCardProps, type AttachmentCardSize, AttachmentPickerButton, type AttachmentPickerButtonProps, AttachmentPreviewDialog, type AttachmentPreviewDialogProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, BranchIndicator, type BranchIndicatorProps, Button, type ButtonProps, CodeBlockHeader, type CodeBlockHeaderProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, type ColorToken, ComposerAttachmentPickerContainer, ComposerAttachmentsContainer, ComposerBusyProvider, type ComposerBusyState, ComposerContainer, ComposerShell, type ComposerShellProps, type DesignTokens, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, ErrorToasterProvider, IconButton, type IconButtonProps, Markdown, type MarkdownProps, McpAuthContainer, McpAuthPrompt, type McpAuthPromptProps, type McpAuthServer, MessageActionBar, type MessageActionBarProps, MessageAttachmentsContainer, MessageBubble, type MessageBubbleProps, MessageErrorBanner, type MessageErrorBannerProps, MessageGroup, type MessageGroupProps, MessageIndicator, type MessageIndicatorProps, MessageListSkeleton, type MessageListSkeletonProps, OpenUIBlock, type OpenUIBlockProps, type RadiusToken, ReasoningCard, type ReasoningCardProps, ReasoningContainer, type SandboxArtifactLink, SandboxArtifactList, type SandboxArtifactListProps, ScrollToBottomButton, type ScrollToBottomButtonProps, Skeleton, type SkeletonProps, type SlotOverrides, SlotsProvider, type SpacingToken, Thread, ThreadComposerAreaShell, type ThreadComposerAreaShellProps, ThreadContainer, type ThreadContainerProps, type ThreadGroupPart, ThreadListContainer, ThreadListEmptyState, type ThreadListEmptyStateProps, ThreadListNewButton, type ThreadListNewButtonProps, ThreadListRow, type ThreadListRowProps, ThreadListRowSkeleton, type ThreadListRowSkeletonProps, ThreadListShell, type ThreadListShellProps, ThreadRootShell, type ThreadRootShellProps, ThreadViewportShell, type ThreadViewportShellProps, Toast, type ToastProps, ToastStack, type ToastStackProps, TokensProvider, ToolApprovalBar, type ToolApprovalBarProps, type ToolApprovalOption, ToolCallCard, type ToolCallCardMcpProps, type ToolCallCardProps, type ToolCallCardSubAgentProps, type ToolCallCardToolProps, ToolCallContainer, type ToolCallStatus, ToolGroupCard, type ToolGroupCardProps, ToolGroupContainer, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps, type TypeRoleToken, type TypeRoleValue, USER_MESSAGE_ATTACHMENT_PREVIEW_REM, UserEditComposerContainer, UserMessageActionBar, type UserMessageActionBarProps, type UserMessageBubbleProps, UserMessageContainer, WelcomeScreen, type WelcomeScreenProps, buttonVariants, defaultSlots, defaultTokens, useComposerBusyState, useErrorToaster, useErrorToasterOptional, useSlot, useTokens };
665
+ export { AskUserContainer, type AskUserPromptProps, type AskUserPromptProps as AskUserQuestionCardProps, AssistantMessageBubble, type AssistantMessageBubbleProps, AssistantMessageContainer, AssistantTextContainer, type AtomSlots, AttachmentCard, type AttachmentCardProps, type AttachmentCardSize, AttachmentPickerButton, type AttachmentPickerButtonProps, AttachmentPreviewDialog, type AttachmentPreviewDialogProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, type ColorToken, ComposerAttachmentPickerContainer, ComposerAttachmentsContainer, ComposerBusyProvider, type ComposerBusyState, ComposerContainer, type ComposerContainerProps, ComposerLeftSection, type ComposerLeftSectionProps, type ComposerPauseView, ComposerRightSection, type ComposerRightSectionProps, ComposerSendButton, type ComposerSendButtonProps, ComposerShell, type ComposerShellProps, type DesignTokens, ErrorToasterProvider, Markdown, type MarkdownProps, type McpAuthPromptProps as McpAuthCardProps, McpAuthContainer, type McpAuthPromptProps, MessageActionBar, type MessageActionBarProps, MessageAttachmentsContainer, MessageErrorBanner, type MessageErrorBannerProps, MessageGroup, type MessageGroupProps, MessageIndicator, type MessageIndicatorProps, MessageListSkeleton, type MessageListSkeletonProps, MessageTimestamp, type MessageTimestampProps, type RadiusToken, ReasoningContainer, SandboxToolCallCard, type SandboxToolCallCardProps, ScrollToBottomButton, type ScrollToBottomButtonProps, type SlotOverrides, SlotsProvider, type SpacingToken, SubAgentCard, type SubAgentCardProps, type ThemeMode, Thread, ThreadComposerAreaShell, type ThreadComposerAreaShellProps, ThreadContainer, type ThreadContainerProps, type ThreadGroupPart, ThreadListContainer, ThreadListEmptyState, type ThreadListEmptyStateProps, ThreadListNewButton, type ThreadListNewButtonProps, ThreadListRow, type ThreadListRowProps, ThreadListRowSkeleton, type ThreadListRowSkeletonProps, ThreadListShell, type ThreadListShellProps, type ThreadPauseState, ThreadRootShell, type ThreadRootShellProps, ThreadViewportShell, type ThreadViewportShellProps, Toast, type ToastProps, ToastStack, type ToastStackProps, TokensProvider, ToolApprovalBar, type ToolApprovalBarProps, ToolApprovalContainer, type ToolApprovalOption, ToolCallCard, type ToolCallCardProps, ToolCallContainer, ToolCallContentBlock, ToolCallContentBlockContainer, type ToolCallContentBlockProps, type ToolCallStatus, ToolGroupCard, type ToolGroupCardProps, ToolGroupContainer, type TypeRoleToken, type TypeRoleValue, USER_MESSAGE_ATTACHMENT_PREVIEW_REM, UserEditComposerContainer, UserMessageActionBar, type UserMessageActionBarProps, UserMessageBubble, type UserMessageBubbleProps, UserMessageContainer, UserMessageEdit, type UserMessageEditProps, WelcomeScreen, type WelcomeScreenProps, defaultSlots, defaultTokens, threadHasPendingMcpAuth, useComposerBusyState, useComposerPauseView, useErrorToaster, useErrorToasterOptional, useSlot, useThemeMode, useTokens };