@epam/ai-dial-chat-shared 1.2.0-dev.21 → 1.2.0-dev.217

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.
Files changed (39) hide show
  1. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
  2. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
  3. package/components/MarkdownRenderer/MDMessageViewer.js +23 -17
  4. package/components/MarkdownRenderer/MarkdownRenderer.js +88 -90
  5. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
  6. package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
  7. package/components/MarkdownRenderer/Table/MarkdownTable.js +71 -56
  8. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
  9. package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
  10. package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
  11. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
  12. package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
  13. package/components/TextRefinementField/TextRefinementField.js +86 -0
  14. package/constants/dial.js +2 -2
  15. package/constants/mime-types.js +49 -2
  16. package/constants/public-class-names.js +10 -0
  17. package/constants/resizable-fields.js +2 -2
  18. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +247 -236
  19. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +34 -32
  20. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
  21. package/file-manager/upload-batch.js +2 -2
  22. package/file-manager/upload-queue.js +17 -0
  23. package/file-manager.d.ts +31 -18
  24. package/file-manager.js +4 -3
  25. package/hooks/useTextRefinement.js +66 -0
  26. package/index.css +2 -2
  27. package/index.d.ts +322 -39
  28. package/index.js +60 -56
  29. package/markdown.d.ts +61 -8
  30. package/markdown.js +13 -11
  31. package/package.json +3 -3
  32. package/types/attachment.js +1 -1
  33. package/utils/entity-field-limits.js +4 -0
  34. package/utils/file-download.js +6 -6
  35. package/utils/is-skill-selection-unsupported.js +4 -0
  36. package/utils/latex.js +5 -3
  37. package/utils/merge-class.js +5 -4
  38. package/utils/mime-type.js +10 -6
  39. package/file-manager/UploadProgressModal/UploadProgressModal.js +0 -56
package/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import { IRowNode } from 'ag-grid-community';
20
20
  import { Options } from 'react-markdown';
21
21
  import { ReactNode } from 'react';
22
22
  import { RefObject } from 'react';
23
+ import { TransferQueueLabels } from '@epam/ai-dial-ui-kit';
23
24
 
24
25
  /** A single annotation attached to an assistant message, optionally citing a source document. */
