@truefoundry/agent-ui-sdk 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -150,7 +150,7 @@ import {
150
150
 
151
151
  const client = new AgentSessionClient({
152
152
  apiKey: process.env.TFY_API_KEY!,
153
- environment: process.env.TFY_GATEWAY_URL!, // https://gateway.truefoundry.ai/<tenant>
153
+ baseUrl: process.env.TFY_GATEWAY_URL!, // https://gateway.truefoundry.ai/<tenant>
154
154
  });
155
155
 
156
156
  export function App() {
@@ -179,6 +179,40 @@ export function App() {
179
179
  }
180
180
  ```
181
181
 
182
+ ### Draft mode and sandbox downloads
183
+
184
+ Named-agent mode only needs `AgentSessionClient`. Draft mode and sandbox file
185
+ downloads also need a `PrivateAgentSessionClient`:
186
+
187
+ ```tsx
188
+ import { PrivateAgentSessionClient } from "truefoundry-gateway-sdk/agents/private";
189
+
190
+ const privateClient = new PrivateAgentSessionClient({
191
+ apiKey: process.env.TFY_API_KEY!,
192
+ baseUrl: process.env.TFY_GATEWAY_URL!,
193
+ });
194
+
195
+ const runtime = useTrueFoundryAgentRuntime({
196
+ client,
197
+ privateClient,
198
+ agent: {
199
+ mode: "draft",
200
+ defaultAgentSpec: { model: { name: "anthropic/claude-sonnet-4-6" } },
201
+ },
202
+ adapters: { attachments: trueFoundryAttachmentAdapter },
203
+ });
204
+ ```
205
+
206
+ ### Cross-agent History (owned sessions)
207
+
208
+ `<ThreadListContainer />` lists whatever thread-list adapter the runtime
209
+ installed — typically one named agent or the caller's drafts. For a History
210
+ sidebar of **every** session the user owns (named + draft), use
211
+ `createTrueFoundryOwnedSessionsThreadListAdapter({ privateClient })` or call
212
+ `privateClient.listOwnedSessions()` directly and render your own list. That
213
+ adapter is read-only (`initialize` throws); keep a separate named/draft
214
+ runtime for creating and sending turns.
215
+
182
216
  That's the whole integration. Three things to know:
183
217
 
184
218
  - `**<Thread />**` is the fully-assembled message list + composer. It handles
package/dist/index.d.ts CHANGED
@@ -16,8 +16,8 @@ import Dialog from 'tfy-web-components/components/molecules/Dialog';
16
16
  export { default as Dialog } from 'tfy-web-components/components/molecules/Dialog';
17
17
  export { IconProp, default as IconProvider, registerIcons, registerImgIcons } from 'tfy-web-components/components/atoms/IconProvider';
18
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';
19
+ import { ToolCallCardProps as ToolCallCardProps$1, ToolCallContentBlockProps as ToolCallContentBlockProps$1, ToolApprovalBlockProps, AgentStepsCardProps, ReasoningCardProps, AskUserQuestionCardProps, McpAuthCardProps } from 'tfy-web-components/components/molecules/agent-chat';
20
+ export { AgentStepsCardProps, 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
22
  import { PartState } from '@assistant-ui/core/react';
23
23
 
@@ -399,17 +399,9 @@ declare module "../theme/SlotsProvider.js" {
399
399
  }
400
400
  }
401
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" {
402
+ /** Typed SDK slot adapter over tfy-web-components AgentStepsCard. */
403
+ declare function AgentStepsCard(props: AgentStepsCardProps): react.JSX.Element;
404
+ declare module "../../theme/SlotsProvider.js" {
413
405
  interface AtomSlots {
414
406
  AgentStepsCard: typeof AgentStepsCard;
415
407
  }
@@ -726,4 +718,4 @@ interface AgentStepsSplitResult {
726
718
  }
727
719
  declare function computeAgentStepsSplit(parts: readonly PartState[], isRunning: boolean): AgentStepsSplitResult;
728
720
 
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 };
721
+ export { AgentStepsCard, 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 };