@factorialco/f0-react 2.22.0 → 2.23.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/{F0CanvasPanel-v9tjaOnW.js → F0CanvasPanel-CSOSmTuX.js} +39792 -51692
- package/dist/F0CanvasPanel.css +1 -1
- package/dist/ai.d.ts +143 -126
- package/dist/ai.js +42 -42
- package/dist/experimental.d.ts +69 -22
- package/dist/experimental.js +68 -68
- package/dist/f0.d.ts +143 -126
- package/dist/f0.js +2678 -2678
- package/dist/i18n-provider-defaults.d.ts +11 -11
- package/dist/styles.css +1 -1
- package/dist/useChatHistory-CUWc-i-8.js +17998 -0
- package/dist/useChatHistory.css +1 -0
- package/dist/{useDataCollectionSource-BzwXcIpi.js → useDataCollectionSource-DnYC5D7b.js} +14389 -12769
- package/package.json +1 -6
- package/dist/F0AiTableCard-BzXULBvr.js +0 -9343
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:
|
|
593
|
+
onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
|
|
592
594
|
threadId: string;
|
|
593
595
|
feedback: string;
|
|
594
596
|
}) => void;
|
|
595
|
-
onThumbsDown?: (message:
|
|
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
|
|
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
|
-
|
|
606
|
+
agent?: string;
|
|
604
607
|
/**
|
|
605
|
-
*
|
|
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
|
-
|
|
608
|
-
|
|
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
|
-
|
|
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:
|
|
640
|
+
onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
|
|
631
641
|
threadId: string;
|
|
632
642
|
feedback: string;
|
|
633
643
|
}) => void;
|
|
634
|
-
onThumbsDown?: (message:
|
|
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
|
-
/**
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
/** Set the
|
|
739
|
-
|
|
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:
|
|
772
|
+
onThumbsUp?: (message: F0AIMessage, { threadId, feedback }: {
|
|
809
773
|
threadId: string;
|
|
810
774
|
feedback: string;
|
|
811
775
|
}) => void;
|
|
812
|
-
onThumbsDown?: (message:
|
|
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:
|
|
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
|
|
835
|
+
declare type AIMessage = Message_2;
|
|
880
836
|
|
|
881
837
|
/**
|
|
882
838
|
* Default AI chat translations — derived from the global defaultTranslations
|
|
@@ -5358,7 +5314,7 @@ export declare interface F0AiAvailableFormDefinition<TParams extends Record<stri
|
|
|
5358
5314
|
/**
|
|
5359
5315
|
* @experimental This is an experimental component use it at your own risk
|
|
5360
5316
|
*/
|
|
5361
|
-
export declare const F0AiChat: () => JSX_2.Element | null;
|
|
5317
|
+
export declare const F0AiChat: ({ header: headerProp, messages: messagesProp, input: inputProp, }: F0AiChatProps) => JSX_2.Element | null;
|
|
5362
5318
|
|
|
5363
5319
|
/**
|
|
5364
5320
|
* Headless chat header. Renders a top bar with title (or thread selector),
|
|
@@ -5444,10 +5400,28 @@ export declare type F0AiChatHistoryProps = {
|
|
|
5444
5400
|
onDeleteThread: (id: string) => Promise<void> | void;
|
|
5445
5401
|
};
|
|
5446
5402
|
|
|
5403
|
+
/**
|
|
5404
|
+
* Slot composition for the F0 AI chat shell. F0 ships the shell + UI
|
|
5405
|
+
* primitives; the consumer (factorial in production, the mock runtime
|
|
5406
|
+
* in stories) supplies the connected slot components that wire data
|
|
5407
|
+
* through whatever runtime they choose (CopilotKit, Mastra, mock, …).
|
|
5408
|
+
*
|
|
5409
|
+
* Slots are optional so the shell renders cleanly even when no runtime
|
|
5410
|
+
* is mounted (the chat just stays empty).
|
|
5411
|
+
*/
|
|
5412
|
+
export declare interface F0AiChatProps {
|
|
5413
|
+
/** Header slot rendered at the top of the chat window. */
|
|
5414
|
+
header?: ReactNode;
|
|
5415
|
+
/** Messages slot rendered inside the scrollable area. */
|
|
5416
|
+
messages?: ReactNode;
|
|
5417
|
+
/** Input slot rendered at the bottom (textarea + suggestions + disclaimer). */
|
|
5418
|
+
input?: ReactNode;
|
|
5419
|
+
}
|
|
5420
|
+
|
|
5447
5421
|
/**
|
|
5448
5422
|
* @experimental This is an experimental component use it at your own risk
|
|
5449
5423
|
*/
|
|
5450
|
-
export declare const F0AiChatProvider: ({ enabled, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, credits, employeeCredits, creditWarning, fileAttachments, onThumbsUp, onThumbsDown,
|
|
5424
|
+
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
5425
|
|
|
5452
5426
|
/**
|
|
5453
5427
|
* Headless chat composer.
|
|
@@ -5458,7 +5432,7 @@ export declare const F0AiChatProvider: ({ enabled, initialMessage, welcomeScreen
|
|
|
5458
5432
|
* coupling to `useAiChat()` or CopilotKit — wrappers like F0AiChat
|
|
5459
5433
|
* provide the wiring.
|
|
5460
5434
|
*/
|
|
5461
|
-
export declare const F0AiChatTextArea: ({ onSubmit, onStop, inProgress, onBeforeSubmit, placeholders, creditWarning,
|
|
5435
|
+
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
5436
|
|
|
5463
5437
|
export declare type F0AiChatTextAreaProps = {
|
|
5464
5438
|
ref: RefObject<HTMLDivElement>;
|
|
@@ -5479,10 +5453,13 @@ export declare type F0AiChatTextAreaProps = {
|
|
|
5479
5453
|
/** Credit warning banner shown above the composer. */
|
|
5480
5454
|
creditWarning?: AiChatCreditWarning;
|
|
5481
5455
|
/**
|
|
5482
|
-
*
|
|
5483
|
-
*
|
|
5456
|
+
* Optional ReactNode rendered in place of the input. When present the
|
|
5457
|
+
* composer enters "clarifying" mode: form submission is blocked, the
|
|
5458
|
+
* gradient border activates, and a nav-hint replaces the disclaimer.
|
|
5459
|
+
* The host owns the panel (typically `F0ClarifyingPanel`) and its
|
|
5460
|
+
* state — F0 just renders the slot.
|
|
5484
5461
|
*/
|
|
5485
|
-
|
|
5462
|
+
clarifyingUI?: ReactNode;
|
|
5486
5463
|
/** Pending context shown as a chip; prepended invisibly on submit. */
|
|
5487
5464
|
pendingContext?: PendingContext | null;
|
|
5488
5465
|
/** Called when the user dismisses pending context (or it gets consumed on submit). */
|
|
@@ -5537,16 +5514,16 @@ export declare type F0AiChatTextAreaProps = {
|
|
|
5537
5514
|
/**
|
|
5538
5515
|
* Payload emitted by `F0AiChatTextArea` when the user submits.
|
|
5539
5516
|
*
|
|
5540
|
-
* `text`
|
|
5541
|
-
*
|
|
5542
|
-
*
|
|
5543
|
-
*
|
|
5544
|
-
* the agent.
|
|
5517
|
+
* `text` contains HTML-escaped user-typed text with `<entity-ref>` tags
|
|
5518
|
+
* for @mentions only. The reply quote (if any) and pending context
|
|
5519
|
+
* travel as separate structured fields — the adapter (factorial) owns
|
|
5520
|
+
* the wire encoding when forwarding to the agent.
|
|
5545
5521
|
*/
|
|
5546
5522
|
export declare type F0AiChatTextAreaSubmitPayload = {
|
|
5547
5523
|
text: string;
|
|
5548
5524
|
files: UploadedFile[];
|
|
5549
5525
|
context: PendingContext | null;
|
|
5526
|
+
quote: PendingQuote | null;
|
|
5550
5527
|
};
|
|
5551
5528
|
|
|
5552
5529
|
/**
|
|
@@ -5725,6 +5702,9 @@ export declare class F0AiMask {
|
|
|
5725
5702
|
private render;
|
|
5726
5703
|
}
|
|
5727
5704
|
|
|
5705
|
+
/** Assistant-flavoured `F0Message`. Same shape — alias kept for clarity. */
|
|
5706
|
+
export declare type F0AIMessage = F0Message;
|
|
5707
|
+
|
|
5728
5708
|
export declare const F0AiMessagesContainer: (props: F0AiMessagesContainerProps) => JSX_2.Element;
|
|
5729
5709
|
|
|
5730
5710
|
export declare type F0AiMessagesContainerProps = {
|
|
@@ -5753,7 +5733,7 @@ export declare type F0AiMessagesContainerProps = {
|
|
|
5753
5733
|
/** Called when the user selects text and clicks Reply (user or assistant bubble). */
|
|
5754
5734
|
onReplyQuote?: (text: string) => void;
|
|
5755
5735
|
/** Called when an assistant message finishes generating — for analytics. */
|
|
5756
|
-
onAssistantMessageRendered?: (message:
|
|
5736
|
+
onAssistantMessageRendered?: (message: Message_2) => void;
|
|
5757
5737
|
/** Disables auto-scrollIntoView on new user messages (fullscreen sets false). */
|
|
5758
5738
|
autoScrollUserIntoView?: boolean;
|
|
5759
5739
|
/**
|
|
@@ -6015,11 +5995,11 @@ declare type F0AssistantMessageExtraProps = {
|
|
|
6015
5995
|
* full message list to call CopilotKit's lazy tool renderer; standalone
|
|
6016
5996
|
* consumers can omit it.
|
|
6017
5997
|
*/
|
|
6018
|
-
renderToolCall?: (message:
|
|
5998
|
+
renderToolCall?: (message: Message_2) => ReactNode | null;
|
|
6019
5999
|
/** Called when the user selects text in this message and clicks Reply. */
|
|
6020
6000
|
onReplyQuote?: (text: string) => void;
|
|
6021
6001
|
/** Called once the assistant message has finished generating — for analytics. */
|
|
6022
|
-
onRendered?: (message:
|
|
6002
|
+
onRendered?: (message: Message_2) => void;
|
|
6023
6003
|
/**
|
|
6024
6004
|
* Renders the assistant text content. The connected wrapper provides a
|
|
6025
6005
|
* markdown-aware implementation; standalone consumers can omit it and a
|
|
@@ -8695,6 +8675,24 @@ export declare type F0LinkProps = Omit<ActionLinkProps, "variant" | "href"> & {
|
|
|
8695
8675
|
href?: string;
|
|
8696
8676
|
};
|
|
8697
8677
|
|
|
8678
|
+
export declare type F0Message = {
|
|
8679
|
+
id: string;
|
|
8680
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
8681
|
+
content?: unknown;
|
|
8682
|
+
toolCalls?: F0ToolCall[];
|
|
8683
|
+
toolCallId?: string;
|
|
8684
|
+
createdAt?: string;
|
|
8685
|
+
generativeUI?: () => unknown;
|
|
8686
|
+
rawData?: unknown;
|
|
8687
|
+
/**
|
|
8688
|
+
* Reply quote text attached to the message by the composer. Rendered
|
|
8689
|
+
* as a block above the user bubble. Adapters (factorial / mock) own
|
|
8690
|
+
* the wire encoding; F0 only reads this structured field.
|
|
8691
|
+
*/
|
|
8692
|
+
replyQuote?: string;
|
|
8693
|
+
[key: string]: any;
|
|
8694
|
+
};
|
|
8695
|
+
|
|
8698
8696
|
export declare const F0ModuleCard: ({ moduleName, description, onAction, actionHref, imageSrc, }: F0ModuleCardProps) => JSX_2.Element;
|
|
8699
8697
|
|
|
8700
8698
|
/**
|
|
@@ -9616,6 +9614,21 @@ export declare interface F0TimelineRowTaskProps extends F0TimelineRowBaseProps {
|
|
|
9616
9614
|
otherActions?: F0TimelineRowOtherAction[];
|
|
9617
9615
|
}
|
|
9618
9616
|
|
|
9617
|
+
/**
|
|
9618
|
+
* Loose message shape used inside f0. Mirrors the CopilotKit `Message`
|
|
9619
|
+
* shape so adapters (factorial, mock runtime) can map back and forth
|
|
9620
|
+
* with no field rename, but is owned by f0 — nothing in `src/` imports
|
|
9621
|
+
* from `@copilotkit/*` anymore.
|
|
9622
|
+
*/
|
|
9623
|
+
export declare type F0ToolCall = {
|
|
9624
|
+
id: string;
|
|
9625
|
+
type?: "function";
|
|
9626
|
+
function: {
|
|
9627
|
+
name: string;
|
|
9628
|
+
arguments: string;
|
|
9629
|
+
};
|
|
9630
|
+
};
|
|
9631
|
+
|
|
9619
9632
|
export declare const F0WizardForm: {
|
|
9620
9633
|
<TSchema extends F0FormSchema_2>(props: F0WizardFormSingleSchemaProps<TSchema>): default_2.ReactElement;
|
|
9621
9634
|
<T extends F0PerSectionSchema_2>(props: F0WizardFormPerSectionProps<T>): default_2.ReactElement;
|
|
@@ -9729,11 +9742,11 @@ export declare interface F0ZodType<T extends ZodTypeAny = ZodTypeAny> {
|
|
|
9729
9742
|
|
|
9730
9743
|
export declare type FeedbackConfig = {
|
|
9731
9744
|
threadId: string;
|
|
9732
|
-
onThumbsUp: (msg:
|
|
9745
|
+
onThumbsUp: (msg: AIMessage, ctx: {
|
|
9733
9746
|
threadId: string;
|
|
9734
9747
|
feedback: string;
|
|
9735
9748
|
}) => void;
|
|
9736
|
-
onThumbsDown: (msg:
|
|
9749
|
+
onThumbsDown: (msg: AIMessage, ctx: {
|
|
9737
9750
|
threadId: string;
|
|
9738
9751
|
feedback: string;
|
|
9739
9752
|
}) => void;
|
|
@@ -11114,7 +11127,7 @@ export declare interface Message {
|
|
|
11114
11127
|
* Most fields are optional / wide on purpose — the headless renders
|
|
11115
11128
|
* what it finds and ignores the rest.
|
|
11116
11129
|
*/
|
|
11117
|
-
declare type
|
|
11130
|
+
declare type Message_2 = {
|
|
11118
11131
|
id?: string;
|
|
11119
11132
|
role?: string;
|
|
11120
11133
|
content?: unknown;
|
|
@@ -11128,6 +11141,13 @@ declare type Message_3 = {
|
|
|
11128
11141
|
}>;
|
|
11129
11142
|
generativeUI?: () => unknown;
|
|
11130
11143
|
rawData?: unknown;
|
|
11144
|
+
/**
|
|
11145
|
+
* Reply quote text the composer attached to this (user) message.
|
|
11146
|
+
* Rendered as a block above the bubble. The wire protocol that carries
|
|
11147
|
+
* this is owned by the adapter (factorial) — F0 only consumes the
|
|
11148
|
+
* structured field.
|
|
11149
|
+
*/
|
|
11150
|
+
replyQuote?: string;
|
|
11131
11151
|
[key: string]: any;
|
|
11132
11152
|
};
|
|
11133
11153
|
|
|
@@ -12509,7 +12529,7 @@ declare type RelaxedNumericWithFormatter = Omit<NumericWithFormatter, "numericVa
|
|
|
12509
12529
|
*/
|
|
12510
12530
|
export declare type RenderableTurn = {
|
|
12511
12531
|
/** Messages rendered before the thinking section (typically the user message). */
|
|
12512
|
-
userMessages:
|
|
12532
|
+
userMessages: Message_2[];
|
|
12513
12533
|
/**
|
|
12514
12534
|
* Optional collapsible "thinking" header rendered between user and
|
|
12515
12535
|
* assistant blocks. Titles are pre-parsed upstream.
|
|
@@ -12530,7 +12550,7 @@ export declare type RenderableTurn = {
|
|
|
12530
12550
|
isWriting?: boolean;
|
|
12531
12551
|
};
|
|
12532
12552
|
/** Messages rendered after the thinking section (assistant replies). */
|
|
12533
|
-
assistantMessages:
|
|
12553
|
+
assistantMessages: Message_2[];
|
|
12534
12554
|
/** True while the agent is still producing content for this turn. */
|
|
12535
12555
|
isInProgress: boolean;
|
|
12536
12556
|
/**
|
|
@@ -12549,7 +12569,7 @@ export declare type RenderableTurn = {
|
|
|
12549
12569
|
/** Concatenated assistant content for the copy button. */
|
|
12550
12570
|
content: string;
|
|
12551
12571
|
/** Reference message attached to feedback submissions. */
|
|
12552
|
-
targetMessage:
|
|
12572
|
+
targetMessage: Message_2;
|
|
12553
12573
|
};
|
|
12554
12574
|
};
|
|
12555
12575
|
|
|
@@ -14061,9 +14081,6 @@ declare interface UpsellRequestResponseDialogProps {
|
|
|
14061
14081
|
* is mounted — that case is intentional in `ApplicationFrame`, which
|
|
14062
14082
|
* renders chat-aware components in both the AI-enabled tree and the
|
|
14063
14083
|
* 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
14084
|
*/
|
|
14068
14085
|
export declare function useAiChat(): AiChatProviderReturnValue;
|
|
14069
14086
|
|
|
@@ -14832,7 +14849,7 @@ export declare type WelcomeScreenSuggestionItem = {
|
|
|
14832
14849
|
* analytics layer (e.g. Amplitude) needs to attribute the click: the picked
|
|
14833
14850
|
* sub-item, its parent group, and the resolved prompt that was actually sent.
|
|
14834
14851
|
*/
|
|
14835
|
-
declare type WelcomeSuggestionClickEvent = {
|
|
14852
|
+
export declare type WelcomeSuggestionClickEvent = {
|
|
14836
14853
|
item: WelcomeScreenSuggestionItem;
|
|
14837
14854
|
group: WelcomeScreenSuggestion;
|
|
14838
14855
|
/** Prompt actually sent to the AI — `item.prompt` falling back to `item.title`. */
|
|
@@ -14942,6 +14959,11 @@ declare module "gridstack" {
|
|
|
14942
14959
|
}
|
|
14943
14960
|
|
|
14944
14961
|
|
|
14962
|
+
declare namespace Calendar {
|
|
14963
|
+
var displayName: string;
|
|
14964
|
+
}
|
|
14965
|
+
|
|
14966
|
+
|
|
14945
14967
|
declare module "@tiptap/core" {
|
|
14946
14968
|
interface Commands<ReturnType> {
|
|
14947
14969
|
aiBlock: {
|
|
@@ -14973,10 +14995,8 @@ declare module "@tiptap/core" {
|
|
|
14973
14995
|
|
|
14974
14996
|
declare module "@tiptap/core" {
|
|
14975
14997
|
interface Commands<ReturnType> {
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
src: string;
|
|
14979
|
-
}) => ReturnType;
|
|
14998
|
+
transcript: {
|
|
14999
|
+
insertTranscript: (data: TranscriptData) => ReturnType;
|
|
14980
15000
|
};
|
|
14981
15001
|
}
|
|
14982
15002
|
}
|
|
@@ -14984,18 +15004,15 @@ declare module "@tiptap/core" {
|
|
|
14984
15004
|
|
|
14985
15005
|
declare module "@tiptap/core" {
|
|
14986
15006
|
interface Commands<ReturnType> {
|
|
14987
|
-
|
|
14988
|
-
|
|
15007
|
+
videoEmbed: {
|
|
15008
|
+
setVideoEmbed: (options: {
|
|
15009
|
+
src: string;
|
|
15010
|
+
}) => ReturnType;
|
|
14989
15011
|
};
|
|
14990
15012
|
}
|
|
14991
15013
|
}
|
|
14992
15014
|
|
|
14993
15015
|
|
|
14994
|
-
declare namespace Calendar {
|
|
14995
|
-
var displayName: string;
|
|
14996
|
-
}
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
15016
|
declare namespace F0GraphNodeWrapperInner {
|
|
15000
15017
|
var displayName: string;
|
|
15001
15018
|
}
|