25
26
  export declare interface Annotation {
@@ -70,6 +71,57 @@ export declare interface AnnotationTarget {
70
71
  selector?: AnnotationSelector;
71
72
  }
72
73
 
74
+ /**
75
+ * A single application → grouped visualizer mapping from the
76
+ * `APPLICATION_VISUALIZERS` registry. Field semantics are fixed by
77
+ * already-deployed visualizer applications and operator configurations
78
+ * carried over from legacy Chat 0.x, which is why `contentType` is optional
79
+ * here while `CustomVisualizer.contentType` is required.
80
+ */
81
+ export declare interface ApplicationVisualizer {
82
+ /**
83
+ * The postMessage protocol namespace, NOT a display label. Every message
84
+ * exchanged with the iframe is prefixed `${title}/…`, and the iframe-side
85
+ * visualizer application must be constructed with this identical string
86
+ * as its `appName`. A mismatch is a silent failure — the iframe loads but
87
+ * never receives data. Also used as the inline frame's header text.
88
+ */
89
+ title: string;
90
+ /** Human-readable description of the visualizer. Accepted for operator-configuration parity; not consumed by host logic. */
91
+ description?: string;
92
+ /** Icon URL or identifier for the visualizer. Accepted for operator-configuration parity; not consumed by host logic. */
93
+ icon?: string;
94
+ /**
95
+ * Comma-separated list of MIME types this entry claims (e.g.
96
+ * `'application/vnd.plotly.v1+json'` or
97
+ * `'application/vnd.plotly.v1+json, application/vnd.vega.v5+json'`).
98
+ * Stored verbatim; splitting happens at lookup time. When omitted, the
99
+ * entry claims every attachment that carries a URL.
100
+ */
101
+ contentType?: string;
102
+ /** Absolute HTTP(S) URL of the visualizer iframe. */
103
+ url: string;
104
+ /** Milliseconds to wait for a `send()` request's `/RESPONSE` before rejecting. Defaults to `10000`. Does NOT bound the initial handshake. */
105
+ requestTimeout?: number;
106
+ /** Suggested initial width of the visualizer surface in pixels. Forwarded as-is in `CustomVisualizerDataLayout`. */
107
+ width?: number;
108
+ /** Suggested initial height of the visualizer surface in pixels. Forwarded as-is in `CustomVisualizerDataLayout`, and used by the host to size the inline frame. */
109
+ height?: number;
110
+ /** Suggested height on mobile viewports in pixels. Forwarded as-is in `CustomVisualizerDataLayout`, and used by the host to size the inline frame on mobile. */
111
+ mobileHeight?: number;
112
+ /** Whether the host should pass auth info to the visualizer. Accepted for operator-configuration parity; inert, because 1.0 auth is server-side and the browser holds no access token. */
113
+ passAuthInfo?: boolean;
114
+ /** Whether the host should pass an explicit access token. Accepted for operator-configuration parity; inert, because 1.0 auth is server-side and the browser holds no access token. */
115
+ passExplicitToken?: boolean;
116
+ /** When `true`, the host renders the inline frame without its border, rounded corners, background, and header divider. */
117
+ borderless?: boolean;
118
+ /** When `true`, the host hides the inline frame's header title text; the header actions stay visible. */
119
+ withoutTitle?: boolean;
120
+ }
121
+
122
+ /** The `APPLICATION_VISUALIZERS` registry: application id → grouped visualizer entry. */
123
+ export declare type ApplicationVisualizerRegistry = Record<string, ApplicationVisualizer>;
124
+
73
125
  /** Attachment selected locally by the user before it is sent to the backend. */
74
126
  export declare interface Attachment extends DisplayAttachment {
75
127
  /** The underlying browser `File` object selected by the user. */
@@ -93,7 +145,9 @@ export declare enum AttachmentErrorReason {
93
145
  /** Upload failed because the device was offline. */
94
146
  Network = "network",
95
147
  /** File MIME type is not in the deployment's inputAttachmentTypes list. */
96
- UnsupportedType = "unsupported-type"
148
+ UnsupportedType = "unsupported-type",
149
+ /** File size exceeds the configured maximum attachment size. */
150
+ FileTooLarge = "file-too-large"
97
151
  }
98
152
 
99
153
  /** A file attachment referenced by a citation — same shape as `MessageAttachment` but scoped to annotations. */
@@ -174,6 +228,19 @@ export declare enum CatalogEntityType {
174
228
  Prompt = "PROMPT"
175
229
  }
176
230
 
231
+ export declare const CHAT_SHARED_CLASS: {
232
+ /** The bordered container of a fenced code block. */
233
+ readonly codeBlock: "dial-chat-shared-code-block";
234
+ /** The code block's sticky header, holding the language label and actions. */
235
+ readonly codeBlockHeader: "dial-chat-shared-code-block-header";
236
+ /** The bordered container of a Markdown table. */
237
+ readonly table: "dial-chat-shared-table";
238
+ /** The scrolling box around a Markdown table, which owns its overflow. */
239
+ readonly tableScroll: "dial-chat-shared-table-scroll";
240
+ /** The scrolling box around a display-math block. */
241
+ readonly mathBlock: "dial-chat-shared-math-block";
242
+ };
243
+
177
244
  /** Color theme for syntax highlighting. */
178
245
  export declare enum CodeBlockTheme {
179
246
  /** Dark syntax-highlighting theme. */
@@ -222,6 +289,8 @@ export declare interface Conversation {
222
289
  assistantModelId: string;
223
290
  /** Response format used when rendering messages. */
224
291
  responseFormat?: ResponseFormat;
292
+ /** Open, feature-keyed container for conversation-level view state. This change owns only the `annotations` key; any other key is opaque and preserved as-is. */
293
+ customViewState?: Record<string, unknown>;
225
294
  }
226
295
 
227
296
  /** Metadata returned by the DIAL file/conversation listing API for a single resource node. */
@@ -276,6 +345,8 @@ export declare interface ConversationTransferJob {
276
345
  * {@link ConversationTransferJobStatus.Warning}.
277
346
  */
278
347
  warningCode?: ConversationTransferWarningCode;
348
+ /** Untranslated names of skipped attachments, when available for this warning. */
349
+ warningNames?: string[];
279
350
  }
280
351
 
281
352
  /** Lifecycle status of a queued export/import job. */
@@ -611,7 +682,7 @@ export declare interface DialFileManagerShellLabels {
611
682
  showHiddenFilesLabel: string;
612
683
  /** Label shown when hidden files are currently hidden. */
613
684
  hideHiddenFilesLabel: string;
614
- /** Returns a bulk-selection count label (e.g. "3 selected"). */
685
+ /** Returns the text shown after the selection-count badge; the file manager renders the count itself, so omit it (e.g. "items selected"). */
615
686
  getSelectionLabel: (count: number) => string;
616
687
  /** Label for the "Upload files" action in the New menu. */
617
688
  uploadFilesLabel: string;
@@ -671,12 +742,10 @@ export declare interface DialFileManagerShellLabels {
671
742
  deleteConfirmLabel: string;
672
743
  /** Cancel-button label in the delete confirmation dialog. */
673
744
  deleteCancelLabel: string;
674
- /** Title for the upload progress modal. */
675
- uploadProgressTitle: string;
676
- /** Cancel-button label in the upload progress modal. */
677
- cancelLabel: string;
678
- /** Returns upload progress text (e.g. "3 of 5 uploaded"). */
679
- getUploadProgressText: (done: number, total: number) => string;
745
+ /** Returns the upload queue heading for the number of files in it (e.g. "Uploading 5 files"). */
746
+ getUploadQueueTitle: (count: number) => string;
747
+ /** Translated strings for the upload `TransferQueue`; unset ones fall back to the kit's English defaults. */
748
+ uploadQueueLabels?: Partial<TransferQueueLabels>;
680
749
  /** Empty-state title when a search yields no results. */
681
750
  searchEmptyStateTitle: string;
682
751
  /** Empty-state title for an empty subfolder. */
@@ -687,6 +756,8 @@ export declare interface DialFileManagerShellLabels {
687
756
  emptyStateByTab: Record<DialFileManagerTabs, EmptyStateCopy>;
688
757
  /** Per-tab tree header label. */
689
758
  treeHeaderByTab: Record<DialFileManagerTabs, string>;
759
+ /** Search field placeholder per source tab of the browsed folder; a tab without an entry keeps the file manager's default. */
760
+ searchPlaceholderByTab?: Partial<Record<DialFileManagerTabs, string>>;
690
761
  /** Messages for inline rename validation. */
691
762
  renameValidationMessages: RenameValidationMessages;
692
763
  /** Options for the conflict resolution popup. */
@@ -811,6 +882,15 @@ export declare interface EmptyStateCopy {
811
882
  */
812
883
  export declare const ensureDownloadFilename: (name: string, url: string | undefined, contentType: string | undefined) => string;
813
884
 
885
+ /** Maximum length of an entity's description. */
886
+ export declare const ENTITY_DESCRIPTION_MAX_LENGTH = 2000;
887
+
888
+ /** Maximum length of an entity's instructions (prompt body, system prompt, skill instructions). */
889
+ export declare const ENTITY_INSTRUCTIONS_MAX_LENGTH = 50000;
890
+
891
+ /** Maximum length of an entity's name or display name. */
892
+ export declare const ENTITY_NAME_MAX_LENGTH = 256;
893
+
814
894
  /** Background color per entity type — used for the featured chip surface. */
815
895
  export declare const ENTITY_TYPE_BG_COLOR: Record<CatalogEntityType, string>;
816
896
 
@@ -881,6 +961,9 @@ export declare interface EntityTypeLabelProps {
881
961
  className?: string;
882
962
  }
883
963
 
964
+ /** Whether `value` is longer than `maxLength` characters. */
965
+ export declare const exceedsMaxLength: (value: string, maxLength: number) => boolean;
966
+
884
967
  /** A 1-based cell address on an XLSX sheet. */
885
968
  export declare interface ExcelCellAddress {
886
969
  /** 1-based row number. */
@@ -1005,7 +1088,7 @@ export declare interface FileManagerController {
1005
1088
  onSearchFiles: (folder: string, query: string) => void;
1006
1089
  /** Search: true while a search request is in flight. */
1007
1090
  isSearching: boolean;
1008
- /** Search: flat list of matching files, or null when search is not active. */
1091
+ /** Search: flat, unfiltered recursive listing of the current folder, or null when search is not active. */
1009
1092
  searchResults: DialFile[] | null;
1010
1093
  /** Search: clears results and exits search mode. */
1011
1094
  clearSearchResults: () => void;
@@ -1029,7 +1112,9 @@ export declare interface FileManagerController {
1029
1112
  uploadBatchState: FileUploadBatchState | null;
1030
1113
  /** Upload: abort all in-flight and queued uploads. */
1031
1114
  cancelUpload: () => void;
1032
- /** Upload: dismiss the progress modal after the batch has settled. */
1115
+ /** Upload: abort one queued or in-flight upload by its entry id. */
1116
+ cancelUploadFile: (id: string) => void;
1117
+ /** Upload: empty the upload queue. */
1033
1118
  clearUploadBatch: () => void;
1034
1119
  /** Folder creation: called when user confirms a new folder name. */
1035
1120
  onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
@@ -1091,6 +1176,8 @@ export declare interface FileManagerController {
1091
1176
  onGetInfo: (file: DialFile) => void;
1092
1177
  /** Metadata: resets fileMetadata/isFileMetadataLoading; passed to fileMetadataPopupOptions.clearMetadata. */
1093
1178
  clearMetadata: () => void;
1179
+ /** Source tab of the browsed folder, never `All`; omitted by single-source controllers. */
1180
+ sectionTab?: DialFileManagerTabs;
1094
1181
  }
1095
1182
 
1096
1183
  /**
@@ -1109,11 +1196,11 @@ export declare interface FileManagerSelectableNode {
1109
1196
  contentLength?: number;
1110
1197
  }
1111
1198
 
1112
- /** State of an in-progress or just-settled upload batch, as returned by `useDialFileUploadBatch`. */
1199
+ /** State of the upload queue, as returned by `useDialFileUploadBatch`. */
1113
1200
  export declare interface FileUploadBatchState {
1114
- /** Individual file entries in this batch. */
1201
+ /** Every file uploaded since the queue was last cleared, settled ones included. */
1115
1202
  files: FileUploadEntry[];
1116
- /** Whether the upload progress modal should be visible. */
1203
+ /** Whether the upload queue should be visible. */
1117
1204
  isOpen: boolean;
1118
1205
  }
1119
1206
 
@@ -1176,6 +1263,9 @@ export declare const generateUUID: () => string;
1176
1263
  /** Classifies a MIME type into an `AttachmentType` by prefix (`image/*` / `audio/*`), defaulting to `File`. */
1177
1264
  export declare const getAttachmentTypeFromMime: (mimeType: string | undefined) => AttachmentType;
1178
1265
 
1266
+ /** Lowercases a MIME type and strips its parameters, e.g. `'Application/JSON; charset=utf-8'` -> `'application/json'`. */
1267
+ export declare const getBaseMimeType: (mimeType: string) => string;
1268
+
1179
1269
  /** Returns the file extension (without a leading dot) for a fenced-code-block language identifier, defaulting to `txt`. */
1180
1270
  export declare const getFileExtensionForLanguage: (language: string) => string;
1181
1271
 
@@ -1192,6 +1282,27 @@ export declare const getParentFolderPath: (path: string) => string;
1192
1282
  /** Returns the UTF-8 byte length of `str`. */
1193
1283
  export declare const getUtf8ByteLength: (str: string) => number;
1194
1284
 
1285
+ /** A single attachment handed to a grouped visualizer inside `SEND_GROUPED_VISUALIZE_DATA`. */
1286
+ export declare interface GroupedAttachmentItem {
1287
+ /** Absolute URL of the attachment, resolved by the host before sending. */
1288
+ url: string;
1289
+ /** The attachment's own MIME type. */
1290
+ mimeType: string;
1291
+ /** Presentation layout plus the opaque per-attachment payload. */
1292
+ visualizerData: CustomVisualizerData;
1293
+ }
1294
+
1295
+ /** Payload of a `SEND_GROUPED_VISUALIZE_DATA` request: every claimed attachment plus the shared presentation layout. */
1296
+ export declare interface GroupedAttachmentsData {
1297
+ /** One item per claimed attachment, in the message's attachment order. */
1298
+ attachments: GroupedAttachmentItem[];
1299
+ /** Presentation layout hints shared by every item. */
1300
+ layout: CustomVisualizerDataLayout;
1301
+ }
1302
+
1303
+ /** Whether `value` contains a control character (line break, tab, NUL, …) that a single-line name must not carry. */
1304
+ export declare const hasControlCharacters: (value: string) => boolean;
1305
+
1195
1306
  /** Minimal hast shapes this plugin reads and writes. */
1196
1307
  declare interface HastNode {
1197
1308
  type: string;
@@ -1245,9 +1356,15 @@ export declare const isAudioTranscriptionSupported: (types?: string[]) => boolea
1245
1356
  /** Returns true when any path segment starts with a dot (hidden file or folder). */
1246
1357
  export declare const isHiddenPath: (path: string) => boolean;
1247
1358
 
1359
+ /** Whether a selected skill lacks explicitly confirmed support. */
1360
+ export declare const isSkillSelectionUnsupported: (skillUrl: string | null | undefined, isSkillsSupported: boolean | undefined) => boolean;
1361
+
1248
1362
  /** Returns `true` when `msg` is a `StatusMessage`. */
1249
1363
  export declare const isStatusMessage: (msg: Message | StatusMessage) => msg is StatusMessage;
1250
1364
 
1365
+ /** Returns whether any file in the batch is still queued or uploading. */
1366
+ export declare const isUploadInProgress: (batchState: FileUploadBatchState | null) => boolean;
1367
+
1251
1368
  /** Item title header with optional numeric or string postfix and trailing slot. */
1252
1369
  export declare const ItemHeader: FC<ItemHeaderProps>;
1253
1370
 
@@ -1285,7 +1402,29 @@ export declare interface ItemHeaderProps {
1285
1402
  shouldTruncateTitle?: boolean;
1286
1403
  }
1287
1404
 
1288
- export declare const MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME = "[&_.w-md-editor]:max-h-[var(--resizable-field-max-height,70vh)]";
1405
+ /** A selectable language option for an additional-locale row. */
1406
+ export declare interface LocaleOption {
1407
+ /** Locale code (e.g. `'de'`). */
1408
+ code: string;
1409
+ /** Display label for the option (e.g. `'DE'`). */
1410
+ label: string;
1411
+ }
1412
+
1413
+ /** One additional (non-primary) locale's translation of an entity's name and description. */
1414
+ export declare interface LocalizedTextEntry {
1415
+ /** Stable client-side id for list rendering; not part of the persisted locale map. */
1416
+ id: string;
1417
+ /** Locale code this entry translates into (e.g. `'de'`). */
1418
+ language: string;
1419
+ /** Translated name for this locale. */
1420
+ name: string;
1421
+ /** Translated description for this locale. */
1422
+ description: string;
1423
+ }
1424
+
1425
+ export declare const MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:!h-[var(--resizable-field-max-height,70vh)] [&_.w-md-editor-bar]:hidden";
1426
+
1427
+ export declare const MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:max-h-[var(--resizable-field-max-height,70vh)]";
1289
1428
 
1290
1429
  export declare const MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME = "[&_.wmde-markdown>ol]:list-decimal [&_.wmde-markdown_ul]:list-disc [&_.wmde-markdown_ul_ul]:list-[circle] [&_.wmde-markdown_ul_ul_ul]:list-[square]";
1291
1430
 
@@ -1487,9 +1626,7 @@ export declare interface MarkdownRendererProps {
1487
1626
  export declare const MarkdownTable: FC<MarkdownTableProps>;
1488
1627
 
1489
1628
  export declare interface MarkdownTableActionLabels {
1490
- copyCsvLabel?: string;
1491
- copyTxtLabel?: string;
1492
- copyMarkdownLabel?: string;
1629
+ copyLabel?: string;
1493
1630
  copiedLabel?: string;
1494
1631
  downloadCsvLabel?: string;
1495
1632
  openInCanvasLabel?: string;
@@ -1515,19 +1652,16 @@ export declare interface MarkdownTableColors {
1515
1652
  fade?: string;
1516
1653
  /** Divider color between rows. Defaults to `--stroke-tertiary`. */
1517
1654
  rowDivider?: string;
1518
- /** Background of even-indexed body rows. Defaults to `--bg-layer-base`. */
1519
- rowZebraBackground?: string;
1520
1655
  /** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
1521
1656
  rowHoverBackground?: string;
1522
1657
  }
1523
1658
 
1524
1659
  export declare enum MarkdownTableCopyFormat {
1525
1660
  Csv = "csv",
1526
- Txt = "txt",
1527
1661
  Markdown = "markdown"
1528
1662
  }
1529
1663
 
1530
- /** A table header action rendered as an icon button. */
1664
+ /** A table action rendered as an icon button. */
1531
1665
  export declare interface MarkdownTableHeaderAction {
1532
1666
  /** Stable accessible name and tooltip text. */
1533
1667
  label: string;
@@ -1578,13 +1712,20 @@ export declare interface MarkdownWithPlaceholdersProps {
1578
1712
  headingClassName?: string;
1579
1713
  }
1580
1714
 
1581
- /** Renders assistant message content as formatted markdown. */
1715
+ /** Renders assistant message content as formatted markdown, or as escaped plain text when `isPlainText` is set. */
1582
1716
  export declare const MDMessageViewer: FC<MDMessageViewerProps>;
1583
1717
 
1584
1718
  /** Props for the {@link MDMessageViewer} markdown renderer. */
1585
1719
  declare interface MDMessageViewerProps {
1586
1720
  /** Raw markdown string to render. */
1587
1721
  content: string;
1722
+ /**
1723
+ * Renders `content` verbatim as escaped plain text instead of running the
1724
+ * Markdown pipeline — the conversation's `plain_text` response format.
1725
+ * Markdown-only props (`components`, `urlTransform`, the code-block and
1726
+ * table labels) do not apply while it is set. Defaults to `false`.
1727
+ */
1728
+ isPlainText?: boolean;
1588
1729
  /** Enables gradual reveal for appended streaming content. */
1589
1730
  isStreaming?: boolean;
1590
1731
  /**
@@ -1753,6 +1894,21 @@ export declare interface MessageState {
1753
1894
  tool_execution_history?: ToolExecutionHistoryMessage[];
1754
1895
  }
1755
1896
 
1897
+ /**
1898
+ * Maps non-canonical MIME type spellings to the canonical type they denote.
1899
+ *
1900
+ * Deployments declare their `inputAttachmentTypes` by hand, while DIAL Core
1901
+ * stores the content type a browser or an upload client reported, so the two
1902
+ * sides routinely disagree on which of several equivalent spellings to use for
1903
+ * the same format (`text/json` vs `application/json`). Resolving both through
1904
+ * this map before comparing them keeps a declared type matching the files it
1905
+ * is meant to describe.
1906
+ *
1907
+ * Only aliases for one and the same format belong here — never a pair of
1908
+ * distinct formats that happen to share an extension.
1909
+ */
1910
+ export declare const MIME_TYPE_ALIASES: Record<string, string>;
1911
+
1756
1912
  /** MIME type prefix shared by all audio content types. */
1757
1913
  export declare const MIME_TYPE_AUDIO_PREFIX = "audio/";
1758
1914
 
@@ -1822,6 +1978,14 @@ export declare const MOBILE_MAX_WIDTH_PX: number;
1822
1978
  /** `matchMedia` query matching the mobile/tablet band (up to 1279px). */
1823
1979
  export declare const MOBILE_MEDIA_QUERY = "(max-width: 1279px)";
1824
1980
 
1981
+ /**
1982
+ * Returns the canonical spelling of a MIME type: parameters stripped, lowercased,
1983
+ * and known aliases resolved through `MIME_TYPE_ALIASES` (`'text/json'` ->
1984
+ * `'application/json'`). Wildcards and unrecognized types are returned unchanged
1985
+ * apart from that normalization.
1986
+ */
1987
+ export declare const normalizeMimeType: (mimeType: string) => string;
1988
+
1825
1989
  /**
1826
1990
  * Repairs persisted `html_tag` annotations created by older normalizers that
1827
1991
  * defaulted every non-HTML source to PDF. An explicit, recognized file
@@ -1917,6 +2081,44 @@ export declare interface PdfBBoxSelector {
1917
2081
  /** Returns a deterministic colour-pair for the given display name. */
1918
2082
  export declare const pickAvatarColor: (name: string) => AvatarColorEntry;
1919
2083
 
2084
+ /**
2085
+ * Renders message text as plain text: no Markdown pipeline, no raw HTML, no
2086
+ * syntax highlighting. The text is a React text child, so it is escaped by
2087
+ * construction — a table, a heading, or `**bold**` reaches the reader exactly
2088
+ * as the model emitted it, which is what a conversation's `plain_text`
2089
+ * response format promises.
2090
+ *
2091
+ * Lives beside {@link MarkdownRenderer} because it is the other half of the
2092
+ * same choice: both render an assistant message body, and both are selected
2093
+ * by `MDMessageViewer` from the conversation's response format.
2094
+ */
2095
+ export declare const PlainTextRenderer: FC<PlainTextRendererProps>;
2096
+
2097
+ /** Props for {@link PlainTextRenderer}. */
2098
+ export declare interface PlainTextRendererProps {
2099
+ /** Message text. Rendered verbatim — never parsed as Markdown or HTML. */
2100
+ content: string;
2101
+ /** Classes applied to the renderer root. */
2102
+ containerClassName?: string;
2103
+ /** When true, appended content is revealed gradually for smoother streaming updates. */
2104
+ isStreaming?: boolean;
2105
+ /** Reveal speed used while `isStreaming` is true. Defaults to 120 characters per second. */
2106
+ streamCharactersPerSecond?: number;
2107
+ /**
2108
+ * Typography classes. Only `p` is read — the single paragraph the renderer
2109
+ * emits — so the same object a Markdown message is styled with keeps both
2110
+ * formats on one type scale.
2111
+ */
2112
+ classNames?: Pick<MarkdownRendererClassNames, 'p'>;
2113
+ /**
2114
+ * Label shown with a shimmer animation while `isStreaming` is true and no
2115
+ * content has arrived yet. Defaults to `'Thinking'`.
2116
+ */
2117
+ thinkingLabel?: string;
2118
+ /** Color overrides applied as CSS custom properties. */
2119
+ colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
2120
+ }
2121
+
1920
2122
  /**
1921
2123
  * Selector that targets a character range inside a single shape on one PPTX
1922
2124
  * slide. Confirmed against captured DIAL Core responses: unlike
@@ -1980,6 +2182,9 @@ export declare interface ProviderInfo {
1980
2182
  label: string;
1981
2183
  }
1982
2184
 
2185
+ /** DIAL Core bucket that holds published (organization-wide) resources, readable by every user. */
2186
+ export declare const PUBLIC_BUCKET = "public";
2187
+
1983
2188
  /**
1984
2189
  * Rehype plugin that wraps every `{{name}}` placeholder in a span so it can be
1985
2190
  * styled apart from the surrounding prose. Placeholders inside code are left
@@ -2265,6 +2470,84 @@ export declare interface TextCharacterRangeSelector {
2265
2470
  end: number;
2266
2471
  }
2267
2472
 
2473
+ /** Asynchronous rewriting callback supplied by the consuming host. */
2474
+ export declare type TextRefinementCallback = (value: string, signal: AbortSignal) => Promise<string>;
2475
+
2476
+ /** Label row with Refine/Undo actions and live feedback around one refinable field. */
2477
+ export declare const TextRefinementField: FC<TextRefinementFieldProps>;
2478
+
2479
+ /** Props for `TextRefinementField`. */
2480
+ export declare interface TextRefinementFieldProps {
2481
+ /** When false, renders `children` alone — no label row, actions, or feedback. */
2482
+ isEnabled: boolean;
2483
+ /** Id of the labelled control; also the prefix for the label and error ids. */
2484
+ fieldId: string;
2485
+ /** Visible field label; names the group. */
2486
+ label: string;
2487
+ /** Class applied to the `<label>`, after the kit `Label` defaults. */
2488
+ labelClassName?: string;
2489
+ /** Marks the label as required. */
2490
+ required?: boolean;
2491
+ /** Action, status, and error copy. */
2492
+ labels?: TextRefinementLabels;
2493
+ /** The field's `useTextRefinement` result. */
2494
+ refinement: TextRefinementResult;
2495
+ /** Disables both actions. */
2496
+ disabled: boolean;
2497
+ /** Class applied to the status message and the error message. */
2498
+ feedbackClassName?: string;
2499
+ /** Class applied to the error message, after `feedbackClassName`. */
2500
+ errorClassName?: string;
2501
+ /** The refinable control, whose id must equal `fieldId`. */
2502
+ children: ReactNode;
2503
+ }
2504
+
2505
+ /** Translatable copy for `TextRefinementField`; every key has an English default. */
2506
+ export declare interface TextRefinementLabels {
2507
+ /** Refinement copy. Defaults to 'Refine with AI'. */
2508
+ refineWithAiLabel?: string;
2509
+ /** Refinement copy. Defaults to 'Undo'. */
2510
+ refineUndoLabel?: string;
2511
+ /** Refinement copy. Defaults to 'Could not refine this text. Please try again.'. */
2512
+ refineErrorLabel?: string;
2513
+ /** Refinement copy. Defaults to 'Refining text'. */
2514
+ refinePendingAriaLabel?: string;
2515
+ /** Refinement copy. Defaults to 'Text refined. Undo is available.'. */
2516
+ refineSuccessAriaLabel?: string;
2517
+ /** Refinement copy. Defaults to 'Original text restored.'. */
2518
+ refineUndoAriaLabel?: string;
2519
+ /** Refinement copy. Defaults to 'No changes were needed.'. */
2520
+ refineUnchangedAriaLabel?: string;
2521
+ }
2522
+
2523
+ /** Controls and feedback for a single field. */
2524
+ export declare interface TextRefinementResult {
2525
+ /** Current field-local feedback state. */
2526
+ state: TextRefinementState;
2527
+ /** Whether this field has a request in progress. */
2528
+ isPending: boolean;
2529
+ /** Whether the current value can be refined. */
2530
+ canRefine: boolean;
2531
+ /** Whether an original baseline can be restored. */
2532
+ canUndo: boolean;
2533
+ /** Refines the latest committed value; duplicate activation is ignored. */
2534
+ refine: () => Promise<void>;
2535
+ /** Restores the baseline from before the first successful refinement. */
2536
+ undo: () => void;
2537
+ /** Cancels work and clears feedback and Undo without modifying the value. */
2538
+ reset: () => void;
2539
+ }
2540
+
2541
+ /** Field-local refinement feedback state. */
2542
+ export declare enum TextRefinementState {
2543
+ Idle = "idle",
2544
+ Pending = "pending",
2545
+ Success = "success",
2546
+ Error = "error",
2547
+ Restored = "restored",
2548
+ Unchanged = "unchanged"
2549
+ }
2550
+
2268
2551
  /** A single selectable UI theme. */
2269
2552
  export declare interface Theme {
2270
2553
  /** Unique theme identifier (e.g. `'dark'`, `'light'`). */
@@ -2371,23 +2654,6 @@ export declare interface UploadedAttachmentResult {
2371
2654
  name: string;
2372
2655
  }
2373
2656
 
2374
- /** Modal showing per-file upload progress with a cancel action. */
2375
- export declare const UploadProgressModal: FC<UploadProgressModalProps>;
2376
-
2377
- /** Props for the upload-progress modal. */
2378
- export declare interface UploadProgressModalProps {
2379
- /** Current batch state with per-file entries and open flag. */
2380
- batchState: FileUploadBatchState;
2381
- /** Title shown in the modal header (e.g. "Uploading files"). */
2382
- uploadProgressTitle: string;
2383
- /** Summary text below the title (e.g. "3 of 5 uploaded"). */
2384
- uploadProgressText: string;
2385
- /** Label for the cancel button. */
2386
- cancelLabel: string;
2387
- /** Called when the user clicks Cancel. */
2388
- onCancel: () => void;
2389
- }
2390
-
2391
2657
  /**
2392
2658
  * Writes the height still available below an element into a CSS custom
2393
2659
  * property, so a user-resizable control inside it can be capped at the space
@@ -2502,4 +2768,21 @@ export declare interface UserProfile {
2502
2768
  isAdmin: boolean;
2503
2769
  }
2504
2770
 
2771
+ /** Preserves an author's draft and Undo baseline across asynchronous controlled updates. */
2772
+ export declare const useTextRefinement: (options: UseTextRefinementOptions) => TextRefinementResult;
2773
+
2774
+ /** Controlled value and lifecycle inputs for one refinable field. */
2775
+ export declare interface UseTextRefinementOptions {
2776
+ /** Current controlled field value. */
2777
+ value: string;
2778
+ /** Host rewriting callback. Omission disables refinement and clears its state. */
2779
+ onRefine?: TextRefinementCallback;
2780
+ /** Publishes a successful result or the original Undo baseline. */
2781
+ onChange: (value: string) => void;
2782
+ /** Disables refinement and cancels active work when true. Defaults to false. */
2783
+ disabled?: boolean;
2784
+ /** Draft identity; changing it resets state even when text is equal. */
2785
+ resetKey?: unknown;
2786
+ }
2787
+
2505
2788
  export { }