@factorialco/f0-react 1.482.0 → 2.0.1

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/ai.d.ts CHANGED
@@ -157,6 +157,14 @@ export declare type AiChatProviderProps = {
157
157
  * Provides save/create functions for persisting canvas entities externally.
158
158
  */
159
159
  canvasActions?: CanvasActions;
160
+ /**
161
+ * Canvas entity definitions keyed by `CanvasContent["type"]`. The canvas
162
+ * panel looks up the matching definition when `openCanvas` is called.
163
+ *
164
+ * F0AiChat ships without built-in canvas entities; the host app supplies
165
+ * them here so canvas logic lives in one place.
166
+ */
167
+ canvasEntities?: Record<string, CanvasEntityDefinition>;
160
168
  /**
161
169
  * Available tool hints that the user can activate to provide intent context
162
170
  * to the AI. Renders a selector button next to the send button.
@@ -355,7 +363,7 @@ declare type AiChatProviderReturnValue = {
355
363
  pendingQuote: PendingQuote | null;
356
364
  /** Set the pending quote (pass null to clear). */
357
365
  setPendingQuote: React.Dispatch<React.SetStateAction<PendingQuote | null>>;
358
- } & Pick<AiChatState, "greeting" | "agent" | "disclaimer" | "resizable" | "entityRefs" | "canvasActions" | "toolHints" | "credits" | "creditWarning" | "fileAttachments"> & {
366
+ } & Pick<AiChatState, "greeting" | "agent" | "disclaimer" | "resizable" | "entityRefs" | "canvasActions" | "canvasEntities" | "toolHints" | "credits" | "creditWarning" | "fileAttachments"> & {
359
367
  /** The current canvas content, or null when canvas is closed */
360
368
  canvasContent: CanvasContent | null;
361
369
  /** Open the canvas panel with the given content */
@@ -392,6 +400,7 @@ declare interface AiChatState {
392
400
  VoiceMode?: React.ComponentType;
393
401
  entityRefs?: EntityRefs;
394
402
  canvasActions?: CanvasActions;
403
+ canvasEntities?: Record<string, CanvasEntityDefinition>;
395
404
  toolHints?: AiChatToolHint[];
396
405
  credits?: AiChatCredits;
397
406
  creditWarning?: AiChatCreditWarning;
@@ -859,6 +868,36 @@ export declare type CanvasActions = {
859
868
  dashboard?: DashboardCanvasActions;
860
869
  };
861
870
 
871
+ /**
872
+ * Shared inline card rendered in the AI chat for any canvas entity.
873
+ * Shows a module avatar, title, description, and an Open/Close toggle button.
874
+ * When active, displays a focus ring and the button switches to "Close".
875
+ */
876
+ export declare function CanvasCard({ module: cardModule, title, description, onOpen, showOpenButton, onClose, isActive, children, }: CanvasCardProps): JSX_2.Element;
877
+
878
+ export declare namespace CanvasCard {
879
+ var displayName: string;
880
+ }
881
+
882
+ export declare type CanvasCardProps = {
883
+ /** Module avatar to display (e.g. "analytics", "surveys", "goals") */
884
+ module?: ModuleId;
885
+ /** Primary title */
886
+ title: string;
887
+ /** Secondary description line */
888
+ description: string;
889
+ /** Called when the user clicks the "Open" button */
890
+ onOpen: () => void;
891
+ /** Whether to show the "Open" button */
892
+ showOpenButton?: boolean;
893
+ /** Called when the user clicks the "Close" button (active state) */
894
+ onClose: () => void;
895
+ /** Whether this card's content is currently shown in the canvas */
896
+ isActive: boolean;
897
+ /** Optional content rendered below the card header (e.g. a data preview) */
898
+ children?: React.ReactNode;
899
+ };
900
+
862
901
  /**
863
902
  * Discriminated union for canvas panel content.
864
903
  * Add new entity types to this union as they are implemented.
@@ -972,7 +1011,7 @@ declare interface ChatDashboardColumn {
972
1011
  * Contains fetchSpecs that describe how to obtain data server-side —
973
1012
  * no raw data is included. Fully JSON-serializable.
974
1013
  */
975
- declare interface ChatDashboardConfig {
1014
+ export declare interface ChatDashboardConfig {
976
1015
  /** Dashboard title displayed in the canvas header and chat report card */
977
1016
  title: string;
978
1017
  /**
@@ -1154,7 +1193,7 @@ declare interface ClarifyingOption {
1154
1193
  * Navigation metadata (currentStepIndex, totalSteps) and callbacks live
1155
1194
  * here so the panel component stays a pure view of this state.
1156
1195
  */
1157
- declare interface ClarifyingQuestionState {
1196
+ export declare interface ClarifyingQuestionState {
1158
1197
  /** The current step's data + interaction state */
1159
1198
  currentStep: ClarifyingStepState;
1160
1199
  /** Zero-based index of the current step */
@@ -1188,13 +1227,13 @@ declare interface ClarifyingQuestionState {
1188
1227
  * - "single": only one option can be selected (rendered as radio buttons)
1189
1228
  * - "multiple": multiple options can be selected (rendered as checkboxes)
1190
1229
  */
1191
- declare type ClarifyingSelectionMode = "single" | "multiple";
1230
+ export declare type ClarifyingSelectionMode = "single" | "multiple";
1192
1231
 
1193
1232
  /**
1194
1233
  * Pure data describing a single clarifying question step.
1195
1234
  * This is what the AI backend sends — no UI state or callbacks.
1196
1235
  */
1197
- declare interface ClarifyingStepData {
1236
+ export declare interface ClarifyingStepData {
1198
1237
  /** The question text displayed to the user */
1199
1238
  question: string;
1200
1239
  /** Available options the user can select from */
@@ -1220,6 +1259,10 @@ declare interface ClarifyingStepState extends ClarifyingStepData {
1220
1259
  isCustomAnswerActive: boolean;
1221
1260
  }
1222
1261
 
1262
+ export declare function CloseCanvasButton({ onClick }: {
1263
+ onClick: () => void;
1264
+ }): JSX_2.Element;
1265
+
1223
1266
  declare interface CollectionComputation {
1224
1267
  datasetId: string;
1225
1268
  sortBy?: string;
@@ -1256,7 +1299,7 @@ export declare type CSSRgbString = `rgb(${number}, ${number}, ${number})` | `rgb
1256
1299
  /**
1257
1300
  * Callbacks for persisting dashboards externally (beyond chat history).
1258
1301
  */
1259
- declare type DashboardCanvasActions = {
1302
+ export declare type DashboardCanvasActions = {
1260
1303
  /** Update an existing saved dashboard */
1261
1304
  save: (id: string, category: string, config: ChatDashboardConfig) => Promise<void>;
1262
1305
  /**
@@ -1299,6 +1342,50 @@ export declare type DashboardCanvasContent = CanvasContentBase & {
1299
1342
  savedDashboardUnsaved?: boolean;
1300
1343
  };
1301
1344
 
1345
+ export declare function DashboardCanvasProvider({ content, children, }: {
1346
+ content: DashboardCanvasContent;
1347
+ children: ReactNode;
1348
+ }): ReactNode;
1349
+
1350
+ /**
1351
+ * Dashboard-specific card that wraps CanvasCard with config-store
1352
+ * subscription logic. Re-renders when the user edits and saves
1353
+ * the dashboard layout.
1354
+ *
1355
+ * All saved-dashboard state (id, category, unsaved) is passed through
1356
+ * from the action arguments. The meta store overrides props after
1357
+ * save/create operations so close/re-open preserves the latest state.
1358
+ */
1359
+ export declare function DashboardCard({ config: originalConfig, apiConfig, savedDashboardId: propSavedId, savedDashboardCategory: propSavedCategory, savedDashboardDescription: propSavedDescription, savedDashboardUnsaved: propSavedUnsaved, }: DashboardCardProps): JSX_2.Element;
1360
+
1361
+ export declare namespace DashboardCard {
1362
+ var displayName: string;
1363
+ }
1364
+
1365
+ export declare type DashboardCardProps = {
1366
+ /** The original dashboard config from the agent */
1367
+ config: ChatDashboardConfig;
1368
+ /** API config for server-side dashboard computation */
1369
+ apiConfig: {
1370
+ baseUrl: string;
1371
+ headers: Record<string, string>;
1372
+ runtimeFetch?: typeof fetch;
1373
+ };
1374
+ /** Present when the dashboard is a pre-saved dashboard */
1375
+ savedDashboardId?: string;
1376
+ /** Category of the saved dashboard */
1377
+ savedDashboardCategory?: string;
1378
+ /** Description of the saved dashboard */
1379
+ savedDashboardDescription?: string;
1380
+ /** Whether the dashboard has unsaved changes */
1381
+ savedDashboardUnsaved?: boolean;
1382
+ };
1383
+
1384
+ export declare function DashboardContent({ content, refreshKey: _parentRefreshKey, }: {
1385
+ content: DashboardCanvasContent;
1386
+ refreshKey: number;
1387
+ }): ReactNode;
1388
+
1302
1389
  declare interface DashboardFetchSpec {
1303
1390
  fetch: Array<{
1304
1391
  toolId: string;
@@ -1308,6 +1395,18 @@ declare interface DashboardFetchSpec {
1308
1395
  columnLabels?: Record<string, string>;
1309
1396
  }
1310
1397
 
1398
+ /**
1399
+ * Canvas header for the dashboard entity. Layout, title, status tag,
1400
+ * metadata strip, and the action row (export + close) are all delegated
1401
+ * to `ResourceHeader`. The close button is just another `secondaryAction`
1402
+ * with `hideLabel`, so the shared header component doesn't need to know
1403
+ * about canvas-specific close affordances.
1404
+ */
1405
+ export declare function DashboardHeader({ content, onClose, }: {
1406
+ content: DashboardCanvasContent;
1407
+ onClose: () => void;
1408
+ }): JSX_2.Element;
1409
+
1311
1410
  /**
1312
1411
  * Creator + last-edited metadata for a saved dashboard. Returned by
1313
1412
  * `DashboardCanvasActions.getMetadata` so the header can render the author
@@ -1347,18 +1446,36 @@ declare type DashboardMetadata = {
1347
1446
  /**
1348
1447
  * Data download canvas content — renders a full data table with download options.
1349
1448
  */
1350
- declare type DataDownloadCanvasContent = CanvasContentBase & {
1449
+ export declare type DataDownloadCanvasContent = CanvasContentBase & {
1351
1450
  type: "dataDownload";
1352
1451
  dataset: DataDownloadDataset;
1353
1452
  filename?: string;
1354
1453
  markdown?: string;
1355
1454
  };
1356
1455
 
1456
+ export declare function DataDownloadCard({ title: titleProp, dataset, filename, markdown, }: DataDownloadCardProps): JSX_2.Element;
1457
+
1458
+ export declare namespace DataDownloadCard {
1459
+ var displayName: string;
1460
+ }
1461
+
1462
+ export declare type DataDownloadCardProps = {
1463
+ title?: string;
1464
+ dataset: DataDownloadDataset;
1465
+ filename?: string;
1466
+ markdown?: string;
1467
+ };
1468
+
1469
+ export declare function DataDownloadContent({ content, }: {
1470
+ content: DataDownloadCanvasContent;
1471
+ refreshKey?: number;
1472
+ }): JSX_2.Element;
1473
+
1357
1474
  /**
1358
1475
  * Inline dataset for client-side file generation (Excel / CSV).
1359
1476
  * Sent by the agent with the raw query results.
1360
1477
  */
1361
- declare type DataDownloadDataset = {
1478
+ export declare type DataDownloadDataset = {
1362
1479
  /**
1363
1480
  * Column headers in display order.
1364
1481
  */
@@ -1384,6 +1501,16 @@ declare type DataDownloadDataset = {
1384
1501
  columnLabels?: Record<string, string>;
1385
1502
  };
1386
1503
 
1504
+ export declare function DataDownloadHeader({ content, onClose, }: {
1505
+ content: DataDownloadCanvasContent;
1506
+ onClose: () => void;
1507
+ }): JSX_2.Element;
1508
+
1509
+ export declare function DataDownloadProvider({ content, children, }: {
1510
+ content: DataDownloadCanvasContent;
1511
+ children: ReactNode;
1512
+ }): JSX_2.Element;
1513
+
1387
1514
  declare const DataList: ForwardRefExoticComponent<DataListProps & RefAttributes<HTMLUListElement>> & {
1388
1515
  Item: ForwardRefExoticComponent<ItemProps & RefAttributes<HTMLLIElement>>;
1389
1516
  CompanyItem: ForwardRefExoticComponent<CompanyItemProps & RefAttributes<HTMLLIElement>>;
@@ -2315,7 +2442,7 @@ export declare const F0AiChat: () => JSX_2.Element | null;
2315
2442
  /**
2316
2443
  * @experimental This is an experimental component use it at your own risk
2317
2444
  */
2318
- export declare const F0AiChatProvider: ({ enabled, greeting, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, toolHints, credits, creditWarning, fileAttachments, onThumbsUp, onThumbsDown, onBeforeSendMessage, runtimeFetch, children, agent, tracking, ...copilotKitProps }: AiChatProviderProps) => JSX_2.Element;
2445
+ export declare const F0AiChatProvider: ({ enabled, greeting, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, canvasActions, canvasEntities, toolHints, credits, creditWarning, fileAttachments, onThumbsUp, onThumbsDown, onBeforeSendMessage, runtimeFetch, children, agent, tracking, ...copilotKitProps }: AiChatProviderProps) => JSX_2.Element;
2319
2446
 
2320
2447
  export declare const F0AiChatTextArea: ({ submitLabel, inProgress, onSend, onStop, creditWarning, }: ChatTextareaProps) => JSX_2.Element;
2321
2448
 
@@ -2547,6 +2674,25 @@ declare interface F0IconProps extends SVGProps<SVGSVGElement>, VariantProps<type
2547
2674
  color?: "default" | "currentColor" | `#${string}` | Lowercase<NestedKeyOf<typeof f1Colors.icon>>;
2548
2675
  }
2549
2676
 
2677
+ export declare const F0MessageCreditsWarning: ({ actionHref, }: F0MessageCreditsWarningProps) => JSX_2.Element;
2678
+
2679
+ /**
2680
+ * Args for credits warning copilot action
2681
+ */
2682
+ export declare interface F0MessageCreditsWarningArgs {
2683
+ actionHref?: string;
2684
+ }
2685
+
2686
+ /**
2687
+ * Props for the F0MessageCreditsWarning component
2688
+ */
2689
+ export declare interface F0MessageCreditsWarningProps {
2690
+ /**
2691
+ * Optional URL used by the action button.
2692
+ */
2693
+ actionHref?: string;
2694
+ }
2695
+
2550
2696
  export declare const F0OneIcon: ForwardRefExoticComponent<Omit<F0OneIconProps, "ref"> & RefAttributes<SVGSVGElement>>;
2551
2697
 
2552
2698
  /**
@@ -2681,6 +2827,12 @@ declare interface F0TagStatusProps {
2681
2827
 
2682
2828
  declare const F0TagTeam: WithDataTestIdReturnType<ForwardRefExoticComponent<F0TagTeamProps & RefAttributes<HTMLDivElement>>>;
2683
2829
 
2830
+ declare type FieldMeta = {
2831
+ label: string;
2832
+ fieldType?: string;
2833
+ customFieldName?: string;
2834
+ };
2835
+
2684
2836
  declare type FileAvatarVariant = Extract<AvatarVariant, {
2685
2837
  type: "file";
2686
2838
  }>;
@@ -2713,13 +2865,52 @@ declare type FormatPreset = {
2713
2865
  /**
2714
2866
  * Form canvas content — renders an interactive F0Form in the canvas panel.
2715
2867
  */
2716
- declare type FormCanvasContent = CanvasContentBase & {
2868
+ export declare type FormCanvasContent = CanvasContentBase & {
2717
2869
  type: "form";
2718
2870
  formName: string;
2719
2871
  formDescription?: string;
2720
2872
  formModule?: ModuleId;
2721
2873
  };
2722
2874
 
2875
+ /**
2876
+ * Form-specific card rendered inline in the AI chat stream.
2877
+ * Shows the active form name, description, and an Open/Close button
2878
+ * that opens the form in the canvas panel.
2879
+ * When field data is provided, displays a summary of field labels and values.
2880
+ */
2881
+ export declare function FormCard({ formName, formDescription, module: formModule, cardTitle, cardDescription, fieldDescriptions, formValues, valueFormatter, }: FormCardProps): JSX_2.Element;
2882
+
2883
+ export declare namespace FormCard {
2884
+ var displayName: string;
2885
+ }
2886
+
2887
+ export declare type FormCardProps = {
2888
+ /** Unique name of the form in the registry */
2889
+ formName: string;
2890
+ /** Optional description shown on the card */
2891
+ formDescription?: string;
2892
+ /** Module avatar for the card */
2893
+ module?: ModuleId;
2894
+ /** Custom title override for the card (set by the AI via fillForm) */
2895
+ cardTitle: string;
2896
+ /** Custom description override for the card (set by the AI via fillForm) */
2897
+ cardDescription: string;
2898
+ /** Field label metadata from the form schema */
2899
+ fieldDescriptions?: Record<string, FieldMeta>;
2900
+ /** Current form values */
2901
+ formValues?: Record<string, unknown>;
2902
+ /**
2903
+ * Optional callback to format a field value into a DetailsItemContent.
2904
+ * Return `undefined` to fall back to built-in formatting.
2905
+ */
2906
+ valueFormatter?: FormCardValueFormatter;
2907
+ };
2908
+
2909
+ declare type FormCardValueFormatter = (key: string, value: unknown, meta: {
2910
+ fieldType?: string;
2911
+ customFieldName?: string;
2912
+ }) => DetailsItemContent | DetailsItemContent[] | undefined;
2913
+
2723
2914
  export declare interface FormCardValueFormatterEntry<T = unknown> {
2724
2915
  /** Scope to a specific form. Omit to apply to all forms. */
2725
2916
  formName?: string;
@@ -2737,6 +2928,24 @@ export declare function FormCardValueFormatterProvider({ children, }: {
2737
2928
  children: ReactNode;
2738
2929
  }): JSX_2.Element;
2739
2930
 
2931
+ /**
2932
+ * Canvas panel content for forms.
2933
+ * Propless — reads the active form from coagent shared state
2934
+ * and delegates to VirtualFormContent for rendering.
2935
+ */
2936
+ export declare function FormContent(): ReactNode;
2937
+
2938
+ export declare namespace FormContent {
2939
+ var displayName: string;
2940
+ }
2941
+
2942
+ export declare function FormHeader({ title, description, module, onClose, }: {
2943
+ title: string;
2944
+ description?: string;
2945
+ module?: ModuleId;
2946
+ onClose: () => void;
2947
+ }): JSX_2.Element;
2948
+
2740
2949
  declare interface GaugeComputation {
2741
2950
  datasetId: string;
2742
2951
  aggregation: AggregationType;
@@ -2746,12 +2955,6 @@ declare interface GaugeComputation {
2746
2955
  name?: string;
2747
2956
  }
2748
2957
 
2749
- /**
2750
- * Look up a canvas entity definition by content type.
2751
- * Returns `undefined` if the type is not configured.
2752
- */
2753
- export declare function getCanvasEntity(type: string): CanvasEntityDefinition<any> | undefined;
2754
-
2755
2958
  declare interface HeatmapComputation {
2756
2959
  datasetId: string;
2757
2960
  xAxis: string;
@@ -2817,6 +3020,16 @@ declare type Level = (typeof levels)[number];
2817
3020
 
2818
3021
  declare const levels: readonly ["info", "warning", "critical", "positive"];
2819
3022
 
3023
+ /**
3024
+ * External store for saved (user-edited) dashboard configs.
3025
+ *
3026
+ * This lives outside React's component tree so that `F0ChatReportCard`
3027
+ * (rendered inside CopilotKit's message list) can subscribe to changes
3028
+ * via `useSyncExternalStore` — which works regardless of whether the
3029
+ * React context provider is an ancestor.
3030
+ */
3031
+ declare type Listener = () => void;
3032
+
2820
3033
  export declare type MaskOptions = {
2821
3034
  /**
2822
3035
  * The width of the Mask element.
@@ -2873,6 +3086,18 @@ export declare type MaskOptions = {
2873
3086
  styles?: Partial<CSSStyleDeclaration>;
2874
3087
  };
2875
3088
 
3089
+ export declare const MessageSources: ({ sources }: MessageSourcesProps) => JSX_2.Element | null;
3090
+
3091
+ /**
3092
+ * Props for the F0MessageSources component
3093
+ */
3094
+ export declare type MessageSourcesProps = {
3095
+ /**
3096
+ * Array of sources to display
3097
+ */
3098
+ sources: Source[];
3099
+ };
3100
+
2876
3101
  declare interface MetricComputation {
2877
3102
  datasetId: string;
2878
3103
  aggregation: AggregationType;
@@ -3088,6 +3313,10 @@ export declare type OneIconSize = (typeof oneIconSizes)[number];
3088
3313
 
3089
3314
  export declare const oneIconSizes: readonly ["xs", "sm", "md", "lg"];
3090
3315
 
3316
+ export declare type OrchestratorThinkingResult = {
3317
+ inGroup?: boolean;
3318
+ };
3319
+
3091
3320
  declare type PathsToStringProps<T> = T extends string ? [] : {
3092
3321
  [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>];
3093
3322
  }[Extract<keyof T, string>];
@@ -3202,8 +3431,58 @@ export declare type RequisitionProfile = {
3202
3431
  };
3203
3432
  };
3204
3433
 
3434
+ /**
3435
+ * Snapshot of a resolved step's answer — persisted alongside the tool args
3436
+ * so the render can restore state without re-invoking the panel.
3437
+ */
3438
+ export declare interface ResolvedStepAnswer {
3439
+ /** The question text (matches the source step) */
3440
+ question: string;
3441
+ /** Selected option IDs at submit time */
3442
+ selectedOptionIds: string[];
3443
+ /** Custom free-text answer if provided */
3444
+ customAnswer?: string;
3445
+ /** True when the user explicitly skipped an optional step */
3446
+ skipped?: boolean;
3447
+ /**
3448
+ * True when the user cancelled the flow before reaching this step.
3449
+ * The step was therefore neither answered nor intentionally skipped —
3450
+ * callers (e.g. the agent) should treat this as "no information".
3451
+ */
3452
+ cancelled?: boolean;
3453
+ }
3454
+
3455
+ export declare const savedDashboardConfigStore: {
3456
+ get(toolCallId: string): ChatDashboardConfig | undefined;
3457
+ set(toolCallId: string, config: ChatDashboardConfig): void;
3458
+ subscribe(listener: Listener): () => void;
3459
+ getSnapshot(): number;
3460
+ };
3461
+
3205
3462
  declare type SetFormCardValueFormatter = <T = unknown>(entry: FormCardValueFormatterEntry<T>) => void;
3206
3463
 
3464
+ /**
3465
+ * Source object for message sources
3466
+ */
3467
+ export declare type Source = {
3468
+ /**
3469
+ * Title of the source
3470
+ */
3471
+ title: string;
3472
+ /**
3473
+ * Optional link URL
3474
+ */
3475
+ link?: string;
3476
+ /**
3477
+ * Optional icon name (from @/icons/app)
3478
+ */
3479
+ icon?: string;
3480
+ /**
3481
+ * Whether to open link in new tab
3482
+ */
3483
+ targetBlank?: boolean;
3484
+ };
3485
+
3207
3486
  export declare type SparklineDataPoint = {
3208
3487
  value: number;
3209
3488
  };
@@ -3286,10 +3565,11 @@ export declare function useAiChat(): AiChatProviderReturnValue;
3286
3565
  export declare function useAiChatTranslations(): AiChatTranslations;
3287
3566
 
3288
3567
  /**
3289
- * Hook that invokes every configured copilot action factory.
3290
- * Actions are declared in the `copilotActions` array in `registry.ts`.
3568
+ * Hook returning the canvas entity definition for `type` from the registry
3569
+ * supplied to `F0AiChatProvider.canvasEntities`. Returns `undefined` when no
3570
+ * matching entity is configured.
3291
3571
  */
3292
- export declare function useDefaultCopilotActions(): void;
3572
+ export declare function useCanvasEntity(type: string | undefined): CanvasEntityDefinition<any> | undefined;
3293
3573
 
3294
3574
  /**
3295
3575
  * Returns a resolved formatter for the given `formName`.
@@ -3306,18 +3586,6 @@ export declare function useI18n(): TranslationsType & {
3306
3586
  t: (key: TranslationKey, args?: Record<string, string | number>) => string;
3307
3587
  };
3308
3588
 
3309
- /**
3310
- * Hook to register the message sources action.
3311
- * Attaches information sources to the assistant's response to show where the AI got its information from.
3312
- */
3313
- export declare const useMessageSourcesAction: () => void;
3314
-
3315
- /**
3316
- * Hook to register the orchestrator thinking action.
3317
- * Displays the orchestrator's thinking process as a non-blocking UI element.
3318
- */
3319
- export declare const useOrchestratorThinkingAction: () => void;
3320
-
3321
3589
  /**
3322
3590
  * Returns a setter to register value formatters used by FormCard.
3323
3591
  *
@@ -3339,6 +3607,9 @@ export declare const useOrchestratorThinkingAction: () => void;
3339
3607
  */
3340
3608
  export declare function useSetFormCardValueFormatter(): SetFormCardValueFormatter;
3341
3609
 
3610
+ /** Read the tool call ID injected by AssistantMessage. */
3611
+ export declare const useToolCallId: () => string | undefined;
3612
+
3342
3613
  /**
3343
3614
  * Profile data for a vacancy entity (ATS vacancy/position), resolved asynchronously
3344
3615
  * and displayed in the entity reference hover card.
package/dist/ai.js CHANGED
@@ -1,34 +1,48 @@
1
- import { l as t, k as e, F as r, a as o, C as i, b as n, m as F, n as u, d as A, I as c, g as C, c as m, h, e as l, u as d, j as I, i as f, f as T } from "./F0AiChat-JWFVPdAK.js";
2
- import { defaultTranslations as S } from "./i18n-provider-defaults.js";
3
- import { A as v, e as x, F as P, c as V, d as k, b as O, a as b, f as y, o as M, u as j } from "./types-D7xpTwmC.js";
1
+ import { d as o, l as e, k as r, F as t, a as n, C as i, b as d, m as C, n as F, e as l, h as m, I as u, g as h, c as A, i as D, u as c, j as v, f as I } from "./useDataCollectionSource-DNTWm7Va.js";
2
+ import { defaultTranslations as b } from "./i18n-provider-defaults.js";
3
+ import { A as S, C as T, c as p, D as P, a as w, b as x, e as H, f as M, g as V, h as k, p as j, l as y, m as O, n as q, i as z, F as B, d as E, M as L, k as W, j as G, q as J, o as K, s as N, u as Q } from "./types-1gWIB_Uz.js";
4
4
  export {
5
- v as AiChatTranslationsProvider,
6
- t as ChatSpinner,
7
- e as F0ActionItem,
8
- r as F0AiChat,
9
- o as F0AiChatProvider,
5
+ S as AiChatTranslationsProvider,
6
+ o as CanvasCard,
7
+ e as ChatSpinner,
8
+ T as CloseCanvasButton,
9
+ p as DashboardCanvasProvider,
10
+ P as DashboardCard,
11
+ w as DashboardContent,
12
+ x as DashboardHeader,
13
+ H as DataDownloadCard,
14
+ M as DataDownloadContent,
15
+ V as DataDownloadHeader,
16
+ k as DataDownloadProvider,
17
+ r as F0ActionItem,
18
+ t as F0AiChat,
19
+ n as F0AiChatProvider,
10
20
  i as F0AiChatTextArea,
11
- n as F0AiFullscreenChat,
12
- x as F0AiInsightCard,
13
- P as F0AiMask,
14
- V as F0AuraVoiceAnimation,
15
- k as F0HILActionConfirmation,
16
- F as F0OneIcon,
17
- u as F0OneSwitch,
18
- A as FormCardValueFormatterProvider,
19
- c as I18nProvider,
20
- O as actionItemStatuses,
21
- b as aiTranslations,
22
- y as contentTypes,
23
- S as defaultTranslations,
24
- C as getCanvasEntity,
25
- M as oneIconSizes,
26
- m as useAiChat,
27
- j as useAiChatTranslations,
28
- h as useDefaultCopilotActions,
29
- l as useFormCardValueFormatter,
30
- d as useI18n,
31
- I as useMessageSourcesAction,
32
- f as useOrchestratorThinkingAction,
33
- T as useSetFormCardValueFormatter
21
+ d as F0AiFullscreenChat,
22
+ j as F0AiInsightCard,
23
+ y as F0AiMask,
24
+ O as F0AuraVoiceAnimation,
25
+ q as F0HILActionConfirmation,
26
+ z as F0MessageCreditsWarning,
27
+ C as F0OneIcon,
28
+ F as F0OneSwitch,
29
+ l as FormCard,
30
+ m as FormCardValueFormatterProvider,
31
+ B as FormContent,
32
+ E as FormHeader,
33
+ u as I18nProvider,
34
+ L as MessageSources,
35
+ W as actionItemStatuses,
36
+ G as aiTranslations,
37
+ J as contentTypes,
38
+ b as defaultTranslations,
39
+ K as oneIconSizes,
40
+ N as savedDashboardConfigStore,
41
+ h as useAiChat,
42
+ Q as useAiChatTranslations,
43
+ A as useCanvasEntity,
44
+ D as useFormCardValueFormatter,
45
+ c as useI18n,
46
+ v as useSetFormCardValueFormatter,
47
+ I as useToolCallId
34
48
  };
@@ -522,6 +522,14 @@ declare type AiChatProviderProps = {
522
522
  * Provides save/create functions for persisting canvas entities externally.
523
523
  */
524
524
  canvasActions?: CanvasActions;
525
+ /**
526
+ * Canvas entity definitions keyed by `CanvasContent["type"]`. The canvas
527
+ * panel looks up the matching definition when `openCanvas` is called.
528
+ *
529
+ * F0AiChat ships without built-in canvas entities; the host app supplies
530
+ * them here so canvas logic lives in one place.
531
+ */
532
+ canvasEntities?: Record<string, CanvasEntityDefinition>;
525
533
  /**
526
534
  * Available tool hints that the user can activate to provide intent context
527
535
  * to the AI. Renders a selector button next to the send button.
@@ -1387,6 +1395,57 @@ declare type CanvasActions = {
1387
1395
  dashboard?: DashboardCanvasActions;
1388
1396
  };
1389
1397
 
1398
+ /**
1399
+ * Base shape shared by all canvas content types.
1400
+ * Every entity adds its own fields on top of this.
1401
+ */
1402
+ declare type CanvasContentBase = {
1403
+ type: string;
1404
+ title: string;
1405
+ description?: string;
1406
+ toolCallId?: string;
1407
+ };
1408
+
1409
+ /**
1410
+ * Contract for a canvas entity type.
1411
+ *
1412
+ * Each entity (dashboard, survey, goal, job-posting…) implements this
1413
+ * interface and is added to the `canvasEntities` record in `registry.ts`.
1414
+ *
1415
+ * To add a new entity type:
1416
+ * 1. Create a folder in `canvas/entities/<your-entity>/`
1417
+ * 2. Define a type extending `CanvasContentBase` in `types.ts`
1418
+ * 3. Implement and export `CanvasEntityDefinition` in `index.tsx`
1419
+ * 4. Add the entity to the record in `canvas/registry.ts`
1420
+ */
1421
+ declare type CanvasEntityDefinition<T extends CanvasContentBase = CanvasContentBase> = {
1422
+ /** Must match the `type` discriminant on the content object */
1423
+ type: T["type"];
1424
+ /** Renders the main body of the canvas panel */
1425
+ renderContent: (props: {
1426
+ content: T;
1427
+ refreshKey: number;
1428
+ }) => ReactNode;
1429
+ /** Renders the full header (title, actions, close button) */
1430
+ renderHeader: (props: {
1431
+ content: T;
1432
+ onClose: () => void;
1433
+ }) => ReactNode;
1434
+ /**
1435
+ * Optional wrapper providing entity-scoped context around
1436
+ * both header and body (e.g. shared edit-mode state).
1437
+ */
1438
+ wrapper?: (props: {
1439
+ content: T;
1440
+ children: ReactNode;
1441
+ }) => ReactNode;
1442
+ /**
1443
+ * When true the content area uses `overflow-hidden` instead of
1444
+ * `overflow-auto`, letting the entity manage its own scrolling.
1445
+ */
1446
+ overflowHidden?: boolean;
1447
+ };
1448
+
1390
1449
  declare type CardAvatarVariant = AvatarVariant | {
1391
1450
  type: "emoji";
1392
1451
  emoji: string;