@truefoundry/agent-ui-sdk 0.0.3 → 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"> & {
@@ -382,6 +399,22 @@ declare module "../theme/SlotsProvider.js" {
382
399
  }
383
400
  }
384
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
+
385
418
  /** Typed SDK slot adapter over tfy-web-components ReasoningCard. */
386
419
  declare function ReasoningCard(props: ReasoningCardProps): react.JSX.Element;
387
420
  declare module "../../theme/SlotsProvider.js" {
@@ -545,6 +578,16 @@ type ThreadContainerProps = {
545
578
  };
546
579
  declare function ThreadContainer({ composer }: ThreadContainerProps): react.JSX.Element;
547
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
+
548
591
  declare function AssistantMessageContainer(): react.JSX.Element;
549
592
 
550
593
  declare function UserMessageContainer(): react.JSX.Element;
@@ -579,6 +622,18 @@ declare function ToolGroupContainer({ children, group, }: PropsWithChildren<{
579
622
  group: ThreadGroupPart;
580
623
  }>): react.JSX.Element;
581
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
+
582
637
  declare function ReasoningContainer({ group }: {
583
638
  group: ThreadGroupPart;
584
639
  }): react.JSX.Element;
@@ -663,4 +718,12 @@ declare function useErrorToasterOptional(): ErrorToasterContextValue | null;
663
718
  /** The full assembled thread view: message list + composer. */
664
719
  declare function Thread(): react.JSX.Element;
665
720
 
666
- 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 };