@truefoundry/trueforge-ui 0.0.0 → 0.1.0-rc.0
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/CHANGELOG.md +340 -0
- package/LICENSE +21 -0
- package/NOTICE +17 -0
- package/README.md +640 -3
- package/dist/ConnectorSettings-CLBEWGQJ.js +898 -0
- package/dist/ConnectorSettings-CLBEWGQJ.js.map +1 -0
- package/dist/DockLayout-WRF7EQLD.js +35 -0
- package/dist/DockLayout-WRF7EQLD.js.map +1 -0
- package/dist/DrawerLayout-X2UXYTOS.js +156 -0
- package/dist/DrawerLayout-X2UXYTOS.js.map +1 -0
- package/dist/ModelSettings-IJ55QJQO.js +1082 -0
- package/dist/ModelSettings-IJ55QJQO.js.map +1 -0
- package/dist/OpenUiFenceBlock-SLLZSTMJ.js +9 -0
- package/dist/OpenUiFenceBlock-SLLZSTMJ.js.map +1 -0
- package/dist/SandboxSettings-S5XGZWOL.js +505 -0
- package/dist/SandboxSettings-S5XGZWOL.js.map +1 -0
- package/dist/SettingsBuilder-64Y33NP3.js +128 -0
- package/dist/SettingsBuilder-64Y33NP3.js.map +1 -0
- package/dist/SidebarLayout-M7HEOZVK.js +236 -0
- package/dist/SidebarLayout-M7HEOZVK.js.map +1 -0
- package/dist/SkillSettings-MXK4ZEI7.js +389 -0
- package/dist/SkillSettings-MXK4ZEI7.js.map +1 -0
- package/dist/WidgetLayout-7MDOKLHU.js +101 -0
- package/dist/WidgetLayout-7MDOKLHU.js.map +1 -0
- package/dist/assistant-ui.d.ts +1 -0
- package/dist/assistant-ui.js +9 -0
- package/dist/assistant-ui.js.map +1 -0
- package/dist/chunk-42GF723P.js +24 -0
- package/dist/chunk-42GF723P.js.map +1 -0
- package/dist/chunk-CFLVPV5M.js +29 -0
- package/dist/chunk-CFLVPV5M.js.map +1 -0
- package/dist/chunk-M6MHLVSO.js +8 -0
- package/dist/chunk-M6MHLVSO.js.map +1 -0
- package/dist/chunk-NBMP2XNL.js +89 -0
- package/dist/chunk-NBMP2XNL.js.map +1 -0
- package/dist/chunk-UBOFEI77.js +567 -0
- package/dist/chunk-UBOFEI77.js.map +1 -0
- package/dist/chunk-UHGSHDBM.js +633 -0
- package/dist/chunk-UHGSHDBM.js.map +1 -0
- package/dist/chunk-UXZOL5GO.js +2088 -0
- package/dist/chunk-UXZOL5GO.js.map +1 -0
- package/dist/chunk-WFC3W4C3.js +73 -0
- package/dist/chunk-WFC3W4C3.js.map +1 -0
- package/dist/chunk-XSHXH6EI.js +6800 -0
- package/dist/chunk-XSHXH6EI.js.map +1 -0
- package/dist/createTrueFoundryServer-B72bU-J7.d.ts +28 -0
- package/dist/index.d.ts +1569 -0
- package/dist/index.js +781 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +479 -0
- package/dist/plugins/trueforge-agent-server-adapter/index.js +830 -0
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +129 -6
- package/index.js +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1569 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ComponentPropsWithRef, ComponentProps, ComponentType, ReactNode, HTMLAttributes, CSSProperties, FC, SVGProps, ComponentPropsWithoutRef, PropsWithChildren } from 'react';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
|
+
import { MessagePrimitive, ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
5
|
+
export { AssistantState, useAui, useAuiState } from '@assistant-ui/react';
|
|
6
|
+
import { UseTrueFoundryAgentRuntimeOptions, TrueFoundryAgentConfig } from '@truefoundry/assistant-ui-runtime';
|
|
7
|
+
export { DraftAgentConfig, NamedAgentConfig, TrueFoundryAgentConfig, UseTrueFoundryAgentRuntimeOptions, mergeAgentSpec, trueFoundryAttachmentAdapter, useTrueFoundryAgentRuntime, useTrueFoundryAgentSpec, useTrueFoundryCancel, useTrueFoundryDownloadSandboxFile, useTrueFoundryHistoryPagination, useTrueFoundryMcpAuth, useTrueFoundryRespondToToolApproval, useTrueFoundryToolResponses, useTrueFoundryTurnId, useTrueFoundryUpdateAgentSpec } from '@truefoundry/assistant-ui-runtime';
|
|
8
|
+
import { AgentSpec, AgentLibraryEntry, CatalogServer, AgentUIServer, AgentBuilderCapabilitiesResponse, ModelSelection, AgentSkill, ConnectorState } from '@truefoundry/assistant-ui-runtime/server';
|
|
9
|
+
export { AgentBuilderCapabilitiesResponse, AgentBuilderServer, AgentChatServer, AgentLibraryEntry, AgentSkill, AgentSpec, AgentUIServer, ApprovalDecision, AuthenticateConnectorRequest, CatalogServer, ConnectorAuth, ConnectorAuthApiKey, ConnectorAuthNone, ConnectorAuthOAuth, ConnectorAuthPublic, ConnectorAuthPublicApiKey, ConnectorAuthPublicNone, ConnectorAuthPublicOAuth, ConnectorAuthType, ConnectorAuthenticationResult, ConnectorBase, ConnectorCatalogEntry, ConnectorCatalogServer, ConnectorConfigBase, ConnectorState, CreateConnectorRequest, CreateModelProviderRequest, CreateSandboxProviderRequest, CreateSessionRequest, CreateSkillRequest, CreateSkillRequestBase, DefinedSkill, GithubSkill, ImportGithubSkillRequest, ListResult, ListSessionsOrder, ListSessionsParams, McpServerMount, Model, ModelCatalogServer, ModelEntry, ModelParams, ModelProperties, ModelProviderBase, ModelProviderCatalogEntry, ModelProviderConfigBase, ModelSelection, ModelSelectorEntry, PageParams, PreviousTurnIdInput, ProviderEntry, ProviderType, RegistrySkill, SandboxCatalogServer, SandboxProviderBase, SandboxProviderCatalogEntry, SandboxProviderConfig, SaveAgentRequest, SaveAgentResult, SearchAgentsParams, SelectRegistrySkillRequest, Session, SessionEventItem, SkillBase, SkillCatalogEntry, SkillCatalogServer, SkillConfigBase, SkillMount, ToolBase, Turn, TurnInputItem, TurnState, TurnStreamData, TurnStreamingEvent, UpdateConnectorRequest, UpdateModelProviderRequest, UpdateSandboxProviderRequest, UpdateSessionRequest, UserMessage, UserMessageContent, UserToolApprovalEvent, UserToolResponseEvent } from '@truefoundry/assistant-ui-runtime/server';
|
|
10
|
+
export { C as CreateTrueFoundryServerOptions, T as TrueFoundryServer, c as createTrueFoundryServer } from './createTrueFoundryServer-B72bU-J7.js';
|
|
11
|
+
import { PartState } from '@assistant-ui/core/react';
|
|
12
|
+
|
|
13
|
+
/** Configured brand name, or the SDK default. Safe outside a `ThemeProvider`. */
|
|
14
|
+
declare function useBrandName(): string;
|
|
15
|
+
/**
|
|
16
|
+
* The product mark: `theme.brand.logo` resolved against the active theme mode,
|
|
17
|
+
* labelled with the brand name, and linked when the config carries an `href`.
|
|
18
|
+
* Falls back to the default mark when no logo is configured.
|
|
19
|
+
*
|
|
20
|
+
* Callers that also want the name as text render it themselves — the SDK layouts
|
|
21
|
+
* pair this with `useBrandName()` so each one controls its own arrangement.
|
|
22
|
+
*/
|
|
23
|
+
declare function BrandLogo({ className }: {
|
|
24
|
+
className?: string;
|
|
25
|
+
}): react.JSX.Element;
|
|
26
|
+
declare module './SlotsProvider.js' {
|
|
27
|
+
interface AtomSlots {
|
|
28
|
+
BrandLogo: typeof BrandLogo;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type ThreadRootShellProps = ComponentPropsWithRef<'div'>;
|
|
33
|
+
declare const ThreadRootShell: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
type ThreadViewportShellProps = ComponentPropsWithRef<'div'> & {
|
|
35
|
+
isEmpty?: boolean;
|
|
36
|
+
};
|
|
37
|
+
declare const ThreadViewportShell: react.ForwardRefExoticComponent<Omit<ThreadViewportShellProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
type ThreadComposerAreaShellProps = ComponentPropsWithRef<'div'> & {
|
|
39
|
+
isEmpty?: boolean;
|
|
40
|
+
};
|
|
41
|
+
declare const ThreadComposerAreaShell: react.ForwardRefExoticComponent<Omit<ThreadComposerAreaShellProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
type MessageGroupProps = ComponentPropsWithRef<'div'>;
|
|
43
|
+
declare const MessageGroup: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
declare module '../theme/SlotsProvider.js' {
|
|
45
|
+
interface AtomSlots {
|
|
46
|
+
ThreadRootShell: typeof ThreadRootShell;
|
|
47
|
+
ThreadViewportShell: typeof ThreadViewportShell;
|
|
48
|
+
ThreadComposerAreaShell: typeof ThreadComposerAreaShell;
|
|
49
|
+
MessageGroup: typeof MessageGroup;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type HistoryLoaderProps = ComponentPropsWithRef<'div'> & {
|
|
54
|
+
/** True while an older-history page is being fetched. */
|
|
55
|
+
isLoading?: boolean;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Inline status row shown at the top of the message list when older history
|
|
59
|
+
* pages are available. Doubles as the scroll sentinel observed by
|
|
60
|
+
* `HistoryLoaderContainer`.
|
|
61
|
+
*/
|
|
62
|
+
declare const HistoryLoader: react.ForwardRefExoticComponent<Omit<HistoryLoaderProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
declare module '../theme/SlotsProvider.js' {
|
|
64
|
+
interface AtomSlots {
|
|
65
|
+
HistoryLoader: typeof HistoryLoader;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type ScrollToBottomButtonProps = Omit<ComponentProps<'button'>, 'children' | 'aria-label'>;
|
|
70
|
+
declare const ScrollToBottomButton: react.ForwardRefExoticComponent<Omit<ScrollToBottomButtonProps, "ref"> & react.RefAttributes<HTMLSpanElement>>;
|
|
71
|
+
declare module '../theme/SlotsProvider.js' {
|
|
72
|
+
interface AtomSlots {
|
|
73
|
+
ScrollToBottomButton: typeof ScrollToBottomButton;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type SyntaxHighlighterProps = {
|
|
78
|
+
code: string;
|
|
79
|
+
language?: string;
|
|
80
|
+
darkTheme?: boolean;
|
|
81
|
+
className?: string;
|
|
82
|
+
showLineNumbers?: boolean;
|
|
83
|
+
};
|
|
84
|
+
declare const SyntaxHighlighter: ComponentType<SyntaxHighlighterProps>;
|
|
85
|
+
declare module '../theme/SlotsProvider.js' {
|
|
86
|
+
interface AtomSlots {
|
|
87
|
+
SyntaxHighlighter: typeof SyntaxHighlighter;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
type UserMessageEditProps = {
|
|
92
|
+
/** Timestamp node rendered beside the "User" label. */
|
|
93
|
+
timestamp?: ReactNode;
|
|
94
|
+
/** Read-only attachments shown above the input while editing. */
|
|
95
|
+
attachments?: ReactNode;
|
|
96
|
+
input: ReactNode;
|
|
97
|
+
footer: ReactNode;
|
|
98
|
+
className?: string;
|
|
99
|
+
};
|
|
100
|
+
declare const UserMessageEdit: react.ForwardRefExoticComponent<UserMessageEditProps & HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
declare module '../theme/SlotsProvider.js' {
|
|
102
|
+
interface AtomSlots {
|
|
103
|
+
UserMessageEdit: typeof UserMessageEdit;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Controlled accordion compatible with prior tfy `expanded` / `onChange` slot usage.
|
|
109
|
+
*/
|
|
110
|
+
type AccordionProps = {
|
|
111
|
+
expanded?: boolean;
|
|
112
|
+
onChange?: (event: unknown, expanded: boolean) => void;
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
className?: string;
|
|
115
|
+
background?: string;
|
|
116
|
+
sx?: unknown;
|
|
117
|
+
} & Omit<react__default.HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
118
|
+
declare function Accordion({ expanded, onChange, children, className, background: _background, sx: _sx, ...rest }: AccordionProps): react__default.JSX.Element;
|
|
119
|
+
type AccordionSummaryProps = {
|
|
120
|
+
children?: ReactNode;
|
|
121
|
+
className?: string;
|
|
122
|
+
expanded?: boolean;
|
|
123
|
+
onChange?: (event: unknown, expanded: boolean) => void;
|
|
124
|
+
panelId?: string;
|
|
125
|
+
hideIcon?: boolean;
|
|
126
|
+
disableRipple?: boolean;
|
|
127
|
+
sx?: unknown;
|
|
128
|
+
};
|
|
129
|
+
declare function AccordionSummary({ children, className, expanded, onChange, panelId }: AccordionSummaryProps): react__default.JSX.Element;
|
|
130
|
+
type AccordionDetailsProps = {
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
className?: string;
|
|
133
|
+
expanded?: boolean;
|
|
134
|
+
panelId?: string;
|
|
135
|
+
sx?: unknown;
|
|
136
|
+
};
|
|
137
|
+
declare function AccordionDetails({ children, className, expanded, panelId }: AccordionDetailsProps): react__default.JSX.Element | null;
|
|
138
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
139
|
+
interface AtomSlots {
|
|
140
|
+
Accordion: typeof Accordion;
|
|
141
|
+
AccordionSummary: typeof AccordionSummary;
|
|
142
|
+
AccordionDetails: typeof AccordionDetails;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type AgentStepsCardProps = {
|
|
147
|
+
toolCount: number;
|
|
148
|
+
thinkingCount: number;
|
|
149
|
+
expanded: boolean;
|
|
150
|
+
active?: boolean;
|
|
151
|
+
onToggle: () => void;
|
|
152
|
+
children: ReactNode;
|
|
153
|
+
borderColor?: string;
|
|
154
|
+
background?: string;
|
|
155
|
+
dataTestPrefix?: string;
|
|
156
|
+
className?: string;
|
|
157
|
+
};
|
|
158
|
+
declare function AgentStepsCard({ toolCount, thinkingCount, expanded, active, onToggle, children, borderColor, background, dataTestPrefix, className, }: AgentStepsCardProps): react.JSX.Element;
|
|
159
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
160
|
+
interface AtomSlots {
|
|
161
|
+
AgentStepsCard: typeof AgentStepsCard;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type Question = {
|
|
166
|
+
id: string;
|
|
167
|
+
question: string;
|
|
168
|
+
options: string[];
|
|
169
|
+
};
|
|
170
|
+
type AnsweredQuestion = Question & {
|
|
171
|
+
answer: string;
|
|
172
|
+
isCustom: boolean;
|
|
173
|
+
};
|
|
174
|
+
type AskUserAnswerDraft = {
|
|
175
|
+
radioValue: string;
|
|
176
|
+
custom: string;
|
|
177
|
+
};
|
|
178
|
+
type AskUserPromptProps = {
|
|
179
|
+
questions: Question[];
|
|
180
|
+
answeredQuestions?: AnsweredQuestion[];
|
|
181
|
+
onSubmit: () => void;
|
|
182
|
+
currentQuestion?: Question;
|
|
183
|
+
currentQuestionIndex?: number;
|
|
184
|
+
currentAnswer?: AskUserAnswerDraft;
|
|
185
|
+
totalQuestions?: number;
|
|
186
|
+
isMultiQuestion?: boolean;
|
|
187
|
+
isLastQuestion?: boolean;
|
|
188
|
+
allQuestionsAnswered?: boolean;
|
|
189
|
+
isSubmitDisabled?: boolean;
|
|
190
|
+
isSubmitAllDisabled?: boolean;
|
|
191
|
+
onCurrentQuestionIndexChange?: (index: number) => void;
|
|
192
|
+
onCurrentAnswerChange?: (questionId: string, update: Partial<AskUserAnswerDraft>) => void;
|
|
193
|
+
readOnly?: boolean;
|
|
194
|
+
dataTestPrefix?: string;
|
|
195
|
+
className?: string;
|
|
196
|
+
};
|
|
197
|
+
declare function AskUserPrompt({ questions, answeredQuestions, onSubmit, currentQuestion, currentQuestionIndex, currentAnswer, totalQuestions, isMultiQuestion: isMultiQuestionProp, isLastQuestion: isLastQuestionProp, allQuestionsAnswered, isSubmitDisabled, isSubmitAllDisabled, onCurrentQuestionIndexChange, onCurrentAnswerChange, readOnly, dataTestPrefix, className, }: AskUserPromptProps): react.JSX.Element | null;
|
|
198
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
199
|
+
interface AtomSlots {
|
|
200
|
+
AskUserPrompt: typeof AskUserPrompt;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type McpServer = {
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
};
|
|
208
|
+
type McpAuthPromptProps = {
|
|
209
|
+
servers: McpServer[];
|
|
210
|
+
onConnect: (serverId: string) => void;
|
|
211
|
+
onContinue?: () => void;
|
|
212
|
+
readOnly?: boolean;
|
|
213
|
+
title?: string;
|
|
214
|
+
dataTestPrefix?: string;
|
|
215
|
+
className?: string;
|
|
216
|
+
};
|
|
217
|
+
declare function McpAuthPrompt({ servers, onConnect, onContinue, readOnly, title, dataTestPrefix, className, }: McpAuthPromptProps): react.JSX.Element | null;
|
|
218
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
219
|
+
interface AtomSlots {
|
|
220
|
+
McpAuthPrompt: typeof McpAuthPrompt;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
type ReasoningCardProps = {
|
|
225
|
+
content: string;
|
|
226
|
+
isStreaming?: boolean;
|
|
227
|
+
expanded?: boolean;
|
|
228
|
+
onToggle?: () => void;
|
|
229
|
+
isMultiLine?: boolean;
|
|
230
|
+
reasoningTimeText?: string | null;
|
|
231
|
+
previewText?: string;
|
|
232
|
+
headingText?: string;
|
|
233
|
+
contentRef?: (node: HTMLDivElement | null) => void;
|
|
234
|
+
dataTestPrefix?: string;
|
|
235
|
+
className?: string;
|
|
236
|
+
};
|
|
237
|
+
declare function ReasoningCard({ content, isStreaming, expanded, onToggle, isMultiLine, reasoningTimeText, headingText, contentRef, dataTestPrefix, className, }: ReasoningCardProps): react.JSX.Element;
|
|
238
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
239
|
+
interface AtomSlots {
|
|
240
|
+
ReasoningCard: typeof ReasoningCard;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
type ResumeUnavailableProps = {
|
|
245
|
+
className?: string;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Inline waiting notice when a response is still generating but this backend
|
|
249
|
+
* cannot stream it live.
|
|
250
|
+
*/
|
|
251
|
+
declare function ResumeUnavailable({ className }: ResumeUnavailableProps): react.JSX.Element;
|
|
252
|
+
declare module '../theme/SlotsProvider.js' {
|
|
253
|
+
interface AtomSlots {
|
|
254
|
+
ResumeUnavailable: typeof ResumeUnavailable;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
type AgentsLibraryProps = {
|
|
259
|
+
open: boolean;
|
|
260
|
+
onOpenChange: (open: boolean) => void;
|
|
261
|
+
onSelectAgent?: (agentName: string) => void;
|
|
262
|
+
};
|
|
263
|
+
declare function AgentsLibrary({ open, onOpenChange, onSelectAgent }: AgentsLibraryProps): react.JSX.Element;
|
|
264
|
+
declare module '../theme/SlotsProvider.js' {
|
|
265
|
+
interface AtomSlots {
|
|
266
|
+
AgentsLibrary: typeof AgentsLibrary;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
type AgentsLibraryButtonProps = {
|
|
271
|
+
className?: string;
|
|
272
|
+
compact?: boolean;
|
|
273
|
+
onSelectAgent?: (agentName: string) => void;
|
|
274
|
+
};
|
|
275
|
+
declare function AgentsLibraryButton({ className, compact, onSelectAgent }: AgentsLibraryButtonProps): react.JSX.Element | null;
|
|
276
|
+
declare module '../theme/SlotsProvider.js' {
|
|
277
|
+
interface AtomSlots {
|
|
278
|
+
AgentsLibraryButton: typeof AgentsLibraryButton;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
type AssistantMessageBubbleProps = {
|
|
283
|
+
children: ReactNode;
|
|
284
|
+
error?: ReactNode;
|
|
285
|
+
actionBar?: ReactNode;
|
|
286
|
+
className?: string;
|
|
287
|
+
};
|
|
288
|
+
declare function AssistantMessageBubble({ children, error, actionBar, className }: AssistantMessageBubbleProps): react.JSX.Element;
|
|
289
|
+
declare module '../theme/SlotsProvider.js' {
|
|
290
|
+
interface AtomSlots {
|
|
291
|
+
AssistantMessageBubble: typeof AssistantMessageBubble;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Fixed preview bounds for attachments rendered in user message bubbles. */
|
|
296
|
+
declare const USER_MESSAGE_ATTACHMENT_PREVIEW_REM = 12;
|
|
297
|
+
|
|
298
|
+
type AttachmentCardSize = 'chip' | 'preview';
|
|
299
|
+
type AttachmentCardProps = {
|
|
300
|
+
name: string;
|
|
301
|
+
contentType?: string;
|
|
302
|
+
previewSrc?: string;
|
|
303
|
+
isImage?: boolean;
|
|
304
|
+
size?: AttachmentCardSize;
|
|
305
|
+
/** When set, constrains image preview and file chip width to this rem size. */
|
|
306
|
+
previewRem?: number;
|
|
307
|
+
onRemove?: () => void;
|
|
308
|
+
className?: string;
|
|
309
|
+
};
|
|
310
|
+
declare function AttachmentCard({ name, previewSrc, isImage, size, previewRem, onRemove, className, }: AttachmentCardProps): react.JSX.Element;
|
|
311
|
+
declare module '../theme/SlotsProvider.js' {
|
|
312
|
+
interface AtomSlots {
|
|
313
|
+
AttachmentCard: typeof AttachmentCard;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
type AttachmentPickerButtonProps = Omit<ComponentProps<'button'>, 'children' | 'aria-label'>;
|
|
318
|
+
declare function AttachmentPickerButton({ className, ...props }: AttachmentPickerButtonProps): react.JSX.Element;
|
|
319
|
+
declare module '../theme/SlotsProvider.js' {
|
|
320
|
+
interface AtomSlots {
|
|
321
|
+
AttachmentPickerButton: typeof AttachmentPickerButton;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
type AttachmentPreviewDialogProps = {
|
|
326
|
+
previewSrc?: string;
|
|
327
|
+
children: ReactNode;
|
|
328
|
+
};
|
|
329
|
+
declare function AttachmentPreviewDialog({ previewSrc, children }: AttachmentPreviewDialogProps): react.JSX.Element;
|
|
330
|
+
declare module '../theme/SlotsProvider.js' {
|
|
331
|
+
interface AtomSlots {
|
|
332
|
+
AttachmentPreviewDialog: typeof AttachmentPreviewDialog;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
type ChatFileDownloadFile = {
|
|
337
|
+
name: string;
|
|
338
|
+
path: string;
|
|
339
|
+
};
|
|
340
|
+
type ChatFileDownloadProps = {
|
|
341
|
+
files: ChatFileDownloadFile[];
|
|
342
|
+
fileDownloadBaseUrl?: string;
|
|
343
|
+
onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
|
|
344
|
+
readOnly?: boolean;
|
|
345
|
+
};
|
|
346
|
+
declare function ChatFileDownload({ files, fileDownloadBaseUrl, onDownloadArtifact, readOnly }: ChatFileDownloadProps): react.JSX.Element;
|
|
347
|
+
declare module '../theme/SlotsProvider.js' {
|
|
348
|
+
interface AtomSlots {
|
|
349
|
+
ChatFileDownload: typeof ChatFileDownload;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
declare function ClearChatButton(): react.JSX.Element | null;
|
|
354
|
+
declare module '../theme/SlotsProvider.js' {
|
|
355
|
+
interface AtomSlots {
|
|
356
|
+
ClearChatButton: typeof ClearChatButton;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
type MonacoEditorCoreProps = {
|
|
361
|
+
value: string;
|
|
362
|
+
language?: string;
|
|
363
|
+
/** Monaco theme name. Defaults to SDK light/dark themes (`aui-monaco-light` / `aui-monaco-dark`). */
|
|
364
|
+
theme?: string;
|
|
365
|
+
options?: Record<string, unknown>;
|
|
366
|
+
onChange?: (value: string) => void;
|
|
367
|
+
onMount?: (editor: unknown, monaco: unknown) => void;
|
|
368
|
+
beforeMount?: (monaco: unknown) => void;
|
|
369
|
+
onAutoHeightChange?: (height: number) => void;
|
|
370
|
+
className?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Fixed height. Ignored when `autoHeight` is true (except as an initial
|
|
373
|
+
* fallback before the editor mounts). Use `"100%"` for fill-parent layouts
|
|
374
|
+
* (e.g. fullscreen dialogs) with `autoHeight={false}`.
|
|
375
|
+
*/
|
|
376
|
+
height?: string | number;
|
|
377
|
+
/** Grow/shrink to content height, capped by `maxHeight`. Default false. */
|
|
378
|
+
autoHeight?: boolean;
|
|
379
|
+
/** Cap for `autoHeight` (px number or CSS length). Default `10.5rem`. */
|
|
380
|
+
maxHeight?: string | number;
|
|
381
|
+
/** Floor for `autoHeight` (px number or CSS length). Default one line. */
|
|
382
|
+
minHeight?: string | number;
|
|
383
|
+
};
|
|
384
|
+
declare function MonacoEditorCore({ value, language, theme, options, onChange, onMount, beforeMount, onAutoHeightChange, className, height, autoHeight, maxHeight, minHeight, }: MonacoEditorCoreProps): react.JSX.Element;
|
|
385
|
+
declare module '../theme/SlotsProvider.js' {
|
|
386
|
+
interface AtomSlots {
|
|
387
|
+
MonacoEditorCore: typeof MonacoEditorCore;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
type CodeEditorProps = Omit<MonacoEditorCoreProps, 'onAutoHeightChange' | 'options'> & {
|
|
392
|
+
filename?: string;
|
|
393
|
+
showToolbar?: boolean;
|
|
394
|
+
};
|
|
395
|
+
declare function CodeEditor({ value, language, theme, filename, onChange, onMount, beforeMount, className, height, showToolbar, }: CodeEditorProps): react.JSX.Element;
|
|
396
|
+
declare module '../theme/SlotsProvider.js' {
|
|
397
|
+
interface AtomSlots {
|
|
398
|
+
CodeEditor: typeof CodeEditor;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
type ComposerLeftSectionProps = {
|
|
403
|
+
disabled: boolean;
|
|
404
|
+
isRunning: boolean;
|
|
405
|
+
onAttach?: () => void;
|
|
406
|
+
};
|
|
407
|
+
type ComposerRightSectionProps = {
|
|
408
|
+
disabled: boolean;
|
|
409
|
+
isRunning: boolean;
|
|
410
|
+
};
|
|
411
|
+
type ComposerSendButtonProps = {
|
|
412
|
+
disabled: boolean;
|
|
413
|
+
canSubmit: boolean;
|
|
414
|
+
isRunning: boolean;
|
|
415
|
+
onSubmit: () => void;
|
|
416
|
+
onCancel?: () => void;
|
|
417
|
+
};
|
|
418
|
+
type ComposerLeftSectionSlot = (props: ComposerLeftSectionProps) => ReactNode;
|
|
419
|
+
type ComposerRightSectionSlot = (props: ComposerRightSectionProps) => ReactNode;
|
|
420
|
+
type ComposerSendButtonSlot = (props: ComposerSendButtonProps) => ReactNode;
|
|
421
|
+
declare function ComposerLeftSection({ onAttach }: ComposerLeftSectionProps): react.JSX.Element | null;
|
|
422
|
+
declare function ComposerRightSection(_: ComposerRightSectionProps): ReactNode;
|
|
423
|
+
declare function ComposerSendButton({ canSubmit, isRunning, onSubmit, onCancel }: ComposerSendButtonProps): react.JSX.Element;
|
|
424
|
+
declare module '../theme/SlotsProvider.js' {
|
|
425
|
+
interface AtomSlots {
|
|
426
|
+
ComposerLeftSection: ComposerLeftSectionSlot;
|
|
427
|
+
ComposerRightSection: ComposerRightSectionSlot;
|
|
428
|
+
ComposerSendButton: ComposerSendButtonSlot;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
type ComposerShellProps = {
|
|
433
|
+
/** Message input node, supplied by the container (e.g. `<ComposerPrimitive.Input />`). */
|
|
434
|
+
input: ReactNode;
|
|
435
|
+
disabled: boolean;
|
|
436
|
+
canSubmit: boolean;
|
|
437
|
+
isRunning?: boolean;
|
|
438
|
+
attachments?: ReactNode;
|
|
439
|
+
modelLabel?: string;
|
|
440
|
+
modelIcon?: ReactNode;
|
|
441
|
+
connectorStatusLabel?: string;
|
|
442
|
+
onSubmit: () => void;
|
|
443
|
+
onCancel?: () => void;
|
|
444
|
+
onAttach?: () => void;
|
|
445
|
+
className?: string;
|
|
446
|
+
};
|
|
447
|
+
declare function ComposerShell({ input, disabled, canSubmit, isRunning, attachments, modelLabel, modelIcon, connectorStatusLabel, onSubmit, onCancel, onAttach, className, }: ComposerShellProps): react.JSX.Element;
|
|
448
|
+
declare module '../theme/SlotsProvider.js' {
|
|
449
|
+
interface AtomSlots {
|
|
450
|
+
ComposerShell: typeof ComposerShell;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
declare function DraftComposerLeftSection({ disabled, isRunning, onAttach }: ComposerLeftSectionProps): react.JSX.Element;
|
|
455
|
+
declare function DraftComposerRightSection({ disabled, isRunning }: ComposerRightSectionProps): react.JSX.Element;
|
|
456
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
457
|
+
interface AtomSlots {
|
|
458
|
+
DraftComposerLeftSection: typeof DraftComposerLeftSection;
|
|
459
|
+
DraftComposerRightSection: typeof DraftComposerRightSection;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
type DraftCompositeSelectorProps = {
|
|
464
|
+
disabled?: boolean;
|
|
465
|
+
isRunning?: boolean;
|
|
466
|
+
onAttach?: () => void;
|
|
467
|
+
};
|
|
468
|
+
declare function DraftCompositeSelector({ disabled, isRunning, onAttach }: DraftCompositeSelectorProps): react.JSX.Element;
|
|
469
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
470
|
+
interface AtomSlots {
|
|
471
|
+
DraftCompositeSelector: typeof DraftCompositeSelector;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
type DraftModelSelectorProps = {
|
|
476
|
+
disabled?: boolean;
|
|
477
|
+
isRunning?: boolean;
|
|
478
|
+
};
|
|
479
|
+
declare function DraftModelSelector({ disabled, isRunning }: DraftModelSelectorProps): react.JSX.Element;
|
|
480
|
+
declare module '../../theme/SlotsProvider.js' {
|
|
481
|
+
interface AtomSlots {
|
|
482
|
+
DraftModelSelector: typeof DraftModelSelector;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/** Preloads OpenUiFenceBlock so it's ready before the user sees openui content. */
|
|
487
|
+
declare function preloadMarkdownOpenUI(): Promise<unknown>;
|
|
488
|
+
type MarkdownProps = {
|
|
489
|
+
content: string;
|
|
490
|
+
isStreaming?: boolean;
|
|
491
|
+
/** Base URL for resolving sandbox artifact download paths (e.g. gateway file endpoint). */
|
|
492
|
+
fileDownloadBaseUrl?: string;
|
|
493
|
+
/** Custom download handler that receives the original sandbox artifact path. */
|
|
494
|
+
onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
|
|
495
|
+
/** When true, download actions in sandbox artifact blocks are hidden/disabled. */
|
|
496
|
+
readOnly?: boolean;
|
|
497
|
+
className?: string;
|
|
498
|
+
};
|
|
499
|
+
declare function Markdown({ content, isStreaming, fileDownloadBaseUrl, onDownloadArtifact, readOnly, className, }: MarkdownProps): react.JSX.Element;
|
|
500
|
+
declare module '../theme/SlotsProvider.js' {
|
|
501
|
+
interface AtomSlots {
|
|
502
|
+
Markdown: typeof Markdown;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
type MessageActionBarProps = {
|
|
507
|
+
isCopied: boolean;
|
|
508
|
+
onCopy: () => void;
|
|
509
|
+
createdAt?: Date | string;
|
|
510
|
+
className?: string;
|
|
511
|
+
};
|
|
512
|
+
declare function MessageActionBar({ isCopied, onCopy, createdAt, className }: MessageActionBarProps): react.JSX.Element;
|
|
513
|
+
declare module '../theme/SlotsProvider.js' {
|
|
514
|
+
interface AtomSlots {
|
|
515
|
+
MessageActionBar: typeof MessageActionBar;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
type MessageErrorBannerProps = {
|
|
520
|
+
message: string;
|
|
521
|
+
className?: string;
|
|
522
|
+
};
|
|
523
|
+
declare function MessageErrorBanner({ message, className }: MessageErrorBannerProps): react.JSX.Element;
|
|
524
|
+
declare module '../theme/SlotsProvider.js' {
|
|
525
|
+
interface AtomSlots {
|
|
526
|
+
MessageErrorBanner: typeof MessageErrorBanner;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
type MessageIndicatorProps = {
|
|
531
|
+
className?: string;
|
|
532
|
+
};
|
|
533
|
+
declare function MessageIndicator({ className }: MessageIndicatorProps): react.JSX.Element;
|
|
534
|
+
declare module '../theme/SlotsProvider.js' {
|
|
535
|
+
interface AtomSlots {
|
|
536
|
+
MessageIndicator: typeof MessageIndicator;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
type MessageTimestampProps = {
|
|
541
|
+
createdAt?: Date | string;
|
|
542
|
+
className?: string;
|
|
543
|
+
};
|
|
544
|
+
declare function MessageTimestamp({ createdAt, className }: MessageTimestampProps): react.JSX.Element | null;
|
|
545
|
+
declare module '../theme/SlotsProvider.js' {
|
|
546
|
+
interface AtomSlots {
|
|
547
|
+
MessageTimestamp: typeof MessageTimestamp;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
type OpenUiFenceBlockProps = {
|
|
552
|
+
content: string;
|
|
553
|
+
isStreaming?: boolean;
|
|
554
|
+
darkTheme?: boolean;
|
|
555
|
+
};
|
|
556
|
+
declare function OpenUiFenceBlock({ content, isStreaming, darkTheme }: OpenUiFenceBlockProps): react.JSX.Element;
|
|
557
|
+
declare module '../theme/SlotsProvider.js' {
|
|
558
|
+
interface AtomSlots {
|
|
559
|
+
OpenUiFenceBlock: typeof OpenUiFenceBlock;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
type SandboxArtifactDownloadProps = {
|
|
564
|
+
code: string;
|
|
565
|
+
fileDownloadBaseUrl?: string;
|
|
566
|
+
onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
|
|
567
|
+
readOnly?: boolean;
|
|
568
|
+
};
|
|
569
|
+
declare function SandboxArtifactDownload({ code, fileDownloadBaseUrl, onDownloadArtifact, readOnly, }: SandboxArtifactDownloadProps): react.JSX.Element | null;
|
|
570
|
+
declare module '../theme/SlotsProvider.js' {
|
|
571
|
+
interface AtomSlots {
|
|
572
|
+
SandboxArtifactDownload: typeof SandboxArtifactDownload;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
type ToolCallStatus = 'running' | 'success' | 'error';
|
|
577
|
+
type ToolCallCardProps = {
|
|
578
|
+
icon?: string;
|
|
579
|
+
iconClassName?: string;
|
|
580
|
+
iconVariant?: 'primary' | 'muted';
|
|
581
|
+
toolName: string;
|
|
582
|
+
expanded?: boolean;
|
|
583
|
+
onToggle?: () => void;
|
|
584
|
+
awaiting?: boolean;
|
|
585
|
+
awaitingText?: string;
|
|
586
|
+
status?: ToolCallStatus;
|
|
587
|
+
exitCode?: number | null;
|
|
588
|
+
showExpandChevron?: boolean;
|
|
589
|
+
showResponseLine?: boolean;
|
|
590
|
+
responseIcon?: ReactNode;
|
|
591
|
+
approvalSlot?: ReactNode;
|
|
592
|
+
requestSlot?: ReactNode;
|
|
593
|
+
responseSlot?: ReactNode;
|
|
594
|
+
highlightCard?: boolean;
|
|
595
|
+
className?: string;
|
|
596
|
+
mcpServerName?: string;
|
|
597
|
+
dataTestPrefix?: string;
|
|
598
|
+
};
|
|
599
|
+
declare function ToolCallCard({ icon, iconClassName, iconVariant, toolName, expanded, onToggle, awaiting, awaitingText, status: explicitStatus, exitCode, showExpandChevron, showResponseLine, approvalSlot, requestSlot, responseSlot, highlightCard, className, mcpServerName: _mcpServerName, dataTestPrefix, }: ToolCallCardProps): react.JSX.Element;
|
|
600
|
+
declare module '../theme/SlotsProvider.js' {
|
|
601
|
+
interface AtomSlots {
|
|
602
|
+
ToolCallCard: typeof ToolCallCard;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
type SandboxToolCallCardProps = {
|
|
607
|
+
name: string;
|
|
608
|
+
intent?: string;
|
|
609
|
+
status: ToolCallStatus;
|
|
610
|
+
expanded: boolean;
|
|
611
|
+
onToggle: () => void;
|
|
612
|
+
command?: string;
|
|
613
|
+
exitCode?: number | null;
|
|
614
|
+
argsJson?: string;
|
|
615
|
+
resultText?: string;
|
|
616
|
+
resultJson?: string;
|
|
617
|
+
viewMode?: 'terminal' | 'code';
|
|
618
|
+
hasContent?: boolean;
|
|
619
|
+
onViewModeChange?: (viewMode: 'terminal' | 'code') => void;
|
|
620
|
+
durationText?: string;
|
|
621
|
+
dataTestPrefix?: string;
|
|
622
|
+
className?: string;
|
|
623
|
+
};
|
|
624
|
+
declare function SandboxToolCallCard({ name, intent, status, expanded, onToggle, command, exitCode, argsJson, resultText, resultJson, viewMode, hasContent, onViewModeChange, durationText, dataTestPrefix, className, }: SandboxToolCallCardProps): react.JSX.Element;
|
|
625
|
+
declare module '../theme/SlotsProvider.js' {
|
|
626
|
+
interface AtomSlots {
|
|
627
|
+
SandboxToolCallCard: typeof SandboxToolCallCard;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
type SaveAgentButtonProps = {
|
|
632
|
+
disabled?: boolean;
|
|
633
|
+
className?: string;
|
|
634
|
+
children?: string;
|
|
635
|
+
};
|
|
636
|
+
declare function SaveAgentButton({ disabled, className, children }: SaveAgentButtonProps): react.JSX.Element;
|
|
637
|
+
declare module '../theme/SlotsProvider.js' {
|
|
638
|
+
interface AtomSlots {
|
|
639
|
+
SaveAgentButton: typeof SaveAgentButton;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/** Empty main pane when AgentLibrary has no agent selected yet. */
|
|
644
|
+
declare function SelectAgentEmptyState(): react.JSX.Element | null;
|
|
645
|
+
declare module '../theme/SlotsProvider.js' {
|
|
646
|
+
interface AtomSlots {
|
|
647
|
+
SelectAgentEmptyState: typeof SelectAgentEmptyState;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Optional host chrome (e.g. logout) to the right of theme + settings in {@link ShellActions}.
|
|
653
|
+
* Default is empty; override via `overrides.ShellActionsActionSlot`.
|
|
654
|
+
* Layouts keep {@link ShellActions} mounted while Settings is open so host state is not remounted.
|
|
655
|
+
*/
|
|
656
|
+
declare function ShellActionsActionSlot(): ReactNode;
|
|
657
|
+
declare module '../theme/SlotsProvider.js' {
|
|
658
|
+
interface AtomSlots {
|
|
659
|
+
ShellActionsActionSlot: typeof ShellActionsActionSlot;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
type MessageListSkeletonProps = {
|
|
664
|
+
className?: string;
|
|
665
|
+
};
|
|
666
|
+
declare function MessageListSkeleton({ className }: MessageListSkeletonProps): react.JSX.Element;
|
|
667
|
+
declare module '../theme/SlotsProvider.js' {
|
|
668
|
+
interface AtomSlots {
|
|
669
|
+
MessageListSkeleton: typeof MessageListSkeleton;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
type SubAgentCardProps = {
|
|
674
|
+
agentName: string;
|
|
675
|
+
instruction: string;
|
|
676
|
+
stepCount: number;
|
|
677
|
+
status: ToolCallStatus;
|
|
678
|
+
expanded: boolean;
|
|
679
|
+
onToggle: () => void;
|
|
680
|
+
durationText?: string;
|
|
681
|
+
children?: ReactNode;
|
|
682
|
+
renderInstruction?: (instruction: string) => ReactNode;
|
|
683
|
+
dataTestPrefix?: string;
|
|
684
|
+
className?: string;
|
|
685
|
+
};
|
|
686
|
+
declare function SubAgentCard({ agentName, instruction, stepCount: _stepCount, status, expanded, onToggle, durationText, children, renderInstruction, dataTestPrefix, className, }: SubAgentCardProps): react.JSX.Element;
|
|
687
|
+
declare module '../theme/SlotsProvider.js' {
|
|
688
|
+
interface AtomSlots {
|
|
689
|
+
SubAgentCard: typeof SubAgentCard;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
type ThreadListNewButtonProps = ComponentProps<'button'>;
|
|
694
|
+
declare function ThreadListNewButton({ className, children, style, ...rest }: ThreadListNewButtonProps): react.JSX.Element;
|
|
695
|
+
type ThreadListRowSkeletonProps = {
|
|
696
|
+
count?: number;
|
|
697
|
+
className?: string;
|
|
698
|
+
};
|
|
699
|
+
declare function ThreadListRowSkeleton({ count, className }: ThreadListRowSkeletonProps): react.JSX.Element;
|
|
700
|
+
type ThreadListEmptyStateProps = {
|
|
701
|
+
message?: string;
|
|
702
|
+
className?: string;
|
|
703
|
+
};
|
|
704
|
+
declare function ThreadListEmptyState({ message, className }: ThreadListEmptyStateProps): react.JSX.Element;
|
|
705
|
+
type ThreadListShellProps = {
|
|
706
|
+
header: ReactNode;
|
|
707
|
+
children: ReactNode;
|
|
708
|
+
className?: string;
|
|
709
|
+
};
|
|
710
|
+
declare function ThreadListShell({ header, children, className }: ThreadListShellProps): react.JSX.Element;
|
|
711
|
+
declare module '../theme/SlotsProvider.js' {
|
|
712
|
+
interface AtomSlots {
|
|
713
|
+
ThreadListNewButton: typeof ThreadListNewButton;
|
|
714
|
+
ThreadListRowSkeleton: typeof ThreadListRowSkeleton;
|
|
715
|
+
ThreadListEmptyState: typeof ThreadListEmptyState;
|
|
716
|
+
ThreadListShell: typeof ThreadListShell;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
type ThreadListRowProps = {
|
|
721
|
+
title: string;
|
|
722
|
+
active: boolean;
|
|
723
|
+
onSelect: () => void;
|
|
724
|
+
/** Named-agent label under the title (from session.agentName). */
|
|
725
|
+
agentName?: string;
|
|
726
|
+
/** Shown as compact relative time on the right. */
|
|
727
|
+
lastMessageAt?: Date;
|
|
728
|
+
/** Overflow actions (e.g. delete menu) — rendered as a sibling of the title button. */
|
|
729
|
+
actions?: ReactNode;
|
|
730
|
+
className?: string;
|
|
731
|
+
};
|
|
732
|
+
declare function ThreadListRow({ title, active, onSelect, agentName, lastMessageAt, actions, className, }: ThreadListRowProps): react.JSX.Element;
|
|
733
|
+
declare module '../theme/SlotsProvider.js' {
|
|
734
|
+
interface AtomSlots {
|
|
735
|
+
ThreadListRow: typeof ThreadListRow;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
type ToastProps = {
|
|
740
|
+
title: string;
|
|
741
|
+
description: string;
|
|
742
|
+
open: boolean;
|
|
743
|
+
onOpenChange: (open: boolean) => void;
|
|
744
|
+
variant?: 'error' | 'success';
|
|
745
|
+
className?: string;
|
|
746
|
+
};
|
|
747
|
+
declare function Toast({ title, description, open, onOpenChange, variant, className }: ToastProps): react.JSX.Element | null;
|
|
748
|
+
type ToastStackProps = {
|
|
749
|
+
children: ReactNode;
|
|
750
|
+
duration?: number;
|
|
751
|
+
};
|
|
752
|
+
declare function ToastStack({ children, duration: _duration }: ToastStackProps): react.JSX.Element;
|
|
753
|
+
declare module '../theme/SlotsProvider.js' {
|
|
754
|
+
interface AtomSlots {
|
|
755
|
+
Toast: typeof Toast;
|
|
756
|
+
ToastStack: typeof ToastStack;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
type ApprovalOption = {
|
|
761
|
+
id: string;
|
|
762
|
+
label: string;
|
|
763
|
+
variant?: 'primary' | 'secondary' | 'destructive';
|
|
764
|
+
requiresReason?: boolean;
|
|
765
|
+
grants?: readonly string[];
|
|
766
|
+
confirm?: {
|
|
767
|
+
title?: string;
|
|
768
|
+
description?: string;
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
type ToolApprovalBarProps = {
|
|
772
|
+
toolName: string;
|
|
773
|
+
approveOptions?: ApprovalOption[];
|
|
774
|
+
denyOptions?: ApprovalOption[];
|
|
775
|
+
onSelect: (optionId: string, reason?: string) => void;
|
|
776
|
+
status?: {
|
|
777
|
+
type: 'approved' | 'denied';
|
|
778
|
+
label?: string;
|
|
779
|
+
reason?: string;
|
|
780
|
+
};
|
|
781
|
+
selectedDenyOption?: ApprovalOption;
|
|
782
|
+
denialReason?: string;
|
|
783
|
+
showReasonError?: boolean;
|
|
784
|
+
onDenyOptionChange?: (optionId: string | null) => void;
|
|
785
|
+
onDenialReasonChange?: (reason: string) => void;
|
|
786
|
+
onReasonSubmit?: () => void;
|
|
787
|
+
disabled?: boolean;
|
|
788
|
+
readOnly?: boolean;
|
|
789
|
+
showLineBelow?: boolean;
|
|
790
|
+
dataTestPrefix?: string;
|
|
791
|
+
className?: string;
|
|
792
|
+
};
|
|
793
|
+
declare function ToolApprovalBar({ toolName, approveOptions, denyOptions, onSelect, status, selectedDenyOption, denialReason, showReasonError, onDenyOptionChange, onDenialReasonChange, onReasonSubmit, disabled, readOnly, showLineBelow, dataTestPrefix, className, }: ToolApprovalBarProps): react.JSX.Element;
|
|
794
|
+
declare module '../theme/SlotsProvider.js' {
|
|
795
|
+
interface AtomSlots {
|
|
796
|
+
ToolApprovalBar: typeof ToolApprovalBar;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
type ToolCallContentBlockProps = {
|
|
801
|
+
title: string;
|
|
802
|
+
content: string;
|
|
803
|
+
isJson?: boolean;
|
|
804
|
+
copyValue?: string;
|
|
805
|
+
maxHeight?: string;
|
|
806
|
+
resizable?: boolean;
|
|
807
|
+
fullscreen?: boolean;
|
|
808
|
+
onFullscreenChange?: (fullscreen: boolean) => void;
|
|
809
|
+
contentHeightRem?: number;
|
|
810
|
+
contentRef?: (node: HTMLDivElement | null) => void;
|
|
811
|
+
onContentHeightChange?: (height: number) => void;
|
|
812
|
+
dataTestPrefix?: string;
|
|
813
|
+
className?: string;
|
|
814
|
+
};
|
|
815
|
+
declare function ToolCallContentBlock({ title, content, isJson, copyValue, maxHeight, resizable, fullscreen, onFullscreenChange, contentHeightRem, contentRef, onContentHeightChange, dataTestPrefix, className, }: ToolCallContentBlockProps): react.JSX.Element;
|
|
816
|
+
declare module '../theme/SlotsProvider.js' {
|
|
817
|
+
interface AtomSlots {
|
|
818
|
+
ToolCallContentBlock: typeof ToolCallContentBlock;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
type ToolGroupCardProps = {
|
|
823
|
+
toolCallCount: number;
|
|
824
|
+
expanded: boolean;
|
|
825
|
+
active?: boolean;
|
|
826
|
+
onToggle: () => void;
|
|
827
|
+
children: ReactNode;
|
|
828
|
+
className?: string;
|
|
829
|
+
};
|
|
830
|
+
declare function ToolGroupCard({ toolCallCount, expanded, active, onToggle, children, className, }: ToolGroupCardProps): react.JSX.Element;
|
|
831
|
+
declare module '../theme/SlotsProvider.js' {
|
|
832
|
+
interface AtomSlots {
|
|
833
|
+
ToolGroupCard: typeof ToolGroupCard;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
type UserMessageActionBarProps = {
|
|
838
|
+
isCopied: boolean;
|
|
839
|
+
editDisabled?: boolean;
|
|
840
|
+
createdAt?: Date | string;
|
|
841
|
+
onCopy: () => void;
|
|
842
|
+
onEdit: () => void;
|
|
843
|
+
onRetry: () => void;
|
|
844
|
+
className?: string;
|
|
845
|
+
};
|
|
846
|
+
declare function UserMessageActionBar({ isCopied, editDisabled, createdAt, onCopy, onEdit, onRetry, className, }: UserMessageActionBarProps): react.JSX.Element;
|
|
847
|
+
declare module '../theme/SlotsProvider.js' {
|
|
848
|
+
interface AtomSlots {
|
|
849
|
+
UserMessageActionBar: typeof UserMessageActionBar;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
type UserMessageBubbleProps = {
|
|
854
|
+
text: string;
|
|
855
|
+
attachments?: ReactNode;
|
|
856
|
+
editAction?: ReactNode;
|
|
857
|
+
className?: string;
|
|
858
|
+
};
|
|
859
|
+
declare function UserMessageBubble({ text, attachments, editAction, className }: UserMessageBubbleProps): react.JSX.Element;
|
|
860
|
+
declare module '../theme/SlotsProvider.js' {
|
|
861
|
+
interface AtomSlots {
|
|
862
|
+
UserMessageBubble: typeof UserMessageBubble;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
type WelcomeScreenProps = {
|
|
867
|
+
heading?: string;
|
|
868
|
+
icon?: ReactNode;
|
|
869
|
+
className?: string;
|
|
870
|
+
};
|
|
871
|
+
declare function WelcomeScreen({ heading, icon, className }: WelcomeScreenProps): react.JSX.Element;
|
|
872
|
+
declare module '../theme/SlotsProvider.js' {
|
|
873
|
+
interface AtomSlots {
|
|
874
|
+
WelcomeScreen: typeof WelcomeScreen;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/** Default slot implementations. Feature atoms + chrome; primitives via theme/CSS. */
|
|
879
|
+
declare const defaultSlots: {
|
|
880
|
+
Accordion: typeof Accordion;
|
|
881
|
+
AccordionSummary: typeof AccordionSummary;
|
|
882
|
+
AccordionDetails: typeof AccordionDetails;
|
|
883
|
+
BrandLogo: typeof BrandLogo;
|
|
884
|
+
ComposerShell: typeof ComposerShell;
|
|
885
|
+
ComposerLeftSection: typeof ComposerLeftSection;
|
|
886
|
+
ComposerRightSection: typeof ComposerRightSection;
|
|
887
|
+
ComposerSendButton: typeof ComposerSendButton;
|
|
888
|
+
DraftComposerLeftSection: typeof DraftComposerLeftSection;
|
|
889
|
+
DraftComposerRightSection: typeof DraftComposerRightSection;
|
|
890
|
+
DraftCompositeSelector: typeof DraftCompositeSelector;
|
|
891
|
+
DraftModelSelector: typeof DraftModelSelector;
|
|
892
|
+
AssistantMessageBubble: typeof AssistantMessageBubble;
|
|
893
|
+
UserMessageBubble: typeof UserMessageBubble;
|
|
894
|
+
UserMessageEdit: react.ForwardRefExoticComponent<UserMessageEditProps & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
895
|
+
UserMessageActionBar: typeof UserMessageActionBar;
|
|
896
|
+
MessageActionBar: typeof MessageActionBar;
|
|
897
|
+
MessageErrorBanner: typeof MessageErrorBanner;
|
|
898
|
+
MessageIndicator: typeof MessageIndicator;
|
|
899
|
+
MessageTimestamp: typeof MessageTimestamp;
|
|
900
|
+
Markdown: typeof Markdown;
|
|
901
|
+
SyntaxHighlighter: react.ComponentType<SyntaxHighlighterProps>;
|
|
902
|
+
OpenUiFenceBlock: typeof OpenUiFenceBlock;
|
|
903
|
+
SandboxArtifactDownload: typeof SandboxArtifactDownload;
|
|
904
|
+
ChatFileDownload: typeof ChatFileDownload;
|
|
905
|
+
MonacoEditorCore: typeof MonacoEditorCore;
|
|
906
|
+
CodeEditor: typeof CodeEditor;
|
|
907
|
+
WelcomeScreen: typeof WelcomeScreen;
|
|
908
|
+
ToolCallCard: typeof ToolCallCard;
|
|
909
|
+
ToolCallContentBlock: typeof ToolCallContentBlock;
|
|
910
|
+
ToolApprovalBar: typeof ToolApprovalBar;
|
|
911
|
+
ToolGroupCard: typeof ToolGroupCard;
|
|
912
|
+
SubAgentCard: typeof SubAgentCard;
|
|
913
|
+
SandboxToolCallCard: typeof SandboxToolCallCard;
|
|
914
|
+
AgentStepsCard: typeof AgentStepsCard;
|
|
915
|
+
ReasoningCard: typeof ReasoningCard;
|
|
916
|
+
AskUserPrompt: typeof AskUserPrompt;
|
|
917
|
+
McpAuthPrompt: typeof McpAuthPrompt;
|
|
918
|
+
ResumeUnavailable: typeof ResumeUnavailable;
|
|
919
|
+
AttachmentCard: typeof AttachmentCard;
|
|
920
|
+
AttachmentPreviewDialog: typeof AttachmentPreviewDialog;
|
|
921
|
+
AttachmentPickerButton: typeof AttachmentPickerButton;
|
|
922
|
+
ScrollToBottomButton: react.ForwardRefExoticComponent<Omit<ScrollToBottomButtonProps, "ref"> & react.RefAttributes<HTMLSpanElement>>;
|
|
923
|
+
ThreadListRow: typeof ThreadListRow;
|
|
924
|
+
ThreadListNewButton: typeof ThreadListNewButton;
|
|
925
|
+
AgentsLibrary: typeof AgentsLibrary;
|
|
926
|
+
AgentsLibraryButton: typeof AgentsLibraryButton;
|
|
927
|
+
SaveAgentButton: typeof SaveAgentButton;
|
|
928
|
+
SelectAgentEmptyState: typeof SelectAgentEmptyState;
|
|
929
|
+
ClearChatButton: typeof ClearChatButton;
|
|
930
|
+
ThreadListRowSkeleton: typeof ThreadListRowSkeleton;
|
|
931
|
+
ThreadListEmptyState: typeof ThreadListEmptyState;
|
|
932
|
+
ThreadListShell: typeof ThreadListShell;
|
|
933
|
+
HistoryLoader: react.ForwardRefExoticComponent<Omit<HistoryLoaderProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
934
|
+
MessageListSkeleton: typeof MessageListSkeleton;
|
|
935
|
+
ThreadRootShell: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
936
|
+
ThreadViewportShell: react.ForwardRefExoticComponent<Omit<ThreadViewportShellProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
937
|
+
ThreadComposerAreaShell: react.ForwardRefExoticComponent<Omit<ThreadComposerAreaShellProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
938
|
+
MessageGroup: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
939
|
+
Toast: typeof Toast;
|
|
940
|
+
ToastStack: typeof ToastStack;
|
|
941
|
+
ShellActionsActionSlot: typeof ShellActionsActionSlot;
|
|
942
|
+
};
|
|
943
|
+
|
|
944
|
+
type ThemeMode = 'light' | 'dark' | 'system';
|
|
945
|
+
type ThemePreset = 'trueforge' | 'claude' | 'chatgpt' | 'gemini';
|
|
946
|
+
type SemanticTokens = {
|
|
947
|
+
sidebarBg: string;
|
|
948
|
+
topbarBg: string;
|
|
949
|
+
primaryBg: string;
|
|
950
|
+
secondaryBg: string;
|
|
951
|
+
border: string;
|
|
952
|
+
fontFamily: string;
|
|
953
|
+
inputBoxBg: string;
|
|
954
|
+
inputBorder: string;
|
|
955
|
+
textPrimary: string;
|
|
956
|
+
textSecondary: string;
|
|
957
|
+
cardBg: string;
|
|
958
|
+
dropdownSelectedItemBg: string;
|
|
959
|
+
dropdownSelectedItemText: string;
|
|
960
|
+
userMessageBg: string;
|
|
961
|
+
userMessageText: string;
|
|
962
|
+
assistantMessageBg: string;
|
|
963
|
+
assistantMessageText: string;
|
|
964
|
+
primaryButtonBg: string;
|
|
965
|
+
primaryButtonHover: string;
|
|
966
|
+
primaryButtonText: string;
|
|
967
|
+
secondaryButtonBg: string;
|
|
968
|
+
secondaryButtonHover: string;
|
|
969
|
+
secondaryButtonText: string;
|
|
970
|
+
ghostButtonBg: string;
|
|
971
|
+
ghostButtonHover: string;
|
|
972
|
+
ghostButtonText: string;
|
|
973
|
+
successBg: string;
|
|
974
|
+
successText: string;
|
|
975
|
+
failureBg: string;
|
|
976
|
+
failureText: string;
|
|
977
|
+
warningBg: string;
|
|
978
|
+
warningText: string;
|
|
979
|
+
focusRing: string;
|
|
980
|
+
radius: string;
|
|
981
|
+
composerRadius: string;
|
|
982
|
+
overlay: string;
|
|
983
|
+
shadowColor: string;
|
|
984
|
+
scrollbarThumb: string;
|
|
985
|
+
};
|
|
986
|
+
type IconProps$1 = {
|
|
987
|
+
className?: string;
|
|
988
|
+
style?: CSSProperties;
|
|
989
|
+
size?: string | number;
|
|
990
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
991
|
+
'aria-label'?: string;
|
|
992
|
+
'data-testid'?: string;
|
|
993
|
+
};
|
|
994
|
+
type IconComponent = LucideIcon | ((props: IconProps$1) => ReactNode) | FC<SVGProps<SVGSVGElement>>;
|
|
995
|
+
type IconEntry = IconComponent | ReactNode;
|
|
996
|
+
type IconMap = Record<string, IconEntry>;
|
|
997
|
+
/**
|
|
998
|
+
* Logo sources. `light` / `dark` pick per resolved theme mode and fall back to
|
|
999
|
+
* each other, then to `src`. `href` wraps the logo in a same-tab link. The logo
|
|
1000
|
+
* is labelled with `name`; replace the mark itself through the slot table when
|
|
1001
|
+
* an image URL is not enough.
|
|
1002
|
+
*/
|
|
1003
|
+
type BrandLogoConfig = {
|
|
1004
|
+
src?: string;
|
|
1005
|
+
light?: string;
|
|
1006
|
+
dark?: string;
|
|
1007
|
+
href?: string;
|
|
1008
|
+
};
|
|
1009
|
+
/**
|
|
1010
|
+
* Setting `brand` requires a `name`: it labels the logo, so a logo without one has
|
|
1011
|
+
* no accessible name. `logo` is optional — omit it to pair host text with the stock
|
|
1012
|
+
* mark.
|
|
1013
|
+
*/
|
|
1014
|
+
type BrandConfig = {
|
|
1015
|
+
/** Display name, and the logo's accessible label. */
|
|
1016
|
+
name: string;
|
|
1017
|
+
/** Image URL, or per-mode sources. Omit to keep the default mark. */
|
|
1018
|
+
logo?: string | BrandLogoConfig;
|
|
1019
|
+
};
|
|
1020
|
+
type ContentClassNames = {
|
|
1021
|
+
markdown?: string;
|
|
1022
|
+
inlineCode?: string;
|
|
1023
|
+
syntaxHighlighter?: {
|
|
1024
|
+
root?: string;
|
|
1025
|
+
pre?: string;
|
|
1026
|
+
code?: string;
|
|
1027
|
+
lineNumber?: string;
|
|
1028
|
+
};
|
|
1029
|
+
openui?: {
|
|
1030
|
+
root?: string;
|
|
1031
|
+
scope?: string;
|
|
1032
|
+
};
|
|
1033
|
+
monaco?: {
|
|
1034
|
+
root?: string;
|
|
1035
|
+
editor?: string;
|
|
1036
|
+
monacoTheme?: string;
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
1039
|
+
type ThemeConfig = {
|
|
1040
|
+
preset?: ThemePreset;
|
|
1041
|
+
mode?: ThemeMode;
|
|
1042
|
+
tokens?: Partial<SemanticTokens>;
|
|
1043
|
+
brand?: BrandConfig;
|
|
1044
|
+
className?: string;
|
|
1045
|
+
icons?: IconMap;
|
|
1046
|
+
classNames?: ContentClassNames;
|
|
1047
|
+
};
|
|
1048
|
+
type BuiltInLayout = 'sidebar' | 'drawer' | 'dock' | 'widget';
|
|
1049
|
+
type LayoutProp = BuiltInLayout | ComponentType<{
|
|
1050
|
+
className?: string;
|
|
1051
|
+
}>;
|
|
1052
|
+
|
|
1053
|
+
type PresetTokens = {
|
|
1054
|
+
light: SemanticTokens;
|
|
1055
|
+
dark: SemanticTokens;
|
|
1056
|
+
};
|
|
1057
|
+
declare const PRESETS: Record<ThemePreset, PresetTokens>;
|
|
1058
|
+
declare function resolvePresetTokens(preset: ThemePreset | undefined, mode: 'light' | 'dark'): SemanticTokens;
|
|
1059
|
+
|
|
1060
|
+
type PublicAtomSlots = typeof defaultSlots;
|
|
1061
|
+
type SlotOverrides = Partial<PublicAtomSlots>;
|
|
1062
|
+
|
|
1063
|
+
/** Merges `overrides` over parent/default slots. Containers resolve atoms via `useSlot`. */
|
|
1064
|
+
declare function SlotsProvider({ overrides, theme, children, }: {
|
|
1065
|
+
overrides?: SlotOverrides;
|
|
1066
|
+
/** Theme config. Pass `mode` for controlled light/dark/system; omit `mode` for uncontrolled. */
|
|
1067
|
+
theme?: ThemeConfig;
|
|
1068
|
+
children: ReactNode;
|
|
1069
|
+
}): react.JSX.Element;
|
|
1070
|
+
/** Resolves the atom implementation registered for `name` -- default unless overridden. */
|
|
1071
|
+
declare function useSlot<K extends keyof PublicAtomSlots>(name: K): PublicAtomSlots[K];
|
|
1072
|
+
/** Resolves the light or dark theme mode supplied by the SDK consumer. */
|
|
1073
|
+
declare function useThemeMode(): 'light' | 'dark';
|
|
1074
|
+
|
|
1075
|
+
type ThemeContextValue = {
|
|
1076
|
+
preset: ThemePreset;
|
|
1077
|
+
/** Resolved light/dark (never `"system"`). */
|
|
1078
|
+
mode: 'light' | 'dark';
|
|
1079
|
+
/** Preference including `"system"` when uncontrolled. */
|
|
1080
|
+
preference: ThemeMode;
|
|
1081
|
+
isDark: boolean;
|
|
1082
|
+
setTheme: (mode: ThemeMode) => void;
|
|
1083
|
+
/** Partial: `theme.brand` is optional, so consumers fall back to SDK defaults. */
|
|
1084
|
+
brand: Partial<BrandConfig>;
|
|
1085
|
+
icons: IconMap;
|
|
1086
|
+
classNames: ContentClassNames;
|
|
1087
|
+
tokens: Partial<SemanticTokens>;
|
|
1088
|
+
};
|
|
1089
|
+
declare function ThemeProvider({ theme, children }: {
|
|
1090
|
+
theme?: ThemeConfig;
|
|
1091
|
+
children: ReactNode;
|
|
1092
|
+
}): react.JSX.Element;
|
|
1093
|
+
declare function useTheme(): Pick<ThemeContextValue, 'preset' | 'mode' | 'preference' | 'isDark' | 'setTheme'>;
|
|
1094
|
+
/** Configured branding. Fields are optional — `theme.brand` may be omitted entirely. */
|
|
1095
|
+
declare function useBrand(): Partial<BrandConfig>;
|
|
1096
|
+
declare function useContentClassNames(): ContentClassNames;
|
|
1097
|
+
declare function useThemeIcons(): IconMap;
|
|
1098
|
+
/** Safe for trees that may sit outside ThemeProvider (falls back to {}). */
|
|
1099
|
+
declare function useOptionalContentClassNames(): ContentClassNames;
|
|
1100
|
+
|
|
1101
|
+
type BottomSheetProps = {
|
|
1102
|
+
open: boolean;
|
|
1103
|
+
onOpenChange: (open: boolean) => void;
|
|
1104
|
+
children: ReactNode;
|
|
1105
|
+
className?: string;
|
|
1106
|
+
id?: string;
|
|
1107
|
+
'aria-label': string;
|
|
1108
|
+
};
|
|
1109
|
+
declare function BottomSheet({ open, onOpenChange, children, className, id, 'aria-label': ariaLabel, }: BottomSheetProps): react.JSX.Element;
|
|
1110
|
+
|
|
1111
|
+
type AuiButtonVariant = 'default' | 'secondary' | 'ghost' | 'destructive' | 'outline';
|
|
1112
|
+
type AuiButtonSize = 'default' | 'sm' | 'lg' | 'icon';
|
|
1113
|
+
|
|
1114
|
+
type ButtonVariant = AuiButtonVariant;
|
|
1115
|
+
type ButtonSize = AuiButtonSize;
|
|
1116
|
+
type ButtonProps = react__default.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1117
|
+
variant?: ButtonVariant;
|
|
1118
|
+
size?: ButtonSize;
|
|
1119
|
+
asChild?: never;
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
type CenteredModalProps = {
|
|
1123
|
+
open: boolean;
|
|
1124
|
+
onOpenChange: (open: boolean) => void;
|
|
1125
|
+
title: string;
|
|
1126
|
+
description?: string;
|
|
1127
|
+
headerIcon?: ReactNode;
|
|
1128
|
+
children: ReactNode;
|
|
1129
|
+
className?: string;
|
|
1130
|
+
contentSized?: boolean;
|
|
1131
|
+
'aria-label'?: string;
|
|
1132
|
+
};
|
|
1133
|
+
/**
|
|
1134
|
+
* Responsive modal chrome: centered dialog on `md+`, bottom sheet below `md`.
|
|
1135
|
+
* One content tree for both breakpoints (native `<dialog>`).
|
|
1136
|
+
*/
|
|
1137
|
+
declare function CenteredModal({ open, onOpenChange, title, description, headerIcon, children, className, contentSized, 'aria-label': ariaLabel, }: CenteredModalProps): react.JSX.Element;
|
|
1138
|
+
|
|
1139
|
+
type IconButtonProps = Omit<ButtonProps, 'size' | 'children'> & {
|
|
1140
|
+
'aria-label': string;
|
|
1141
|
+
tooltip?: string;
|
|
1142
|
+
children: react__default.ReactNode;
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
type SwitchSize = 'sm' | 'md';
|
|
1146
|
+
type SwitchProps = Omit<ComponentPropsWithoutRef<'button'>, 'aria-checked' | 'children' | 'onClick' | 'role'> & {
|
|
1147
|
+
checked: boolean;
|
|
1148
|
+
onCheckedChange: (checked: boolean) => void;
|
|
1149
|
+
size?: SwitchSize;
|
|
1150
|
+
};
|
|
1151
|
+
declare function Switch({ checked, onCheckedChange, size, disabled, className, ...props }: SwitchProps): react.JSX.Element;
|
|
1152
|
+
|
|
1153
|
+
type IconProps = IconProps$1 & {
|
|
1154
|
+
name: string | readonly string[];
|
|
1155
|
+
};
|
|
1156
|
+
declare function Icon({ name, className, style, size, ...aria }: IconProps): react.JSX.Element | null;
|
|
1157
|
+
|
|
1158
|
+
type AvatarProps = react__default.HTMLAttributes<HTMLDivElement> & {
|
|
1159
|
+
size?: 'default' | 'sm' | 'lg';
|
|
1160
|
+
};
|
|
1161
|
+
declare function Avatar({ className, size, ...props }: AvatarProps): react__default.JSX.Element;
|
|
1162
|
+
type AvatarImageProps = react__default.ImgHTMLAttributes<HTMLImageElement>;
|
|
1163
|
+
declare function AvatarImage({ className, src, alt, onError, ...props }: AvatarImageProps): react__default.JSX.Element | null;
|
|
1164
|
+
type AvatarFallbackProps = react__default.HTMLAttributes<HTMLDivElement>;
|
|
1165
|
+
declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react__default.JSX.Element;
|
|
1166
|
+
|
|
1167
|
+
interface AgentStepsContainerProps {
|
|
1168
|
+
toolCount: number;
|
|
1169
|
+
thinkingCount: number;
|
|
1170
|
+
hasFinal: boolean;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Container for "Agent steps" section — groups reasoning, intermediate text, and tools
|
|
1174
|
+
* in a collapsible accordion that auto-collapses once final answer is confirmed.
|
|
1175
|
+
*/
|
|
1176
|
+
declare function AgentStepsContainer({ children, toolCount, thinkingCount, hasFinal, }: PropsWithChildren<AgentStepsContainerProps>): react.JSX.Element;
|
|
1177
|
+
|
|
1178
|
+
declare function AskUserContainer(): react.JSX.Element | null;
|
|
1179
|
+
|
|
1180
|
+
declare function AssistantMessageContainer(): react.JSX.Element;
|
|
1181
|
+
|
|
1182
|
+
declare function AssistantTextContainer(): react.JSX.Element;
|
|
1183
|
+
|
|
1184
|
+
declare function ComposerAttachmentsContainer(): react.JSX.Element;
|
|
1185
|
+
declare function MessageAttachmentsContainer(): react.JSX.Element;
|
|
1186
|
+
declare function ComposerAttachmentPickerContainer(): react.JSX.Element;
|
|
1187
|
+
|
|
1188
|
+
type ComposerContainerProps = {
|
|
1189
|
+
placeholder?: string;
|
|
1190
|
+
};
|
|
1191
|
+
declare function ComposerContainer({ placeholder, }: ComposerContainerProps): react.JSX.Element;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Renders `HistoryLoader` at the top of the message list and fetches
|
|
1195
|
+
* the next older history page when the user scrolls near it. Scroll position
|
|
1196
|
+
* is preserved across the prepend so the list doesn't jump.
|
|
1197
|
+
*
|
|
1198
|
+
* Must be rendered inside `ThreadViewportShell` (it locates the scroll root
|
|
1199
|
+
* via the `aui_thread-viewport` data-slot on its nearest scrollable ancestor).
|
|
1200
|
+
*/
|
|
1201
|
+
declare function HistoryLoaderContainer(): react.JSX.Element | null;
|
|
1202
|
+
|
|
1203
|
+
declare function McpAuthContainer(): react.JSX.Element | null;
|
|
1204
|
+
|
|
1205
|
+
declare const PostMcpOauthScreen: () => react.JSX.Element;
|
|
1206
|
+
|
|
1207
|
+
type ThreadGroupPart = MessagePrimitive.GroupedParts.GroupPart;
|
|
1208
|
+
declare function ToolGroupContainer({ children, group }: PropsWithChildren<{
|
|
1209
|
+
group: ThreadGroupPart;
|
|
1210
|
+
}>): react.JSX.Element;
|
|
1211
|
+
|
|
1212
|
+
declare function ReasoningContainer({ group }: {
|
|
1213
|
+
group: ThreadGroupPart;
|
|
1214
|
+
}): react.JSX.Element;
|
|
1215
|
+
|
|
1216
|
+
declare function ResumeUnavailableContainer(): react.JSX.Element | null;
|
|
1217
|
+
|
|
1218
|
+
/** The full assembled thread view: message list + composer. */
|
|
1219
|
+
declare function Thread(): react.JSX.Element;
|
|
1220
|
+
|
|
1221
|
+
type ThreadContainerProps = {
|
|
1222
|
+
/** Composer for the empty-welcome and docked bottom areas. `<Thread />` passes `<ComposerContainer />`. */
|
|
1223
|
+
composer?: ReactNode;
|
|
1224
|
+
};
|
|
1225
|
+
declare function ThreadContainer({ composer }: ThreadContainerProps): react.JSX.Element;
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Simplified relative to the reference: renders threads in a single flat list
|
|
1229
|
+
* rather than grouping them by Today/Yesterday/Earlier.
|
|
1230
|
+
*
|
|
1231
|
+
* Delete uses assistant-ui ThreadListItemPrimitive.Delete / ThreadListItemMorePrimitive
|
|
1232
|
+
* (adapter.delete → server.deleteSession). Mobile/compact keeps a BottomSheet chrome.
|
|
1233
|
+
*/
|
|
1234
|
+
type ThreadListContainerProps = {
|
|
1235
|
+
/** Called after New chat or selecting a row — used by stack/drawer chrome. */
|
|
1236
|
+
onThreadOpen?: () => void;
|
|
1237
|
+
};
|
|
1238
|
+
declare function ThreadListContainer({ onThreadOpen }?: ThreadListContainerProps): react.JSX.Element;
|
|
1239
|
+
|
|
1240
|
+
type ToastContent = {
|
|
1241
|
+
title: string;
|
|
1242
|
+
description?: string;
|
|
1243
|
+
};
|
|
1244
|
+
type ToasterContextValue = {
|
|
1245
|
+
showError: (error: unknown) => void;
|
|
1246
|
+
showSuccess: (content: ToastContent) => void;
|
|
1247
|
+
};
|
|
1248
|
+
declare function ToasterProvider({ children }: {
|
|
1249
|
+
children: ReactNode;
|
|
1250
|
+
}): react.JSX.Element;
|
|
1251
|
+
declare function useToaster(): ToasterContextValue;
|
|
1252
|
+
/** Same as `useToaster`, but returns `null` instead of throwing outside `ToasterProvider`. */
|
|
1253
|
+
declare function useToasterOptional(): ToasterContextValue | null;
|
|
1254
|
+
|
|
1255
|
+
type ToolApprovalOption = {
|
|
1256
|
+
id: string;
|
|
1257
|
+
label: string;
|
|
1258
|
+
isAllow: boolean;
|
|
1259
|
+
grants?: readonly string[];
|
|
1260
|
+
confirm?: {
|
|
1261
|
+
title?: string;
|
|
1262
|
+
description?: string;
|
|
1263
|
+
};
|
|
1264
|
+
};
|
|
1265
|
+
type ToolApprovalContainerProps = {
|
|
1266
|
+
toolName?: string;
|
|
1267
|
+
options: ToolApprovalOption[];
|
|
1268
|
+
onSelectOption: (optionId: string, reason?: string) => void;
|
|
1269
|
+
};
|
|
1270
|
+
declare function ToolApprovalContainer({ toolName, options, onSelectOption }: ToolApprovalContainerProps): react.JSX.Element;
|
|
1271
|
+
|
|
1272
|
+
declare const ToolCallContainer: ToolCallMessagePartComponent;
|
|
1273
|
+
|
|
1274
|
+
declare function ToolCallContentBlockContainer(props: ToolCallContentBlockProps): react.JSX.Element;
|
|
1275
|
+
|
|
1276
|
+
/** Host-facing shell configuration for agent / library / composer chrome. */
|
|
1277
|
+
type AgentConfig = {
|
|
1278
|
+
mode: 'SingleAgent';
|
|
1279
|
+
name: string;
|
|
1280
|
+
} | {
|
|
1281
|
+
mode: 'AgentLibrary';
|
|
1282
|
+
} | {
|
|
1283
|
+
mode: 'AgentComposer';
|
|
1284
|
+
defaultAgentSpec?: AgentSpec;
|
|
1285
|
+
} | {
|
|
1286
|
+
mode: 'AgentLibraryWithComposer';
|
|
1287
|
+
defaultAgentSpec?: AgentSpec;
|
|
1288
|
+
};
|
|
1289
|
+
declare const DEFAULT_AGENT_CONFIG: AgentConfig;
|
|
1290
|
+
/**
|
|
1291
|
+
* Active chat binding. Mutability (`isMutable`) decides composer / Save / updateSession —
|
|
1292
|
+
* not a parallel draft|named shell type.
|
|
1293
|
+
*/
|
|
1294
|
+
type ShellMode = {
|
|
1295
|
+
status: 'idle';
|
|
1296
|
+
} | {
|
|
1297
|
+
status: 'active';
|
|
1298
|
+
isMutable: boolean;
|
|
1299
|
+
/** Identity for immutable bind + history filter. */
|
|
1300
|
+
agentId?: string;
|
|
1301
|
+
/** Display / welcome label (often same as agentId). */
|
|
1302
|
+
agentName?: string;
|
|
1303
|
+
/** Seed for mutable (draft) runtime. */
|
|
1304
|
+
agentSpec?: AgentSpec;
|
|
1305
|
+
locked: boolean;
|
|
1306
|
+
};
|
|
1307
|
+
/** Library / New Chat create intent. */
|
|
1308
|
+
type SelectLibraryAgentRequest = {
|
|
1309
|
+
isMutable: boolean;
|
|
1310
|
+
agentId?: string;
|
|
1311
|
+
agentName?: string;
|
|
1312
|
+
agentSpec?: AgentSpec;
|
|
1313
|
+
};
|
|
1314
|
+
type ShellModeContextValue = {
|
|
1315
|
+
mode: ShellMode;
|
|
1316
|
+
/** Host agentConfig mode (capabilities source). */
|
|
1317
|
+
agentConfigMode: AgentConfig['mode'];
|
|
1318
|
+
/** Agents Library chrome. */
|
|
1319
|
+
isLibraryEnabled: boolean;
|
|
1320
|
+
/** Mutable composer / Save Agent chrome (host capability). */
|
|
1321
|
+
isComposerEnabled: boolean;
|
|
1322
|
+
/** Sidebar / list New Chat control. */
|
|
1323
|
+
isNewChatEnabled: boolean;
|
|
1324
|
+
settingsOpen: boolean;
|
|
1325
|
+
setSettingsOpen: (open: boolean) => void;
|
|
1326
|
+
/**
|
|
1327
|
+
* Bind from the Agents Library (Try = immutable, Edit = mutable + agentSpec).
|
|
1328
|
+
* Prefer this over `selectAgent` / `openDraft` when both fields are available.
|
|
1329
|
+
*/
|
|
1330
|
+
selectLibraryAgent: (req: SelectLibraryAgentRequest) => void;
|
|
1331
|
+
/**
|
|
1332
|
+
* Attach identity + agentSpec to the *current* mutable chat without remounting.
|
|
1333
|
+
* Used after `saveAgent` so the same draft session continues as an editable agent.
|
|
1334
|
+
*/
|
|
1335
|
+
bindMutableAgent: (req: {
|
|
1336
|
+
agentId: string;
|
|
1337
|
+
agentName: string;
|
|
1338
|
+
agentSpec: AgentSpec;
|
|
1339
|
+
}) => void;
|
|
1340
|
+
/** @deprecated Prefer `selectLibraryAgent({ isMutable: false, agentName })`. */
|
|
1341
|
+
selectAgent: (agentName: string) => void;
|
|
1342
|
+
/** @deprecated Prefer `selectLibraryAgent({ isMutable: true, agentSpec })`. */
|
|
1343
|
+
openDraft: () => void;
|
|
1344
|
+
/**
|
|
1345
|
+
* Open a history session, remounting when mutability/identity changes.
|
|
1346
|
+
* Prefer explicit `isMutable` from the session row; when omitted, agentName
|
|
1347
|
+
* present → immutable and agentName absent → mutable. Immutable rows may omit
|
|
1348
|
+
* `agentName` when the registry agent was deleted.
|
|
1349
|
+
*/
|
|
1350
|
+
openHistorySession: (req: {
|
|
1351
|
+
sessionId: string;
|
|
1352
|
+
agentName?: string;
|
|
1353
|
+
isMutable?: boolean;
|
|
1354
|
+
}) => void;
|
|
1355
|
+
/** Reset current chat; no-op when idle. */
|
|
1356
|
+
clearChat: () => void;
|
|
1357
|
+
/** Remount key for the chat runtime when binding changes. */
|
|
1358
|
+
runtimeKey: string;
|
|
1359
|
+
/**
|
|
1360
|
+
* History list filter forwarded as `listSessions({ agentId })`.
|
|
1361
|
+
* `null` = All chats. Only meaningful when `isLibraryEnabled`.
|
|
1362
|
+
*/
|
|
1363
|
+
historyAgentFilter: string | null;
|
|
1364
|
+
setHistoryAgentFilter: (agentId: string | null) => void;
|
|
1365
|
+
/** Effective `listSessionsAgentId` for the runtime (SingleAgent locks to name). */
|
|
1366
|
+
listSessionsAgentId: string | undefined;
|
|
1367
|
+
/** Session to open after a binding remount (history click across mutability). */
|
|
1368
|
+
pendingSessionId: string | undefined;
|
|
1369
|
+
/**
|
|
1370
|
+
* Bumped when the Agents Library catalog may have changed (e.g. after saveAgent).
|
|
1371
|
+
* Library chrome should re-fetch when this changes.
|
|
1372
|
+
*/
|
|
1373
|
+
agentsListEpoch: number;
|
|
1374
|
+
invalidateAgentsList: () => void;
|
|
1375
|
+
};
|
|
1376
|
+
declare function libraryAgentId(agent: Pick<AgentLibraryEntry, 'agentId' | 'name'>): string;
|
|
1377
|
+
declare function ShellModeProvider({ agentConfig, initialSettingsOpen, children, }: {
|
|
1378
|
+
agentConfig?: AgentConfig;
|
|
1379
|
+
/** Open settings on first paint (e.g. host boot with no models). Does not re-open later. */
|
|
1380
|
+
initialSettingsOpen?: boolean;
|
|
1381
|
+
children: ReactNode;
|
|
1382
|
+
}): react.JSX.Element;
|
|
1383
|
+
declare function useShellMode(): ShellModeContextValue;
|
|
1384
|
+
declare function useOptionalShellMode(): ShellModeContextValue | null;
|
|
1385
|
+
/** True when the shell is bound to a mutable (editable) agentSpec. */
|
|
1386
|
+
declare function shellIsMutable(mode: ShellMode): boolean;
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Built-in backends init inside `<TrueforgeUI />`.
|
|
1390
|
+
* Optional `catalog` is attached onto the resolved `AgentUIServer`.
|
|
1391
|
+
*/
|
|
1392
|
+
type TrueforgeBuiltInServerConfig = {
|
|
1393
|
+
type: 'truefoundry';
|
|
1394
|
+
apiKey: string;
|
|
1395
|
+
controlPlaneURL: string;
|
|
1396
|
+
gatewayPlaneURL?: string;
|
|
1397
|
+
catalog?: CatalogServer;
|
|
1398
|
+
} | {
|
|
1399
|
+
type: 'trueforge';
|
|
1400
|
+
/** Harness API root. Defaults to `'/'` (same-origin / proxied). */
|
|
1401
|
+
baseUrl?: string;
|
|
1402
|
+
/** Bearer token for `@truefoundry/trueforge-sdk` (`Authorization: Bearer …`). */
|
|
1403
|
+
token?: string;
|
|
1404
|
+
/** Custom fetch (cookie sessions, auth interceptors). */
|
|
1405
|
+
fetch?: typeof fetch;
|
|
1406
|
+
catalog?: CatalogServer;
|
|
1407
|
+
};
|
|
1408
|
+
/**
|
|
1409
|
+
* `server` prop for `<TrueforgeUI />`: a built-in config, or a ready
|
|
1410
|
+
* {@link AgentUIServer} passed directly (no `{ type: "custom" }` wrapper).
|
|
1411
|
+
*/
|
|
1412
|
+
type TrueforgeServerConfig = TrueforgeBuiltInServerConfig | AgentUIServer;
|
|
1413
|
+
|
|
1414
|
+
type ChatLayout = 'sidebar' | 'drawer' | 'dock' | 'widget';
|
|
1415
|
+
|
|
1416
|
+
type RuntimeAdapters$1 = NonNullable<UseTrueFoundryAgentRuntimeOptions['adapters']>;
|
|
1417
|
+
type TrueforgeUIProps = {
|
|
1418
|
+
server: TrueforgeServerConfig;
|
|
1419
|
+
layout: LayoutProp;
|
|
1420
|
+
overrides?: SlotOverrides;
|
|
1421
|
+
theme?: ThemeConfig;
|
|
1422
|
+
className?: string;
|
|
1423
|
+
initialSessionId?: string;
|
|
1424
|
+
adapters?: RuntimeAdapters$1;
|
|
1425
|
+
onError?: (error: unknown) => void;
|
|
1426
|
+
/**
|
|
1427
|
+
* Agent / library / composer shell mode.
|
|
1428
|
+
* Defaults to `{ mode: "AgentLibraryWithComposer" }`.
|
|
1429
|
+
*/
|
|
1430
|
+
agentConfig?: AgentConfig;
|
|
1431
|
+
/** Open settings on first paint only (host boot with no models configured). */
|
|
1432
|
+
initialSettingsOpen?: boolean;
|
|
1433
|
+
};
|
|
1434
|
+
/**
|
|
1435
|
+
* Quick-start assistant UI: slots + runtime + a built-in or custom layout.
|
|
1436
|
+
* Pass a built-in `server` config, a ready `AgentUIServer`, and optional `agentConfig`.
|
|
1437
|
+
*/
|
|
1438
|
+
declare function TrueforgeUI(props: TrueforgeUIProps): react.JSX.Element;
|
|
1439
|
+
|
|
1440
|
+
type RuntimeAdapters = NonNullable<UseTrueFoundryAgentRuntimeOptions['adapters']>;
|
|
1441
|
+
type TrueFoundryChatProviderProps = {
|
|
1442
|
+
server: AgentUIServer;
|
|
1443
|
+
initialSessionId?: string;
|
|
1444
|
+
adapters?: RuntimeAdapters;
|
|
1445
|
+
onError?: (error: unknown) => void;
|
|
1446
|
+
children: ReactNode;
|
|
1447
|
+
/** Discriminated agent source. Prefer over legacy `agentName`. */
|
|
1448
|
+
agent?: TrueFoundryAgentConfig;
|
|
1449
|
+
/** Legacy named-agent shorthand. Prefer `agent: { mode: "named", agentName }`. */
|
|
1450
|
+
agentName?: string;
|
|
1451
|
+
/** Forwarded to `listSessions({ agentId })` for history filtering. */
|
|
1452
|
+
listSessionsAgentId?: string;
|
|
1453
|
+
};
|
|
1454
|
+
/**
|
|
1455
|
+
* Chat shell: wires `useTrueFoundryAgentRuntime` from `server` and provides
|
|
1456
|
+
* assistant-ui + error toasts.
|
|
1457
|
+
*/
|
|
1458
|
+
declare function TrueFoundryChatProvider(props: TrueFoundryChatProviderProps): react.JSX.Element;
|
|
1459
|
+
|
|
1460
|
+
declare function UserEditComposerContainer(): react.JSX.Element;
|
|
1461
|
+
|
|
1462
|
+
declare function UserMessageContainer(): react.JSX.Element;
|
|
1463
|
+
|
|
1464
|
+
type ComposerBusyState = {
|
|
1465
|
+
/** True while submitting or while the turn stream is active. */
|
|
1466
|
+
isBusy: boolean;
|
|
1467
|
+
isRunning: boolean;
|
|
1468
|
+
isSubmitting: boolean;
|
|
1469
|
+
send: (sendFn: () => void | Promise<void>) => void;
|
|
1470
|
+
resetBusy: () => void;
|
|
1471
|
+
};
|
|
1472
|
+
declare function ComposerBusyProvider({ children }: {
|
|
1473
|
+
children: ReactNode;
|
|
1474
|
+
}): react.FunctionComponentElement<react.ProviderProps<ComposerBusyState | null>>;
|
|
1475
|
+
/**
|
|
1476
|
+
* Optimistic composer busy state shared across the thread. `useThreadIsRunning()`
|
|
1477
|
+
* only becomes true once the turn stream starts; this hook flips to busy
|
|
1478
|
+
* immediately on submit so the send button shows loading before session setup /
|
|
1479
|
+
* turn API work finishes.
|
|
1480
|
+
*
|
|
1481
|
+
* Must be used within `<ComposerBusyProvider>` (wired by default in `<Thread />`).
|
|
1482
|
+
*/
|
|
1483
|
+
declare function useComposerBusyState(): ComposerBusyState;
|
|
1484
|
+
|
|
1485
|
+
type ThreadPauseState = {
|
|
1486
|
+
thread: {
|
|
1487
|
+
messages: readonly {
|
|
1488
|
+
role: string;
|
|
1489
|
+
status?: {
|
|
1490
|
+
type: string;
|
|
1491
|
+
};
|
|
1492
|
+
metadata?: {
|
|
1493
|
+
custom?: unknown;
|
|
1494
|
+
};
|
|
1495
|
+
}[];
|
|
1496
|
+
};
|
|
1497
|
+
};
|
|
1498
|
+
/** Returns true when the latest assistant message is paused for MCP authorization. */
|
|
1499
|
+
declare function threadHasPendingMcpAuth(s: ThreadPauseState): boolean;
|
|
1500
|
+
type ComposerPauseView = {
|
|
1501
|
+
kind: 'mcp';
|
|
1502
|
+
} | {
|
|
1503
|
+
kind: 'ask-user';
|
|
1504
|
+
} | {
|
|
1505
|
+
kind: 'compose';
|
|
1506
|
+
};
|
|
1507
|
+
/** Shared composer pause detection for default and custom composer containers. */
|
|
1508
|
+
declare function useComposerPauseView(): ComposerPauseView;
|
|
1509
|
+
|
|
1510
|
+
declare const MCP_AUTH_POPUP_CHANNEL = "truefoundry-mcp-auth-popup";
|
|
1511
|
+
type McpAuthPopupMessage = {
|
|
1512
|
+
popupUid: string;
|
|
1513
|
+
isSuccess: boolean;
|
|
1514
|
+
};
|
|
1515
|
+
type McpAuthCallback = (isSuccess: boolean) => void;
|
|
1516
|
+
type UseMCPAuthOptions = {
|
|
1517
|
+
callbackPath?: string;
|
|
1518
|
+
};
|
|
1519
|
+
declare const useMCPAuth: ({ callbackPath }?: UseMCPAuthOptions) => {
|
|
1520
|
+
handleAuthorize: (integrationId: string, callback: McpAuthCallback) => Promise<void>;
|
|
1521
|
+
isOAuthLoading: boolean;
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
declare function ServerProvider({ server, children }: {
|
|
1525
|
+
server: AgentUIServer;
|
|
1526
|
+
children: ReactNode;
|
|
1527
|
+
}): react.JSX.Element;
|
|
1528
|
+
declare function useServer(): AgentUIServer;
|
|
1529
|
+
declare function useOptionalServer(): AgentUIServer | null;
|
|
1530
|
+
declare function useServerCapabilities(): AgentBuilderCapabilitiesResponse['data'] | null;
|
|
1531
|
+
declare function useCatalogServer(): CatalogServer;
|
|
1532
|
+
declare function useOptionalCatalogServer(): CatalogServer | null;
|
|
1533
|
+
|
|
1534
|
+
type AgentStepPart = {
|
|
1535
|
+
type: PartState['type'];
|
|
1536
|
+
text?: string;
|
|
1537
|
+
};
|
|
1538
|
+
interface AgentStepsSplitResult {
|
|
1539
|
+
cutIndex: number;
|
|
1540
|
+
hasFinal: boolean;
|
|
1541
|
+
toolCount: number;
|
|
1542
|
+
thinkingCount: number;
|
|
1543
|
+
}
|
|
1544
|
+
declare function computeAgentStepsSplit(parts: readonly AgentStepPart[], isRunning: boolean): AgentStepsSplitResult;
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* User-facing error text. Prefers HTTP body `{ error: { message } }` when
|
|
1548
|
+
* present (e.g. TrueForgeError), then `error.message` / `error.error.message`,
|
|
1549
|
+
* then `fallback`, then a string form of the value.
|
|
1550
|
+
*/
|
|
1551
|
+
declare function getErrorMessage(error: unknown, fallback?: string): string;
|
|
1552
|
+
|
|
1553
|
+
type DraftCatalogValue = {
|
|
1554
|
+
models: ModelSelection[];
|
|
1555
|
+
skills: AgentSkill[];
|
|
1556
|
+
connectors: ConnectorState[];
|
|
1557
|
+
loading: boolean;
|
|
1558
|
+
error: string | null;
|
|
1559
|
+
/** Kick off catalog fetch (idempotent). Call when a picker opens. */
|
|
1560
|
+
ensureLoaded: () => void;
|
|
1561
|
+
/** Refresh connector auth state without reloading unrelated catalogs. */
|
|
1562
|
+
refreshConnectors: () => Promise<void>;
|
|
1563
|
+
};
|
|
1564
|
+
declare function DraftCatalogProvider({ children }: {
|
|
1565
|
+
children: ReactNode;
|
|
1566
|
+
}): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null | undefined;
|
|
1567
|
+
declare function useDraftCatalog(): DraftCatalogValue;
|
|
1568
|
+
|
|
1569
|
+
export { type AgentConfig, type AgentStepPart, AgentStepsCard, type AgentStepsCardProps, AgentStepsContainer, type AgentStepsContainerProps, type AgentStepsSplitResult, AgentsLibrary, AgentsLibraryButton, type AgentsLibraryButtonProps, type AgentsLibraryProps, type AskUserAnswerDraft, type AnsweredQuestion as AskUserAnsweredQuestion, AskUserContainer, type AskUserPromptProps, type Question as AskUserQuestion, type AskUserPromptProps as AskUserQuestionCardProps, AssistantMessageBubble, type AssistantMessageBubbleProps, AssistantMessageContainer, AssistantTextContainer, type PublicAtomSlots as AtomSlots, AttachmentCard, type AttachmentCardProps, type AttachmentCardSize, AttachmentPickerButton, type AttachmentPickerButtonProps, AttachmentPreviewDialog, type AttachmentPreviewDialogProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, BottomSheet, type BottomSheetProps, type BrandConfig, BrandLogo, type BrandLogoConfig, type ButtonProps, type ButtonSize, type ButtonVariant, CenteredModal, type CenteredModalProps, ChatFileDownload, type ChatFileDownloadFile, type ChatFileDownloadProps, type ChatLayout, ClearChatButton, CodeEditor, type CodeEditorProps, ComposerAttachmentPickerContainer, ComposerAttachmentsContainer, ComposerBusyProvider, type ComposerBusyState, ComposerContainer, type ComposerContainerProps, ComposerLeftSection, type ComposerLeftSectionProps, type ComposerPauseView, ComposerRightSection, type ComposerRightSectionProps, ComposerSendButton, type ComposerSendButtonProps, ComposerShell, type ComposerShellProps, type ContentClassNames, DEFAULT_AGENT_CONFIG, DraftCatalogProvider, DraftComposerLeftSection, DraftComposerRightSection, DraftCompositeSelector, type DraftCompositeSelectorProps, DraftModelSelector, type DraftModelSelectorProps, HistoryLoader, HistoryLoaderContainer, type HistoryLoaderProps, Icon, type IconButtonProps, type IconMap, type IconProps, type LayoutProp, MCP_AUTH_POPUP_CHANNEL, Markdown, type MarkdownProps, type McpAuthCallback, type McpAuthPromptProps as McpAuthCardProps, McpAuthContainer, type McpAuthPopupMessage, type McpAuthPromptProps, type McpServer as McpAuthServer, MessageActionBar, type MessageActionBarProps, MessageAttachmentsContainer, MessageErrorBanner, type MessageErrorBannerProps, MessageGroup, type MessageGroupProps, MessageIndicator, type MessageIndicatorProps, MessageListSkeleton, type MessageListSkeletonProps, MessageTimestamp, type MessageTimestampProps, MonacoEditorCore, type MonacoEditorCoreProps, OpenUiFenceBlock, type OpenUiFenceBlockProps, PRESETS, PostMcpOauthScreen, type ReasoningCardProps, ReasoningContainer, ResumeUnavailable, ResumeUnavailableContainer, type ResumeUnavailableProps, SandboxArtifactDownload, type SandboxArtifactDownloadProps, SandboxToolCallCard, type SandboxToolCallCardProps, SaveAgentButton, ScrollToBottomButton, type ScrollToBottomButtonProps, SelectAgentEmptyState, type SelectLibraryAgentRequest, type SemanticTokens, ServerProvider, ShellActionsActionSlot, type ShellMode, ShellModeProvider, type SlotOverrides, SlotsProvider, SubAgentCard, type SubAgentCardProps, Switch, type SwitchProps, type SwitchSize, SyntaxHighlighter, type SyntaxHighlighterProps, type ThemeConfig, type IconProps$1 as ThemeIconProps, type ThemeMode, type ThemePreset, ThemeProvider, Thread, ThreadComposerAreaShell, type ThreadComposerAreaShellProps, ThreadContainer, type ThreadContainerProps, type ThreadGroupPart, ThreadListContainer, type ThreadListContainerProps, 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, ToasterProvider, ToolApprovalBar, type ToolApprovalBarProps, ToolApprovalContainer, type ToolApprovalOption, ToolCallCard, type ToolCallCardProps, ToolCallContainer, ToolCallContentBlock, ToolCallContentBlockContainer, type ToolCallContentBlockProps, type ToolCallStatus, ToolGroupCard, type ToolGroupCardProps, ToolGroupContainer, TrueFoundryChatProvider, type TrueFoundryChatProviderProps, type TrueforgeBuiltInServerConfig, type TrueforgeServerConfig, TrueforgeUI, type TrueforgeUIProps, USER_MESSAGE_ATTACHMENT_PREVIEW_REM, type UseMCPAuthOptions, UserEditComposerContainer, UserMessageActionBar, type UserMessageActionBarProps, UserMessageBubble, type UserMessageBubbleProps, UserMessageContainer, UserMessageEdit, type UserMessageEditProps, WelcomeScreen, type WelcomeScreenProps, computeAgentStepsSplit, defaultSlots, getErrorMessage, libraryAgentId, preloadMarkdownOpenUI, resolvePresetTokens, shellIsMutable, threadHasPendingMcpAuth, useBrand, useBrandName, useCatalogServer, useComposerBusyState, useComposerPauseView, useContentClassNames, useDraftCatalog, useMCPAuth, useOptionalCatalogServer, useOptionalContentClassNames, useOptionalServer, useOptionalShellMode, useServer, useServerCapabilities, useShellMode, useSlot, useTheme, useThemeIcons, useThemeMode, useToaster, useToasterOptional };
|