@brainfish-ai/components 0.30.10 → 0.31.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.
@@ -1,3 +1,4 @@
1
+ import { ClassProp } from 'class-variance-authority/types';
1
2
  import { ConversationActionsProps } from './ConversationActions';
2
3
  import { ConversationInputProps } from './ConversationInput';
3
4
  import { ConversationMessagesProps } from './ConversationMessages';
@@ -5,6 +6,9 @@ import { ConversationStatusProps } from './ConversationStatus';
5
6
  import { ConversationSuggestionsProps } from './ConversationSuggestions';
6
7
  import { default as default_2 } from 'react';
7
8
  import { ReactNode } from 'react';
9
+ import { VariantProps } from 'class-variance-authority';
10
+
11
+ export declare type ActivityBlock = ThinkingBlock | ToolUseBlock | ToolResultBlock;
8
12
 
9
13
  export declare type Article = {
10
14
  id: string;
@@ -53,7 +57,7 @@ declare type Collection = {
53
57
  url: string;
54
58
  };
55
59
 
56
- export declare type ContentBlock = TextBlock | AttachmentBlock;
60
+ export declare type ContentBlock = TextBlock | AttachmentBlock | ActivityBlock;
57
61
 
58
62
  declare type ContextPill = {
59
63
  id: string;
@@ -175,7 +179,7 @@ export declare const ConversationStatus: ({ className, children, variant, }: Con
175
179
  declare interface ConversationStatusProps_2 {
176
180
  className?: string;
177
181
  children?: default_2.ReactNode;
178
- variant?: 'yellowfin' | 'dark' | 'dark-subtle';
182
+ variant?: SweepTextVariant;
179
183
  }
180
184
 
181
185
  export declare const ConversationSuggestions: ({ items, className }: ConversationSuggestionsProps_2) => default_2.JSX.Element | null;
@@ -218,6 +222,21 @@ export declare type FileAttachmentBlock = {
218
222
  url?: string;
219
223
  };
220
224
 
225
+ /**
226
+ * Derive the live status label from a message's latest content block, or `null`
227
+ * when no status should be shown.
228
+ *
229
+ * The status reflects only the most recent activity ("latest only"): a tool
230
+ * call shows its mapped label, thinking shows "Thinking", and a tool result
231
+ * keeps the originating tool's label so it doesn't flicker to generic between
232
+ * the result arriving and the next block.
233
+ *
234
+ * It is shown before the first answer text and while tools/thinking are in
235
+ * flight, but hidden once answer text is actively streaming — returning `null`
236
+ * when the latest block is a text block that already has content.
237
+ */
238
+ export declare function getConversationStatusLabel(message: Message): string | null;
239
+
221
240
  export declare type Message = {
222
241
  id: string;
223
242
  role: MessageRole;
@@ -256,12 +275,37 @@ export declare type Suggestion = {
256
275
  icon?: string;
257
276
  };
258
277
 
278
+ declare type SweepTextVariant = NonNullable<VariantProps<typeof sweepTextVariants>['variant']>;
279
+
280
+ declare const sweepTextVariants: (props?: ({
281
+ variant?: "dark" | "yellowfin" | "dark-subtle" | null | undefined;
282
+ } & ClassProp) | undefined) => string;
283
+
259
284
  export declare type TextBlock = {
260
285
  type: 'text';
261
286
  text: string;
262
287
  citations?: Citation[];
263
288
  };
264
289
 
290
+ export declare type ThinkingBlock = {
291
+ type: 'thinking';
292
+ thinking: string;
293
+ };
294
+
295
+ export declare type ToolResultBlock = {
296
+ type: 'tool_result';
297
+ toolUseId: string;
298
+ content: string;
299
+ };
300
+
301
+ /** A tool invocation. `input` holds the raw (possibly partial) JSON arguments string. */
302
+ export declare type ToolUseBlock = {
303
+ type: 'tool_use';
304
+ id: string;
305
+ name: string;
306
+ input: string;
307
+ };
308
+
265
309
  export declare function useConversation(): ConversationContextValue;
266
310
 
267
311
  export { }
@@ -1 +1 @@
1
- ._loader_bghon_1 path{transform-box:view-box;transform-origin:36px 36px;transform:scale(1);animation:_ripple_bghon_1 1.6s ease-in-out infinite}._loader_bghon_1._monochrome_bghon_8 path{fill:var(--bfc-foreground)}._loader_bghon_1 path:nth-of-type(1){animation-delay:0s}._loader_bghon_1 path:nth-of-type(2){animation-delay:.22s}._loader_bghon_1 path:nth-of-type(3){animation-delay:.45s}._loader_bghon_1 path:nth-of-type(4){animation-delay:.67s}@keyframes _ripple_bghon_1{0%,to{opacity:.16;transform:scale(1)}16%{opacity:1;transform:scale(.74)}}@media(prefers-reduced-motion:reduce){._loader_bghon_1 path{animation:none;opacity:1;transform:scale(1)}}._followUpSearchBar_x7ads_1{box-shadow:0 -2px 4px #1212170d;background-color:var(--bfc-card)}
1
+ ._followUpSearchBar_x7ads_1{box-shadow:0 -2px 4px #1212170d;background-color:var(--bfc-card)}