@factorialco/f0-react 2.22.0 → 2.24.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/dist/f0.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AgentState } from '@livekit/components-react';
2
- import { AIMessage } from '@copilotkit/shared';
3
2
  import { AlertAvatarProps as AlertAvatarProps_2 } from './F0AvatarAlert';
4
3
  import { AlertTagCellValue } from './f0';
5
4
  import { AlertTagCellValue as AlertTagCellValue_2 } from './types/alertTag';
@@ -30,7 +29,6 @@ import { ComponentProps } from 'react';
30
29
  import { ComponentType } from 'react';
31
30
  import { CompoundCellValue } from './types/compound';
32
31
  import { Context } from 'react';
33
- import { CopilotKitProps } from '@copilotkit/react-core';
34
32
  import { CountCellValue } from './types/count';
35
33
  import { CountryCellValue } from './types/country';
36
34
  import { CSSProperties } from 'react';
@@ -101,7 +99,6 @@ import { LineChartConfig as LineChartConfig_2 } from './f0';
101
99
  import { LineChartPropsBase } from './utils/types';
102
100
  import { LocalAudioTrack } from 'livekit-client';
103
101
  import { LongTextCellValue } from './types/longText';
104
- import { Message as Message_2 } from '@copilotkit/shared';
105
102
  import { NumberCellValue } from './f0';
106
103
  import { NumberCellValue as NumberCellValue_2 } from './types/number';
107
104
  import { NumberFilterOptions } from './NumberFilter/NumberFilter';
@@ -511,6 +508,11 @@ export declare type AiChatMode = "chat" | "voice";
511
508
  */
