@truefoundry/agent-ui-sdk 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import { UserMessageEditProps as UserMessageEditProps$1 } from 'tfy-web-componen
19
19
  import { ToolCallCardProps as ToolCallCardProps$1, ToolCallContentBlockProps as ToolCallContentBlockProps$1, ToolApprovalBlockProps, ReasoningCardProps, AskUserQuestionCardProps, McpAuthCardProps } from 'tfy-web-components/components/molecules/agent-chat';
20
20
  export { AskUserAnswerDraft, AnsweredQuestion as AskUserAnsweredQuestion, Question as AskUserQuestion, McpServer as McpAuthServer, ReasoningCardProps } from 'tfy-web-components/components/molecules/agent-chat';
21
21
  import { ToolCallMessagePartComponent, MessagePrimitive } from '@assistant-ui/react';
22
+ import { PartState } from '@assistant-ui/core/react';
22
23
 
23
24
  type ComposerLeftSectionProps = {
24
25
  disabled: boolean;
@@ -273,6 +274,22 @@ declare module "../theme/SlotsProvider.js" {
273
274
  }
274
275
  }
275
276
 
277
+ type HistoryLoaderProps = ComponentPropsWithRef<"div"> & {
278
+ /** True while an older-history page is being fetched. */
279
+ isLoading?: boolean;
280
+ };
281
+ /**
282
+ * Inline status row shown at the top of the message list when older history
283
+ * pages are available. Doubles as the scroll sentinel observed by
284
+ * `HistoryLoaderContainer`.
285
+ */
286
+ declare const HistoryLoader: react.ForwardRefExoticComponent<Omit<HistoryLoaderProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
287
+ declare module "../theme/SlotsProvider.js" {
288
+ interface AtomSlots {
289
+ HistoryLoader: typeof HistoryLoader;
290
+ }
291
+ }
292
+
276
293
  type ThreadRootShellProps = ComponentPropsWithRef<"div">;
277
294
  declare const ThreadRootShell: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
278
295
  type ThreadViewportShellProps = ComponentPropsWithRef<"div"> & {
@@ -300,6 +317,7 @@ type ToolCallCardProps = Omit<ToolCallCardProps$1, "className"> & {
300
317
  requestSlot?: ReactNode;
301
318
  responseSlot?: ReactNode;
302
319
  className?: string;
320
+ mcpServerName?: string;
303
321
  };
304
322
  declare function ToolCallCard(props: ToolCallCardProps): react.JSX.Element;
305
323
  declare module "../theme/SlotsProvider.js" {
@@ -381,6 +399,22 @@ declare module "../theme/SlotsProvider.js" {
381
399
  }
382
400
  }
383
401
 
402
+ type AgentStepsCardProps = {
403
+ toolCount: number;
404
+ thinkingCount: number;
405
+ expanded: boolean;
406
+ active?: boolean;
407
+ onToggle: () => void;
408
+ children: ReactNode;
409
+ className?: string;
410
+ };
411
+ declare function AgentStepsCard({ toolCount, thinkingCount, expanded, active, onToggle, children, className, }: AgentStepsCardProps): react.JSX.Element;
412
+ declare module "../theme/SlotsProvider.js" {
413
+ interface AtomSlots {
414
+ AgentStepsCard: typeof AgentStepsCard;
415
+ }
416
+ }
417
+
384
418
  /** Typed SDK slot adapter over tfy-web-components ReasoningCard. */
385
419
  declare function ReasoningCard(props: ReasoningCardProps): react.JSX.Element;
386
420
  declare module "../../theme/SlotsProvider.js" {
@@ -544,6 +578,16 @@ type ThreadContainerProps = {
544
578
  };
545
579
  declare function ThreadContainer({ composer }: ThreadContainerProps): react.JSX.Element;
546
580
 
581
+ /**
582
+ * Renders the `HistoryLoader` slot at the top of the message list and fetches
583
+ * the next older history page when the user scrolls near it. Scroll position
584
+ * is preserved across the prepend so the list doesn't jump.
585
+ *
586
+ * Must be rendered inside `ThreadViewportShell` (it locates the scroll root
587
+ * via the `aui_thread-viewport` data-slot on its nearest scrollable ancestor).
588
+ */
589
+ declare function HistoryLoaderContainer(): react.JSX.Element | null;
590
+
547
591
  declare function AssistantMessageContainer(): react.JSX.Element;
548
592
 
549
593
  declare function UserMessageContainer(): react.JSX.Element;
@@ -578,6 +622,18 @@ declare function ToolGroupContainer({ children, group, }: PropsWithChildren<{
578
622
  group: ThreadGroupPart;
579
623
  }>): react.JSX.Element;
580
624
 
625
+ interface AgentStepsContainerProps {
626
+ toolCount: number;
627
+ thinkingCount: number;
628
+ hasFinal: boolean;
629
+ active: boolean;
630
+ }
631
+ /**
632
+ * Container for "Agent steps" section — groups reasoning, intermediate text, and tools
633
+ * in a collapsible accordion that auto-collapses once final answer is confirmed.
634
+ */
635
+ declare function AgentStepsContainer({ children, toolCount, thinkingCount, hasFinal, active, }: PropsWithChildren<AgentStepsContainerProps>): react.JSX.Element;
636
+
581
637
  declare function ReasoningContainer({ group }: {
582
638
  group: ThreadGroupPart;
583
639
  }): react.JSX.Element;
@@ -662,4 +718,12 @@ declare function useErrorToasterOptional(): ErrorToasterContextValue | null;
662
718
  /** The full assembled thread view: message list + composer. */
663
719
  declare function Thread(): react.JSX.Element;
664
720
 
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 };
721
+ interface AgentStepsSplitResult {
722
+ cutIndex: number;
723
+ hasFinal: boolean;
724
+ toolCount: number;
725
+ thinkingCount: number;
726
+ }
727
+ declare function computeAgentStepsSplit(parts: readonly PartState[], isRunning: boolean): AgentStepsSplitResult;
728
+
729
+ export { AgentStepsCard, type AgentStepsCardProps, AgentStepsContainer, type AgentStepsContainerProps, type AgentStepsSplitResult, 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, HistoryLoader, HistoryLoaderContainer, type HistoryLoaderProps, 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, computeAgentStepsSplit, defaultSlots, defaultTokens, threadHasPendingMcpAuth, useComposerBusyState, useComposerPauseView, useErrorToaster, useErrorToasterOptional, useSlot, useThemeMode, useTokens };