512
509
  export declare type AiChatProviderProps = {
513
510
  enabled?: boolean;
511
+ /**
512
+ * Greeting phrase(s) shown by the welcome screen when the chat is empty.
513
+ * A single string renders once; an array rotates through phrases. Purely
514
+ * UI config — does not affect runtime behavior.
515
+ */
514
516
  initialMessage?: string | string[];
515
517
  welcomeScreenSuggestions?: WelcomeScreenSuggestion[];
516
518
  disclaimer?: AiChatDisclaimer;
@@ -588,27 +590,38 @@ export declare type AiChatProviderProps = {
588
590
  * File attachment configuration. When provided, enables file uploads in the chat.
589
591
  */
590
592
  fileAttachments?: AiChatFileAttachmentConfig;
591
- onThumbsUp?: (message: AIMessage, { threadId, feedback }: {
593
+ onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
592
594
  threadId: string;
593
595
  feedback: string;
594
596
  }) => void;
595
- onThumbsDown?: (message: AIMessage, { threadId, feedback }: {
597
+ onThumbsDown?: (message: F0AIMessage, { threadId, feedback }: {
596
598
  threadId: string;
597
599
  feedback: string;
598
600
  }) => void;
599
601
  tracking?: AiChatTrackingOptions;
600
602
  /**
601
- * Optional hook called before a user message is sent. Return false to block submission.
603
+ * Optional name of the AI agent. Forwarded to the host runtime adapter
604
+ * (mock in stories, CopilotKit in factorial) — f0 itself only stores it.
602
605
  */
603
- onBeforeSendMessage?: () => boolean | Promise<boolean>;
606
+ agent?: string;
604
607
  /**
605
- * Optional fetch implementation for AI runtime requests owned by F0.
608
+ * Slot elements rendered inside `<F0AiChat />`. Host apps (factorial in
609
+ * production, the mock runtime in stories) provide their own connected
610
+ * wrappers — f0 ships only the shell. Passing slots here makes them
611
+ * available to any `<F0AiChat />` mounted under this provider (used by
612
+ * `ApplicationFrame`, which renders the chat itself).
606
613
  */
607
- runtimeFetch?: typeof fetch;
608
- } & Pick<CopilotKitProps, "agent" | "credentials" | "children" | "runtimeUrl" | "showDevConsole" | "threadId" | "headers">;
614
+ chatHeader?: React.ReactNode;
615
+ chatMessages?: React.ReactNode;
616
+ chatInput?: React.ReactNode;
617
+ /** Children rendered inside the provider. */
618
+ children?: React.ReactNode;
619
+ };
609
620
 
610
621
  /**
611
- * Return value type for the useAiChat hook
622
+ * Return value type for the useAiChat hook. UI-only by design — message
623
+ * state and actions (send, clear, loadThread, etc.) live in the runtime
624
+ * adapter and are read via `useAiChatRuntime()`.
612
625
  */
613
626
  declare type AiChatProviderReturnValue = {
614
627
  enabled: boolean;
@@ -617,76 +630,22 @@ declare type AiChatProviderReturnValue = {
617
630
  setOpen: React.Dispatch<React.SetStateAction<boolean>>;
618
631
  shouldPlayEntranceAnimation: boolean;
619
632
  setShouldPlayEntranceAnimation: React.Dispatch<React.SetStateAction<boolean>>;
620
- tmp_setAgent: (agent?: string) => void;
633
+ setAgent: React.Dispatch<React.SetStateAction<string | undefined>>;
621
634
  placeholders: string[];
622
635
  setPlaceholders: React.Dispatch<React.SetStateAction<string[]>>;
623
- /**
624
- * The initial message to display in the chat
625
- */
626
636
  initialMessage?: string | string[];
627
637
  setInitialMessage: React.Dispatch<React.SetStateAction<string | string[] | undefined>>;
628
638
  welcomeScreenSuggestions: WelcomeScreenSuggestion[];
629
639
  setWelcomeScreenSuggestions: React.Dispatch<React.SetStateAction<WelcomeScreenSuggestion[]>>;
630
- onThumbsUp?: (message: AIMessage, { threadId, feedback }: {
640
+ onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
631
641
  threadId: string;
632
642
  feedback: string;
633
643
  }) => void;
634
- onThumbsDown?: (message: AIMessage, { threadId, feedback }: {
644
+ onThumbsDown?: (message: F0AIMessage, { threadId, feedback }: {
635
645
  threadId: string;
636
646
  feedback: string;
637
647
  }) => void;
638
648
  tracking?: AiChatTrackingOptions;
639
- /**
640
- * Optional hook called before a user message is sent. Return false to block submission.
641
- */
642
- onBeforeSendMessage?: () => boolean | Promise<boolean>;
643
- /**
644
- * Fetch implementation for AI runtime requests owned by F0.
645
- */
646
- runtimeFetch: typeof fetch;
647
- /**
648
- * Clear/reset the chat conversation
649
- */
650
- clear: () => void;
651
- /* Excluded from this release type: setClearFunction */
652
- /**
653
- * Title of the currently loaded thread, or null for new conversations
654
- */
655
- currentThreadTitle: string | null;
656
- /**
657
- * Load a thread by ID and set its title in the header
658
- */
659
- loadThread: (threadId: string, title: string) => void;
660
- /* Excluded from this release type: setLoadThreadFunction */
661
- /** Whether a thread's messages are currently being fetched */
662
- isLoadingThread: boolean;
663
- /* Excluded from this release type: setIsLoadingThread */
664
- /**
665
- * Send a message to the chat
666
- * @param message - The message content as a string, or a full Message object
667
- */
668
- sendMessage: (message: string | Message_2) => void;
669
- /* Excluded from this release type: setSendMessageFunction */
670
- /**
671
- * Append messages to the current conversation.
672
- * Useful for injecting pre-built assistant responses (e.g. dashboards)
673
- * from outside the chat. IDs are generated internally.
674
- *
675
- * @param options.persist - Whether to persist messages to the backend thread.
676
- * Defaults to `true`. Pass `false` for client-only display messages that
677
- * should not create or modify a backend thread (e.g. seed messages).
678
- */
679
- appendMessages: (messages: AppendMessage[], options?: {
680
- persist?: boolean;
681
- }) => void;
682
- /* Excluded from this release type: setAppendMessagesFunction */
683
- /**
684
- * Atomically clear the conversation and inject new messages.
685
- * Starts a fresh thread without the race condition of calling
686
- * clear() + appendMessages() separately.
687
- */
688
- clearAndAppend: (messages: AppendMessage[]) => void;
689
- /* Excluded from this release type: setReplaceMessagesFunction */
690
649
  /**
691
650
  * Current width of the chat window (for resizable mode)
692
651
  */
@@ -729,14 +688,14 @@ declare type AiChatProviderReturnValue = {
729
688
  * Set the footer content. Use this to update the footer from outside the provider (e.g. per page/route).
730
689
  */
731
690
  setFooter: React.Dispatch<React.SetStateAction<React.ReactNode | undefined>>;
732
- /** Whether the assistant is currently generating a response */
733
- inProgress: boolean;
734
- /** Set the in-progress state (synced from CopilotKit's isLoading) */
735
- setInProgress: (value: boolean) => void;
736
- /** The current clarifying question shown in the textarea, or null if none */
737
- clarifyingQuestion: ClarifyingQuestionState | null;
738
- /** Set the current clarifying question (or null to dismiss) */
739
- setClarifyingQuestion: React.Dispatch<React.SetStateAction<ClarifyingQuestionState | null>>;
691
+ /**
692
+ * True while a clarifying flow is active. F0 uses this flag to freeze
693
+ * layout / disable file drop / hide disclaimer. The actual panel state
694
+ * is owned by the host (factorial); F0 only sees the boolean.
695
+ */
696
+ isClarifying: boolean;
697
+ /** Set the clarifying flag. */
698
+ setIsClarifying: React.Dispatch<React.SetStateAction<boolean>>;
740
699
  /**
741
700
  * Whether files are currently being dragged over the chat window.
742
701
  * Set by the ChatWindow drag listeners and read by the DropOverlay
@@ -766,7 +725,7 @@ declare type AiChatProviderReturnValue = {
766
725
  pendingQuote: PendingQuote | null;
767
726
  /** Set the pending quote (pass null to clear). */
768
727
  setPendingQuote: React.Dispatch<React.SetStateAction<PendingQuote | null>>;
769
- } & Pick<AiChatState, "agent" | "disclaimer" | "resizable" | "entityRefs" | "canvasActions" | "canvasEntities" | "credits" | "employeeCredits" | "creditWarning" | "fileAttachments"> & {
728
+ } & Pick<AiChatState, "agent" | "chatHeader" | "chatMessages" | "chatInput" | "disclaimer" | "resizable" | "entityRefs" | "canvasActions" | "canvasEntities" | "credits" | "employeeCredits" | "creditWarning" | "fileAttachments"> & {
770
729
  /** The current canvas content, or null when canvas is closed */
771
730
  canvasContent: CanvasContent | null;
772
731
  /** Open the canvas panel with the given content */
@@ -782,12 +741,17 @@ declare type AiChatProviderReturnValue = {
782
741
  };
783
742
 
784
743
  /**
785
- * Internal state for the AiChat provider
744
+ * Internal state for the AiChat provider. Pure UI / config concerns —
745
+ * message-runtime concerns (sendMessage, threadId, streaming) live in a
746
+ * separate adapter (mock in stories, factorial-side in production).
786
747
  */
787
748
  declare interface AiChatState {
788
749
  enabled: boolean;
789
750
  agent?: string;
790
751
  initialMessage?: string | string[];
752
+ chatHeader?: React.ReactNode;
753
+ chatMessages?: React.ReactNode;
754
+ chatInput?: React.ReactNode;
791
755
  welcomeScreenSuggestions?: WelcomeScreenSuggestion[];
792
756
  disclaimer?: AiChatDisclaimer;
793
757
  resizable?: boolean;
@@ -805,31 +769,23 @@ declare interface AiChatState {
805
769
  fileAttachments?: AiChatFileAttachmentConfig;
806
770
  placeholders?: string[];
807
771
  setPlaceholders?: React.Dispatch<React.SetStateAction<string[]>>;
808
- onThumbsUp?: (message: AIMessage, { threadId, feedback }: {
772
+ onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
809
773
  threadId: string;
810
774
  feedback: string;
811
775
  }) => void;
812
- onThumbsDown?: (message: AIMessage, { threadId, feedback }: {
776
+ onThumbsDown?: (message: F0AIMessage, { threadId, feedback }: {
813
777
  threadId: string;
814
778
  feedback: string;
815
779
  }) => void;
816
780
  tracking?: AiChatTrackingOptions;
817
- /**
818
- * Optional hook called before a user message is sent. Return false to block submission.
819
- */
820
- onBeforeSendMessage?: () => boolean | Promise<boolean>;
821
- /**
822
- * Optional fetch implementation for AI runtime requests owned by F0.
823
- */
824
- runtimeFetch?: typeof fetch;
825
781
  }
826
782
 
827
- declare type AiChatTrackingOptions = {
783
+ export declare type AiChatTrackingOptions = {
828
784
  onVisibility?: () => void;
829
785
  onClose?: () => void;
830
786
  onWelcomeSuggestionClick?: (event: WelcomeSuggestionClickEvent) => void;
831
787
  onNewChat?: () => void;
832
- onMessage?: (message: Message_2) => void;
788
+ onMessage?: (message: F0Message) => void;
833
789
  };
834
790
 
835
791
  /**
@@ -876,7 +832,7 @@ export declare type AiInsightCardContent = {
876
832
  };
877
833
 
878
834
  /** Assistant-flavoured `Message`. Same shape — alias for self-documentation. */
879
- declare type AIMessage_2 = Message_3;
835
+ declare type AIMessage = Message_2;
880
836
 
881
837
  /**
882
838
  * Default AI chat translations — derived from the global defaultTranslations
@@ -4833,7 +4789,9 @@ declare type DetailsItemContent = (ComponentProps<typeof DataList.Item> & {
4833
4789
  }[TagType] | {
4834
4790
  type: "avatar-list";
4835
4791
  avatarList: F0AvatarListProps;
4836
- };
4792
+ } | (ComponentProps<typeof FileItem> & {
4793
+ type: "file";
4794
+ });
4837
4795
 
4838
4796
  export declare type DialogPosition = (typeof dialogPositions)[number];
4839
4797
 
@@ -5358,7 +5316,7 @@ export declare interface F0AiAvailableFormDefinition<TParams extends Record<stri
5358
5316
  /**
5359
5317
  * @experimental This is an experimental component use it at your own risk
5360
5318
  */
5361
- export declare const F0AiChat: () => JSX_2.Element | null;
5319
+ export declare const F0AiChat: ({ header: headerProp, messages: messagesProp, input: inputProp, }: F0AiChatProps) => JSX_2.Element | null;
5362
5320
 
5363
5321
  /**
5364
5322
  * Headless chat header. Renders a top bar with title (or thread selector),
@@ -5444,10 +5402,28 @@ export declare type F0AiChatHistoryProps = {
5444
5402
  onDeleteThread: (id: string) => Promise<void> | void;
5445
5403
  };
5446
5404
 
5405
+ /**
5406
+ * Slot composition for the F0 AI chat shell. F0 ships the shell + UI
5407
+ * primitives; the consumer (factorial in production, the mock runtime
5408
+ * in stories) supplies the connected slot components that wire data
5409
+ * through whatever runtime they choose (CopilotKit, Mastra, mock, …).
5410
+ *
5411
+ * Slots are optional so the shell renders cleanly even when no runtime
5412
+ * is mounted (the chat just stays empty).
5413
+ */
5414
+ export declare interface F0AiChatProps {
5415
+ /** Header slot rendered at the top of the chat window. */
5416
+ header?: ReactNode;
5417
+ /** Messages slot rendered inside the scrollable area. */
5418
+ messages?: ReactNode;
5419
+ /** Input slot rendered at the bottom (textarea + suggestions + disclaimer). */
5420
+ input?: ReactNode;
5421
+ }
5422
+
5447
5423
  /**
5448
5424
  * @experimental This is an experimental component use it at your own risk
5449
5425
  */
5450
- export declare const F0AiChatProvider: ({ enabled, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, credits, employeeCredits, creditWarning, fileAttachments, onThumbsUp, onThumbsDown, onBeforeSendMessage, runtimeFetch, children, agent, tracking, ...copilotKitProps }: AiChatProviderProps) => JSX_2.Element;
5426
+ export declare const F0AiChatProvider: ({ enabled, initialMessage, chatHeader, chatMessages, chatInput, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, credits, employeeCredits, creditWarning, fileAttachments, onThumbsUp, onThumbsDown, children, agent, tracking, }: AiChatProviderProps) => JSX_2.Element;
5451
5427
 
5452
5428
  /**
5453
5429
  * Headless chat composer.
@@ -5458,7 +5434,7 @@ export declare const F0AiChatProvider: ({ enabled, initialMessage, welcomeScreen
5458
5434
  * coupling to `useAiChat()` or CopilotKit — wrappers like F0AiChat
5459
5435
  * provide the wiring.
5460
5436
  */
5461
- export declare const F0AiChatTextArea: ({ onSubmit, onStop, inProgress, onBeforeSubmit, placeholders, creditWarning, clarifyingQuestion, pendingContext, onPendingContextChange, pendingQuote, onPendingQuoteChange, fileAttachments, searchPersons, onProcessFilesRef, disclaimer, footer, isWelcomeScreen, fullscreen, welcomeScreenSuggestions, onSuggestionClick, ref, }: F0AiChatTextAreaProps) => JSX_2.Element;
5437
+ export declare const F0AiChatTextArea: ({ onSubmit, onStop, inProgress, onBeforeSubmit, placeholders, creditWarning, clarifyingUI, pendingContext, onPendingContextChange, pendingQuote, onPendingQuoteChange, fileAttachments, searchPersons, onProcessFilesRef, disclaimer, footer, isWelcomeScreen, fullscreen, welcomeScreenSuggestions, onSuggestionClick, ref, }: F0AiChatTextAreaProps) => JSX_2.Element;
5462
5438
 
5463
5439
  export declare type F0AiChatTextAreaProps = {
5464
5440
  ref: RefObject<HTMLDivElement>;
@@ -5479,10 +5455,13 @@ export declare type F0AiChatTextAreaProps = {
5479
5455
  /** Credit warning banner shown above the composer. */
5480
5456
  creditWarning?: AiChatCreditWarning;
5481
5457
  /**
5482
- * Clarifying question to render in place of the input. When non-null the
5483
- * panel takes over the composer surface and submission is blocked.
5458
+ * Optional ReactNode rendered in place of the input. When present the
5459
+ * composer enters "clarifying" mode: form submission is blocked, the
5460
+ * gradient border activates, and a nav-hint replaces the disclaimer.
5461
+ * The host owns the panel (typically `F0ClarifyingPanel`) and its
5462
+ * state — F0 just renders the slot.
5484
5463
  */
5485
- clarifyingQuestion?: ClarifyingQuestionState | null;
5464
+ clarifyingUI?: ReactNode;
5486
5465
  /** Pending context shown as a chip; prepended invisibly on submit. */
5487
5466
  pendingContext?: PendingContext | null;
5488
5467
  /** Called when the user dismisses pending context (or it gets consumed on submit). */
@@ -5537,16 +5516,16 @@ export declare type F0AiChatTextAreaProps = {
5537
5516
  /**
5538
5517
  * Payload emitted by `F0AiChatTextArea` when the user submits.
5539
5518
  *
5540
- * `text` already contains the inline markup the renderer expects:
5541
- * `<entity-ref>` tags for @mentions, `<reply-quote>` for the quoted
5542
- * fragment, and HTML-escaped user-typed text. The consumer decides how
5543
- * to wrap it (plain string vs multipart message) when forwarding to
5544
- * the agent.
5519
+ * `text` contains HTML-escaped user-typed text with `<entity-ref>` tags
5520
+ * for @mentions only. The reply quote (if any) and pending context
5521
+ * travel as separate structured fields the adapter (factorial) owns
5522
+ * the wire encoding when forwarding to the agent.
5545
5523
  */
5546
5524
  export declare type F0AiChatTextAreaSubmitPayload = {
5547
5525
  text: string;
5548
5526
  files: UploadedFile[];
5549
5527
  context: PendingContext | null;
5528
+ quote: PendingQuote | null;
5550
5529
  };
5551
5530
 
5552
5531
  /**
@@ -5725,6 +5704,9 @@ export declare class F0AiMask {
5725
5704
  private render;
5726
5705
  }
5727
5706
 
5707
+ /** Assistant-flavoured `F0Message`. Same shape — alias kept for clarity. */
5708
+ export declare type F0AIMessage = F0Message;
5709
+
5728
5710
  export declare const F0AiMessagesContainer: (props: F0AiMessagesContainerProps) => JSX_2.Element;
5729
5711
 
5730
5712
  export declare type F0AiMessagesContainerProps = {
@@ -5753,7 +5735,7 @@ export declare type F0AiMessagesContainerProps = {
5753
5735
  /** Called when the user selects text and clicks Reply (user or assistant bubble). */
5754
5736
  onReplyQuote?: (text: string) => void;
5755
5737
  /** Called when an assistant message finishes generating — for analytics. */
5756
- onAssistantMessageRendered?: (message: Message_3) => void;
5738
+ onAssistantMessageRendered?: (message: Message_2) => void;
5757
5739
  /** Disables auto-scrollIntoView on new user messages (fullscreen sets false). */
5758
5740
  autoScrollUserIntoView?: boolean;
5759
5741
  /**
@@ -6015,11 +5997,11 @@ declare type F0AssistantMessageExtraProps = {
6015
5997
  * full message list to call CopilotKit's lazy tool renderer; standalone
6016
5998
  * consumers can omit it.
6017
5999
  */
6018
- renderToolCall?: (message: Message_3) => ReactNode | null;
6000
+ renderToolCall?: (message: Message_2) => ReactNode | null;
6019
6001
  /** Called when the user selects text in this message and clicks Reply. */
6020
6002
  onReplyQuote?: (text: string) => void;
6021
6003
  /** Called once the assistant message has finished generating — for analytics. */
6022
- onRendered?: (message: Message_3) => void;
6004
+ onRendered?: (message: Message_2) => void;
6023
6005
  /**
6024
6006
  * Renders the assistant text content. The connected wrapper provides a
6025
6007
  * markdown-aware implementation; standalone consumers can omit it and a
@@ -6112,10 +6094,19 @@ export declare type F0AvatarIconProps = {
6112
6094
  } & Partial<Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">>;
6113
6095
 
6114
6096
  export declare const F0AvatarList: WithDataTestIdReturnType_4< {
6115
- ({ avatars, size, type, noTooltip, remainingCount: initialRemainingCount, max, }: F0AvatarListProps_2): JSX_2.Element;
6097
+ ({ avatars, size, type, noTooltip, remainingCount: initialRemainingCount, max, tooltipScroll, }: F0AvatarListProps_2): JSX_2.Element;
6116
6098
  displayName: string;
6117
6099
  }>;
6118
6100
 
6101
+ /**
6102
+ * Optional extras every avatar entry may carry regardless of `type`.
6103
+ * `tooltipDescription` is rendered as the tooltip's secondary line via the
6104
+ * underlying `Tooltip` `description` slot (use it for emails, roles, etc.).
6105
+ */
6106
+ declare type F0AvatarListExtras = {
6107
+ tooltipDescription?: string;
6108
+ };
6109
+
6119
6110
  export declare type F0AvatarListProps = {
6120
6111
  /**
6121
6112
  * The size of the avatars in the list.
@@ -6143,23 +6134,32 @@ export declare type F0AvatarListProps = {
6143
6134
  * @default "compact"
6144
6135
  */
6145
6136
  layout?: "fill" | "compact";
6137
+ /**
6138
+ * Controls the scroll behavior of the `+N` overflow popover that lists
6139
+ * collapsed avatars (including their `tooltipDescription` entries).
6140
+ * - `"vertical"` (default): caps the popover height and scrolls vertically.
6141
+ * - `"none"`: lets the popover grow to fit all entries.
6142
+ * @default "vertical"
6143
+ */
6144
+ tooltipScroll?: "vertical" | "none";
6146
6145
  } & F0AvatarListPropsAvatars;
6147
6146
 
6148
6147
  declare type F0AvatarListPropsAvatars = {
6149
6148
  type: "person";
6150
- avatars: (Omit<PersonAvatarVariant, "type"> & Record<string, unknown>)[];
6149
+ avatars: (Omit<PersonAvatarVariant, "type"> & // Allow to have more properties in the avatar variant
6150
+ F0AvatarListExtras & Record<string, unknown>)[];
6151
6151
  } | {
6152
6152
  type: "team";
6153
- avatars: (Omit<TeamAvatarVariant, "type"> & Record<string, unknown>)[];
6153
+ avatars: (Omit<TeamAvatarVariant, "type"> & F0AvatarListExtras & Record<string, unknown>)[];
6154
6154
  } | {
6155
6155
  type: "company";
6156
- avatars: (Omit<CompanyAvatarVariant, "type"> & Record<string, unknown>)[];
6156
+ avatars: (Omit<CompanyAvatarVariant, "type"> & F0AvatarListExtras & Record<string, unknown>)[];
6157
6157
  } | {
6158
6158
  type: "flag";
6159
- avatars: (Omit<FlagAvatarVariant, "type"> & Record<string, unknown>)[];
6159
+ avatars: (Omit<FlagAvatarVariant, "type"> & F0AvatarListExtras & Record<string, unknown>)[];
6160
6160
  } | {
6161
6161
  type: "file";
6162
- avatars: (Omit<FileAvatarVariant, "type"> & Record<string, unknown>)[];
6162
+ avatars: (Omit<FileAvatarVariant, "type"> & F0AvatarListExtras & Record<string, unknown>)[];
6163
6163
  };
6164
6164
 
6165
6165
  export declare const F0AvatarModule: WithDataTestIdReturnType_4<typeof F0AvatarModule_2>;
@@ -8695,6 +8695,24 @@ export declare type F0LinkProps = Omit<ActionLinkProps, "variant" | "href"> & {
8695
8695
  href?: string;
8696
8696
  };
8697
8697
 
8698
+ export declare type F0Message = {
8699
+ id: string;
8700
+ role: "user" | "assistant" | "system" | "tool";
8701
+ content?: unknown;
8702
+ toolCalls?: F0ToolCall[];
8703
+ toolCallId?: string;
8704
+ createdAt?: string;
8705
+ generativeUI?: () => unknown;
8706
+ rawData?: unknown;
8707
+ /**
8708
+ * Reply quote text attached to the message by the composer. Rendered
8709
+ * as a block above the user bubble. Adapters (factorial / mock) own
8710
+ * the wire encoding; F0 only reads this structured field.
8711
+ */
8712
+ replyQuote?: string;
8713
+ [key: string]: any;
8714
+ };
8715
+
8698
8716
  export declare const F0ModuleCard: ({ moduleName, description, onAction, actionHref, imageSrc, }: F0ModuleCardProps) => JSX_2.Element;
8699
8717
 
8700
8718
  /**
@@ -9566,28 +9584,35 @@ export declare interface F0TimelineRowMultitaskProps extends F0TimelineRowBasePr
9566
9584
  }
9567
9585
 
9568
9586
  /**
9569
- * Props for a nestedtask timeline row.
9570
- * Renders a task-style header (custom icon, title, description, chevron toggle)
9571
- * with collapsible nested items and optional group-level metadata (assignees, file chips, etc.).
9572
- * Unlike multitask, the header looks like a regular task row with expand/collapse capability.
9587
+ * Shared shape for nestedtask rows. The collapsible behaviour is layered on
9588
+ * top via a discriminated union (`F0TimelineRowNestedtaskProps`) so callers
9589
+ * either provide both `expanded` and `onExpandToggle` (collapsible) or
9590
+ * neither (non-collapsible).
9573
9591
  */
9574
- export declare interface F0TimelineRowNestedtaskProps extends F0TimelineRowBaseProps {
9592
+ declare interface F0TimelineRowNestedtaskBaseProps extends F0TimelineRowBaseProps {
9575
9593
  /** The icon representing the task type */
9576
9594
  icon: IconType;
9577
9595
  /** Description text (e.g., "Estimated on 18/07/2025") */
9578
9596
  description?: string;
9579
- /** Number of nested items (displayed in the progress pill) */
9580
- taskCount: number;
9597
+ /**
9598
+ * Number of nested items (displayed in the progress pill alongside
9599
+ * `completedCount`). Omit when the row body conveys progress on its own
9600
+ * (e.g. an embedded info card or table) and a pill would be redundant.
9601
+ */
9602
+ taskCount?: number;
9581
9603
  /** Number of completed items (displayed in the progress pill) */
9582
9604
  completedCount?: number;
9583
- /** Whether the row is expanded (controlled) */
9584
- expanded: boolean;
9585
- /** Callback when expand/collapse is toggled */
9586
- onExpandToggle: () => void;
9587
9605
  /** Metadata items displayed below the header (e.g., assignees, file chips). Always visible regardless of expand/collapse */
9588
9606
  metadata?: (MetadataItem | undefined | boolean)[];
9589
- /** The nested task items to render when expanded */
9590
- items: F0TimelineRowTaskProps[];
9607
+ /** The nested task items to render when expanded. Ignored when `content` is provided. */
9608
+ items?: F0TimelineRowTaskProps[];
9609
+ /**
9610
+ * Custom content to render in the expanded body of the row. When provided,
9611
+ * `items` is ignored and this React node is rendered instead. Use this to
9612
+ * embed richer UI (callout cards, tables, custom panels) inside a nested
9613
+ * timeline row.
9614
+ */
9615
+ content?: React.ReactNode;
9591
9616
  /** Primary action button (displayed on the right after a divider) */
9592
9617
  primaryAction?: F0TimelineRowAction;
9593
9618
  /** Secondary action buttons (displayed on the left) */
@@ -9596,6 +9621,38 @@ export declare interface F0TimelineRowNestedtaskProps extends F0TimelineRowBaseP
9596
9621
  otherActions?: F0TimelineRowOtherAction[];
9597
9622
  }
9598
9623
 
9624
+ /**
9625
+ * Props for a nestedtask timeline row.
9626
+ * Renders a task-style header (custom icon, title, description, chevron toggle)
9627
+ * with collapsible nested items and optional group-level metadata (assignees, file chips, etc.).
9628
+ * Unlike multitask, the header looks like a regular task row with expand/collapse capability.
9629
+ *
9630
+ * Discriminated by `collapsible`:
9631
+ * - default / `collapsible: true` — both `expanded` and `onExpandToggle` are required.
9632
+ * - `collapsible: false` — the row is always expanded, the header has no toggle affordance,
9633
+ * and `expanded`/`onExpandToggle` are not accepted.
9634
+ */
9635
+ export declare type F0TimelineRowNestedtaskProps = (F0TimelineRowNestedtaskBaseProps & {
9636
+ /**
9637
+ * Whether the header chevron toggles the body.
9638
+ * @default true
9639
+ */
9640
+ collapsible?: true;
9641
+ /** Whether the row is expanded (controlled) */
9642
+ expanded: boolean;
9643
+ /** Callback when expand/collapse is toggled */
9644
+ onExpandToggle: () => void;
9645
+ }) | (F0TimelineRowNestedtaskBaseProps & {
9646
+ /**
9647
+ * When false, the row is always expanded and the header has no toggle
9648
+ * affordance — useful when the body controls its own expansion
9649
+ * (e.g. a collapsible callout card).
9650
+ */
9651
+ collapsible: false;
9652
+ expanded?: never;
9653
+ onExpandToggle?: never;
9654
+ });
9655
+
9599
9656
  export declare type F0TimelineRowOtherAction = DropdownItem;
9600
9657
 
9601
9658
  export declare type F0TimelineRowProps = F0TimelineRowTaskProps | F0TimelineRowMultitaskProps | F0TimelineRowNestedtaskProps;
@@ -9616,6 +9673,21 @@ export declare interface F0TimelineRowTaskProps extends F0TimelineRowBaseProps {
9616
9673
  otherActions?: F0TimelineRowOtherAction[];
9617
9674
  }
9618
9675
 
9676
+ /**
9677
+ * Loose message shape used inside f0. Mirrors the CopilotKit `Message`
9678
+ * shape so adapters (factorial, mock runtime) can map back and forth
9679
+ * with no field rename, but is owned by f0 — nothing in `src/` imports
9680
+ * from `@copilotkit/*` anymore.
9681
+ */
9682
+ export declare type F0ToolCall = {
9683
+ id: string;
9684
+ type?: "function";
9685
+ function: {
9686
+ name: string;
9687
+ arguments: string;
9688
+ };
9689
+ };
9690
+
9619
9691
  export declare const F0WizardForm: {
9620
9692
  <TSchema extends F0FormSchema_2>(props: F0WizardFormSingleSchemaProps<TSchema>): default_2.ReactElement;
9621
9693
  <T extends F0PerSectionSchema_2>(props: F0WizardFormPerSectionProps<T>): default_2.ReactElement;
@@ -9729,11 +9801,11 @@ export declare interface F0ZodType<T extends ZodTypeAny = ZodTypeAny> {
9729
9801
 
9730
9802
  export declare type FeedbackConfig = {
9731
9803
  threadId: string;
9732
- onThumbsUp: (msg: AIMessage_2, ctx: {
9804
+ onThumbsUp: (msg: AIMessage, ctx: {
9733
9805
  threadId: string;
9734
9806
  feedback: string;
9735
9807
  }) => void;
9736
- onThumbsDown: (msg: AIMessage_2, ctx: {
9808
+ onThumbsDown: (msg: AIMessage, ctx: {
9737
9809
  threadId: string;
9738
9810
  feedback: string;
9739
9811
  }) => void;
@@ -11114,7 +11186,7 @@ export declare interface Message {
11114
11186
  * Most fields are optional / wide on purpose — the headless renders
11115
11187
  * what it finds and ignores the rest.
11116
11188
  */
11117
- declare type Message_3 = {
11189
+ declare type Message_2 = {
11118
11190
  id?: string;
11119
11191
  role?: string;
11120
11192
  content?: unknown;
@@ -11128,6 +11200,13 @@ declare type Message_3 = {
11128
11200
  }>;
11129
11201
  generativeUI?: () => unknown;
11130
11202
  rawData?: unknown;
11203
+ /**
11204
+ * Reply quote text the composer attached to this (user) message.
11205
+ * Rendered as a block above the bubble. The wire protocol that carries
11206
+ * this is owned by the adapter (factorial) — F0 only consumes the
11207
+ * structured field.
11208
+ */
11209
+ replyQuote?: string;
11131
11210
  [key: string]: any;
11132
11211
  };
11133
11212
 
@@ -11180,6 +11259,7 @@ declare type MetadataItemValue = {
11180
11259
  variant: StatusVariant;
11181
11260
  } | ({
11182
11261
  type: "list";
11262
+ max?: number;
11183
11263
  } & ({
11184
11264
  variant: "person";
11185
11265
  avatars: (PersonAvatarVariant | (PersonAvatarVariant & Record<string, unknown>))[];
@@ -12509,7 +12589,7 @@ declare type RelaxedNumericWithFormatter = Omit<NumericWithFormatter, "numericVa
12509
12589
  */
12510
12590
  export declare type RenderableTurn = {
12511
12591
  /** Messages rendered before the thinking section (typically the user message). */
12512
- userMessages: Message_3[];
12592
+ userMessages: Message_2[];
12513
12593
  /**
12514
12594
  * Optional collapsible "thinking" header rendered between user and
12515
12595
  * assistant blocks. Titles are pre-parsed upstream.
@@ -12530,7 +12610,7 @@ export declare type RenderableTurn = {
12530
12610
  isWriting?: boolean;
12531
12611
  };
12532
12612
  /** Messages rendered after the thinking section (assistant replies). */
12533
- assistantMessages: Message_3[];
12613
+ assistantMessages: Message_2[];
12534
12614
  /** True while the agent is still producing content for this turn. */
12535
12615
  isInProgress: boolean;
12536
12616
  /**
@@ -12549,7 +12629,7 @@ export declare type RenderableTurn = {
12549
12629
  /** Concatenated assistant content for the copy button. */
12550
12630
  content: string;
12551
12631
  /** Reference message attached to feedback submissions. */
12552
- targetMessage: Message_3;
12632
+ targetMessage: Message_2;
12553
12633
  };
12554
12634
  };
12555
12635
 
@@ -14061,9 +14141,6 @@ declare interface UpsellRequestResponseDialogProps {
14061
14141
  * is mounted — that case is intentional in `ApplicationFrame`, which
14062
14142
  * renders chat-aware components in both the AI-enabled tree and the
14063
14143
  * promotion-chat tree.
14064
- *
14065
- * Most consumers don't need to think about this — they're rendered
14066
- * under `<F0AiChatProvider>` and receive the real context.
14067
14144
  */
14068
14145
  export declare function useAiChat(): AiChatProviderReturnValue;
14069
14146
 
@@ -14832,7 +14909,7 @@ export declare type WelcomeScreenSuggestionItem = {
14832
14909
  * analytics layer (e.g. Amplitude) needs to attribute the click: the picked
14833
14910
  * sub-item, its parent group, and the resolved prompt that was actually sent.
14834
14911
  */
14835
- declare type WelcomeSuggestionClickEvent = {
14912
+ export declare type WelcomeSuggestionClickEvent = {
14836
14913
  item: WelcomeScreenSuggestionItem;
14837
14914
  group: WelcomeScreenSuggestion;
14838
14915
  /** Prompt actually sent to the AI — `item.prompt` falling back to `item.title`. */
@@ -14973,10 +15050,8 @@ declare module "@tiptap/core" {
14973
15050
 
14974
15051
  declare module "@tiptap/core" {
14975
15052
  interface Commands<ReturnType> {
14976
- videoEmbed: {
14977
- setVideoEmbed: (options: {
14978
- src: string;
14979
- }) => ReturnType;
15053
+ transcript: {
15054
+ insertTranscript: (data: TranscriptData) => ReturnType;
14980
15055
  };
14981
15056
  }
14982
15057
  }
@@ -14984,8 +15059,10 @@ declare module "@tiptap/core" {
14984
15059
 
14985
15060
  declare module "@tiptap/core" {
14986
15061
  interface Commands<ReturnType> {
14987
- transcript: {
14988
- insertTranscript: (data: TranscriptData) => ReturnType;
15062
+ videoEmbed: {
15063
+ setVideoEmbed: (options: {
15064
+ src: string;
15065
+ }) => ReturnType;
14989
15066
  };
14990
15067
  }
14991
15068
  }