@epam/ai-dial-chat-shared 1.0.0-rc.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.
Files changed (93) hide show
  1. package/components/DeploymentIcon/DeploymentIcon.d.ts +45 -0
  2. package/components/DeploymentIcon/DeploymentIcon.d.ts.map +1 -0
  3. package/components/Highlight/Highlight.d.ts +26 -0
  4. package/components/Highlight/Highlight.d.ts.map +1 -0
  5. package/components/InitialsAvatar/InitialsAvatar.d.ts +16 -0
  6. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -0
  7. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +50 -0
  8. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -0
  9. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +7 -0
  10. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -0
  11. package/components/MarkdownRenderer/MDMessageViewer.d.ts +31 -0
  12. package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +1 -0
  13. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +112 -0
  14. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -0
  15. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +34 -0
  16. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -0
  17. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +13 -0
  18. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +1 -0
  19. package/components/MarkdownRenderer/markdown-class-names.d.ts +4 -0
  20. package/components/MarkdownRenderer/markdown-class-names.d.ts.map +1 -0
  21. package/components/PanelEmptyState/PanelEmptyState.d.ts +20 -0
  22. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -0
  23. package/constants/dial.d.ts +3 -0
  24. package/constants/dial.d.ts.map +1 -0
  25. package/constants/icon.d.ts +12 -0
  26. package/constants/icon.d.ts.map +1 -0
  27. package/constants/mime-types.d.ts +10 -0
  28. package/constants/mime-types.d.ts.map +1 -0
  29. package/hooks/useCodeCopy.d.ts +14 -0
  30. package/hooks/useCodeCopy.d.ts.map +1 -0
  31. package/hooks/useCollapsedText.d.ts +31 -0
  32. package/hooks/useCollapsedText.d.ts.map +1 -0
  33. package/hooks/useIsMobile.d.ts +3 -0
  34. package/hooks/useIsMobile.d.ts.map +1 -0
  35. package/hooks/useStreamedMarkdownContent.d.ts +3 -0
  36. package/hooks/useStreamedMarkdownContent.d.ts.map +1 -0
  37. package/hooks/useTableScroll.d.ts +16 -0
  38. package/hooks/useTableScroll.d.ts.map +1 -0
  39. package/index.css +2 -0
  40. package/index.d.ts +41 -0
  41. package/index.d.ts.map +1 -0
  42. package/index.js +26490 -0
  43. package/models/annotation.d.ts +78 -0
  44. package/models/annotation.d.ts.map +1 -0
  45. package/models/auth.d.ts +26 -0
  46. package/models/auth.d.ts.map +1 -0
  47. package/models/chat.d.ts +304 -0
  48. package/models/chat.d.ts.map +1 -0
  49. package/models/deployment-configuration.d.ts +61 -0
  50. package/models/deployment-configuration.d.ts.map +1 -0
  51. package/models/deployment-features.d.ts +17 -0
  52. package/models/deployment-features.d.ts.map +1 -0
  53. package/models/deployment.d.ts +31 -0
  54. package/models/deployment.d.ts.map +1 -0
  55. package/models/dial-model.d.ts +19 -0
  56. package/models/dial-model.d.ts.map +1 -0
  57. package/models/import-export.d.ts +23 -0
  58. package/models/import-export.d.ts.map +1 -0
  59. package/models/theme.d.ts +36 -0
  60. package/models/theme.d.ts.map +1 -0
  61. package/package.json +36 -0
  62. package/types/attachment.d.ts +23 -0
  63. package/types/attachment.d.ts.map +1 -0
  64. package/types/code-editor.d.ts +8 -0
  65. package/types/code-editor.d.ts.map +1 -0
  66. package/types/mime-type.d.ts +59 -0
  67. package/types/mime-type.d.ts.map +1 -0
  68. package/types/overlay/overlay-protocol.d.ts +308 -0
  69. package/types/overlay/overlay-protocol.d.ts.map +1 -0
  70. package/utils/avatar-color.d.ts +13 -0
  71. package/utils/avatar-color.d.ts.map +1 -0
  72. package/utils/build-css-vars.d.ts +7 -0
  73. package/utils/build-css-vars.d.ts.map +1 -0
  74. package/utils/copy-to-clipboard.d.ts +15 -0
  75. package/utils/copy-to-clipboard.d.ts.map +1 -0
  76. package/utils/file-download.d.ts +9 -0
  77. package/utils/file-download.d.ts.map +1 -0
  78. package/utils/format-file-size.d.ts +3 -0
  79. package/utils/format-file-size.d.ts.map +1 -0
  80. package/utils/format-last-used.d.ts +8 -0
  81. package/utils/format-last-used.d.ts.map +1 -0
  82. package/utils/initials.d.ts +9 -0
  83. package/utils/initials.d.ts.map +1 -0
  84. package/utils/is-audio-transcription-supported.d.ts +3 -0
  85. package/utils/is-audio-transcription-supported.d.ts.map +1 -0
  86. package/utils/merge-class.d.ts +4 -0
  87. package/utils/merge-class.d.ts.map +1 -0
  88. package/utils/message-attachment-to-display.d.ts +22 -0
  89. package/utils/message-attachment-to-display.d.ts.map +1 -0
  90. package/utils/message.d.ts +10 -0
  91. package/utils/message.d.ts.map +1 -0
  92. package/utils/string-utils.d.ts +5 -0
  93. package/utils/string-utils.d.ts.map +1 -0
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@epam/ai-dial-chat-shared",
3
+ "description": "Shared domain models, utilities, and UI components for AI DIAL Chat libraries",
4
+ "version": "1.0.0-rc.1",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./index.js",
8
+ "module": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ "./package.json": "./package.json",
12
+ ".": {
13
+ "types": "./index.d.ts",
14
+ "import": "./index.js",
15
+ "default": "./index.js"
16
+ }
17
+ },
18
+ "peerDependencies": {
19
+ "react": "^19.2.6",
20
+ "@epam/ai-dial-ui-kit": "0.12.0-dev.36",
21
+ "vitest": "~4.1.0",
22
+ "@tabler/icons-react": "^3.44.0",
23
+ "react-syntax-highlighter": "^16.1.1",
24
+ "react-markdown": "^10.1.0",
25
+ "remark-gfm": "^4.0.1"
26
+ },
27
+ "dependencies": {
28
+ "classnames": "2.5.1",
29
+ "tailwind-merge": "^3.6.0"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/epam/ai-dial-chat.git",
34
+ "directory": "libs/chat-shared"
35
+ }
36
+ }
@@ -0,0 +1,23 @@
1
+ /** Discriminates why an attachment upload failed. Only set when `status === RequestStatus.Error`. */
2
+ export declare enum AttachmentErrorReason {
3
+ /** Upload failed because the device was offline. */
4
+ Network = "network",
5
+ /** File MIME type is not in the deployment's inputAttachmentTypes list. */
6
+ UnsupportedType = "unsupported-type"
7
+ }
8
+ /** Discriminates the kind of content an attachment carries. */
9
+ export declare enum AttachmentType {
10
+ /** Generic file attachment (non-image, non-audio). */
11
+ File = "file",
12
+ /** Raster or vector image. */
13
+ Image = "image",
14
+ /** Audio file that can be played inline. */
15
+ Audio = "audio",
16
+ /** A saved prompt snippet. */
17
+ Prompt = "prompt",
18
+ /** Text pasted directly by the user. */
19
+ Pasted = "pasted",
20
+ /** A link to a file or webpage. */
21
+ Link = "link"
22
+ }
23
+ //# sourceMappingURL=attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/types/attachment.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,oBAAY,qBAAqB;IAC/B,oDAAoD;IACpD,OAAO,YAAY;IACnB,2EAA2E;IAC3E,eAAe,qBAAqB;CACrC;AAED,+DAA+D;AAC/D,oBAAY,cAAc;IACxB,sDAAsD;IACtD,IAAI,SAAS;IACb,8BAA8B;IAC9B,KAAK,UAAU;IACf,4CAA4C;IAC5C,KAAK,UAAU;IACf,8BAA8B;IAC9B,MAAM,WAAW;IACjB,wCAAwC;IACxC,MAAM,WAAW;IACjB,mCAAmC;IACnC,IAAI,SAAS;CACd"}
@@ -0,0 +1,8 @@
1
+ /** Color theme for syntax highlighting. */
2
+ export declare enum CodeBlockTheme {
3
+ /** Dark syntax-highlighting theme. */
4
+ Dark = "dark",
5
+ /** Light syntax-highlighting theme. */
6
+ Light = "light"
7
+ }
8
+ //# sourceMappingURL=code-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-editor.d.ts","sourceRoot":"","sources":["../../src/types/code-editor.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oBAAY,cAAc;IACxB,sCAAsC;IACtC,IAAI,SAAS;IACb,uCAAuC;IACvC,KAAK,UAAU;CAChB"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Well-known MIME type constants used in DIAL API attachments.
3
+ * For arbitrary subtypes, pass a plain `string` alongside this enum.
4
+ */
5
+ export declare enum MIMEType {
6
+ /** GitHub-flavoured Markdown. */
7
+ Markdown = "text/markdown",
8
+ /** Plain unformatted text. */
9
+ Plain = "text/plain",
10
+ /** HTML markup. */
11
+ HTML = "text/html",
12
+ /** XHTML markup. */
13
+ XHTML = "application/xhtml+xml",
14
+ /** Cascading Style Sheets. */
15
+ CSS = "text/css",
16
+ /** JavaScript source. */
17
+ JavaScript = "text/javascript",
18
+ /** TypeScript source (non-standard but widely used). */
19
+ TypeScript = "text/typescript",
20
+ /** CSV spreadsheet data. */
21
+ CSV = "text/csv",
22
+ /** JSON data. */
23
+ JSON = "application/json",
24
+ /** XML document (application type). */
25
+ XML = "application/xml",
26
+ /** PDF document. */
27
+ PDF = "application/pdf",
28
+ /** ZIP archive. */
29
+ ZIP = "application/zip",
30
+ /** GZIP-compressed data. */
31
+ GZIP = "application/gzip",
32
+ /** JPEG raster image. */
33
+ JPEG = "image/jpeg",
34
+ /** PNG raster image. */
35
+ PNG = "image/png",
36
+ /** GIF image. */
37
+ GIF = "image/gif",
38
+ /** WebP image. */
39
+ WebP = "image/webp",
40
+ /** BMP bitmap image. */
41
+ BMP = "image/bmp",
42
+ /** SVG vector image. */
43
+ SVG = "image/svg+xml"
44
+ }
45
+ /**
46
+ * Well-known file extension constants used as fallback when a MIME type is
47
+ * unavailable or unreliable.
48
+ */
49
+ export declare enum FileExtension {
50
+ /** PDF document. */
51
+ PDF = "pdf",
52
+ /** Markdown document (`.md`). */
53
+ Markdown = "md",
54
+ /** Markdown document, alternate extension (`.markdown`). */
55
+ MarkdownAlt = "markdown",
56
+ /** JSON document. */
57
+ JSON = "json"
58
+ }
59
+ //# sourceMappingURL=mime-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mime-type.d.ts","sourceRoot":"","sources":["../../src/types/mime-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,QAAQ;IAElB,iCAAiC;IACjC,QAAQ,kBAAkB;IAC1B,8BAA8B;IAC9B,KAAK,eAAe;IACpB,mBAAmB;IACnB,IAAI,cAAc;IAClB,oBAAoB;IACpB,KAAK,0BAA0B;IAC/B,8BAA8B;IAC9B,GAAG,aAAa;IAChB,yBAAyB;IACzB,UAAU,oBAAoB;IAC9B,wDAAwD;IACxD,UAAU,oBAAoB;IAC9B,4BAA4B;IAC5B,GAAG,aAAa;IAGhB,iBAAiB;IACjB,IAAI,qBAAqB;IACzB,uCAAuC;IACvC,GAAG,oBAAoB;IACvB,oBAAoB;IACpB,GAAG,oBAAoB;IACvB,mBAAmB;IACnB,GAAG,oBAAoB;IACvB,4BAA4B;IAC5B,IAAI,qBAAqB;IAGzB,yBAAyB;IACzB,IAAI,eAAe;IACnB,wBAAwB;IACxB,GAAG,cAAc;IACjB,iBAAiB;IACjB,GAAG,cAAc;IACjB,kBAAkB;IAClB,IAAI,eAAe;IACnB,wBAAwB;IACxB,GAAG,cAAc;IACjB,wBAAwB;IACxB,GAAG,kBAAkB;CACtB;AAED;;;GAGG;AACH,oBAAY,aAAa;IACvB,oBAAoB;IACpB,GAAG,QAAQ;IACX,iCAAiC;IACjC,QAAQ,OAAO;IACf,4DAA4D;IAC5D,WAAW,aAAa;IACxB,qBAAqB;IACrB,IAAI,SAAS;CACd"}
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Namespace prefix shared by every `@DIAL_OVERLAY` postMessage type string
3
+ * exchanged between a `ChatOverlay`/`ChatOverlayManager` host page and an
4
+ * embedded chat app instance.
5
+ */
6
+ export declare const DIAL_OVERLAY_NAMESPACE = "@DIAL_OVERLAY";
7
+ /**
8
+ * Request message types the host (library) can send to the embedded app.
9
+ * Each value is the full wire `type` string sent over `postMessage`.
10
+ */
11
+ export declare enum OverlayRequestType {
12
+ /** Fetch the active conversation's messages. */
13
+ GetMessages = "@DIAL_OVERLAY/GET_MESSAGES",
14
+ /** Send a new message in the active conversation. */
15
+ SendMessage = "@DIAL_OVERLAY/SEND_MESSAGE",
16
+ /** Set the current text content of the message input. */
17
+ SetInputContent = "@DIAL_OVERLAY/SET_INPUT_CONTENT",
18
+ /** Set the active conversation's system prompt. */
19
+ SetSystemPrompt = "@DIAL_OVERLAY/SET_SYSTEM_PROMPT",
20
+ /** Set the active conversation's temperature. */
21
+ SetTemperature = "@DIAL_OVERLAY/SET_TEMPERATURE",
22
+ /** Set host-provided options (theme, model, conversation, host domain). */
23
+ SetOverlayOptions = "@DIAL_OVERLAY/SET_OVERLAY_OPTIONS",
24
+ /** Fetch the current user's conversation list. */
25
+ GetConversations = "@DIAL_OVERLAY/GET_CONVERSATIONS",
26
+ /** Fetch the currently displayed (active) conversation(s). */
27
+ GetSelectedConversations = "@DIAL_OVERLAY/GET_SELECTED_CONVERSATIONS",
28
+ /** Navigate to and load a specific conversation by id. */
29
+ SelectConversation = "@DIAL_OVERLAY/SELECT_CONVERSATION",
30
+ /** Create a new conversation, persisting immediately if a first message is given. */
31
+ CreateConversation = "@DIAL_OVERLAY/CREATE_CONVERSATION",
32
+ /** Open the conversation composer without persisting anything. */
33
+ CreateLocalConversation = "@DIAL_OVERLAY/CREATE_LOCAL_CONVERSATION",
34
+ /** Delete a conversation by id. */
35
+ DeleteConversation = "@DIAL_OVERLAY/DELETE_CONVERSATION",
36
+ /** Rename a conversation by id. */
37
+ RenameConversation = "@DIAL_OVERLAY/RENAME_CONVERSATION"
38
+ }
39
+ /**
40
+ * Event message types the embedded app can send to the host (library),
41
+ * without an accompanying request. Each value is the full wire `type`
42
+ * string sent over `postMessage`.
43
+ */
44
+ export declare enum OverlayEventType {
45
+ /** Sent once, immediately, before any host identity is known. */
46
+ InitReady = "@DIAL_OVERLAY/INIT_READY",
47
+ /** Sent once, after auth/model-load state resolves. */
48
+ Ready = "@DIAL_OVERLAY/READY",
49
+ /** Sent once, after the active conversation has been selected/loaded for the first time. */
50
+ ReadyToInteract = "@DIAL_OVERLAY/READY_TO_INTERACT",
51
+ /** Sent whenever the app finishes loading a conversation (initial load or navigation). */
52
+ SelectedConversationLoaded = "@DIAL_OVERLAY/SELECTED_CONVERSATION_LOADED",
53
+ /** Sent when a generation starts for the active conversation. */
54
+ GptStartGenerating = "@DIAL_OVERLAY/GPT_START_GENERATING",
55
+ /** Sent when a generation completes for the active conversation. */
56
+ GptEndGenerating = "@DIAL_OVERLAY/GPT_END_GENERATING",
57
+ /** Sent when a user (or host) stops an in-flight generation. */
58
+ StopGenerating = "@DIAL_OVERLAY/STOP_GENERATING",
59
+ /** Sent whenever the app's conversation list changes. */
60
+ ConversationsUpdated = "@DIAL_OVERLAY/CONVERSATIONS_UPDATED"
61
+ }
62
+ /**
63
+ * Optional embed-time features a host can opt into via
64
+ * `ChatOverlayOptions.enabledFeatures`.
65
+ */
66
+ export declare enum OverlayFeature {
67
+ /** Enables the `microphone` permission on the iframe's `allow` attribute for voice input. */
68
+ VoiceInput = "voice-input"
69
+ }
70
+ /**
71
+ * Minimal message shape carried in overlay protocol payloads. A narrowed
72
+ * projection of the app's full message model, kept local to this module so
73
+ * the overlay protocol has no dependency on `libs/chat-shared`'s domain models.
74
+ */
75
+ export interface OverlayChatMessage {
76
+ /** Message id. */
77
+ id: string;
78
+ /** Author role, e.g. `'user'`, `'assistant'`, or `'system'`. */
79
+ role: string;
80
+ /** Message text content. */
81
+ content: string;
82
+ }
83
+ /**
84
+ * Host-agnostic projection of a conversation, exposed by the conversation-list
85
+ * methods. Declared independently of `@epam/chat-api-client` or any app-owned
86
+ * type so this module keeps no dependency on generated/app code.
87
+ */
88
+ export interface OverlayConversation {
89
+ /** Conversation id. */
90
+ id: string;
91
+ /** Conversation title. */
92
+ title: string;
93
+ /** Epoch milliseconds of the conversation's last update. */
94
+ updatedAt: number;
95
+ /** Whether the conversation is pinned. */
96
+ isPinned: boolean;
97
+ /** Whether the current user has read-only access. */
98
+ isReadonly: boolean;
99
+ /** Whether the conversation was shared with the current user. */
100
+ sharedWithMe: boolean;
101
+ /** Whether the conversation was published with the current user. */
102
+ publishedWithMe: boolean;
103
+ }
104
+ /**
105
+ * Explicit error signal carried by conversation-list method responses
106
+ * (`SELECT_CONVERSATION`, `CREATE_CONVERSATION`, `DELETE_CONVERSATION`,
107
+ * `RENAME_CONVERSATION`) so invalid ids/values/forbidden actions reject with
108
+ * a clear reason instead of the request silently timing out.
109
+ */
110
+ export interface OverlayConversationError {
111
+ /** `NOT_FOUND` for an unknown/inaccessible id, `FORBIDDEN` for a read-only/shared-without-write-access conversation, `INVALID_ARGUMENT` for a rejected value (e.g. blank rename). */
112
+ code: 'NOT_FOUND' | 'FORBIDDEN' | 'INVALID_ARGUMENT';
113
+ /** Human-readable description of the failure. */
114
+ message: string;
115
+ }
116
+ /**
117
+ * Options a host page passes to `ChatOverlay`'s constructor, and the subset
118
+ * of them re-sent to the embedded app via `SET_OVERLAY_OPTIONS`.
119
+ */
120
+ export interface ChatOverlayOptions {
121
+ /** Full URL of the chat app instance to embed (origin + optional path). */
122
+ domain: string;
123
+ /** Milliseconds to wait for a request's response before rejecting. Defaults to `10000`. */
124
+ requestTimeout?: number;
125
+ /** Inline CSS properties applied to the loader element while it is visible. */
126
+ loaderStyles?: Record<string, string>;
127
+ /** CSS class applied to the loader element. */
128
+ loaderClass?: string;
129
+ /** Custom HTML rendered inside the loader element, replacing the default spinner. */
130
+ loaderInnerHTML?: string;
131
+ /** Event whose receipt hides the loader. Defaults to `OverlayEventType.Ready`. */
132
+ loaderHideEvent?: OverlayEventType;
133
+ /** Embed-time features to enable, e.g. microphone access for voice input. */
134
+ enabledFeatures?: OverlayFeature[];
135
+ /** Theme name applied to the embedded app. */
136
+ theme?: string;
137
+ /** Deployment/model id to select in the embedded app. */
138
+ modelId?: string;
139
+ /** Conversation id the embedded app should load and display. */
140
+ overlayConversationId?: string;
141
+ }
142
+ /** Payload of a `SET_OVERLAY_OPTIONS` request. */
143
+ export interface SetOverlayOptionsPayload {
144
+ /** Origin of the host page, used by the app to target responses/events. */
145
+ hostDomain: string;
146
+ /** Theme name to apply, if provided. */
147
+ theme?: string;
148
+ /** Deployment/model id to select, if provided. */
149
+ modelId?: string;
150
+ /** Conversation id to navigate to and load, if provided. */
151
+ overlayConversationId?: string;
152
+ }
153
+ /** Payload of a `SEND_MESSAGE` request. */
154
+ export interface SendMessagePayload {
155
+ /** Text content of the message to send. */
156
+ content: string;
157
+ }
158
+ /** Payload of a `SET_INPUT_CONTENT` request. */
159
+ export interface SetInputContentPayload {
160
+ /** Text content to set in the message input. */
161
+ content: string;
162
+ }
163
+ /** Payload of a `SET_SYSTEM_PROMPT` request. */
164
+ export interface SetSystemPromptPayload {
165
+ /** System prompt to persist on the active conversation. */
166
+ systemPrompt: string;
167
+ }
168
+ /** Payload of a `SET_TEMPERATURE` request. */
169
+ export interface SetTemperaturePayload {
170
+ /** Temperature value to persist on the active conversation. */
171
+ temperature: number;
172
+ }
173
+ /** Payload of a `SELECT_CONVERSATION` request. */
174
+ export interface SelectConversationPayload {
175
+ /** Id of the conversation to select. */
176
+ id: string;
177
+ }
178
+ /** Payload of a `DELETE_CONVERSATION` request. */
179
+ export interface DeleteConversationPayload {
180
+ /** Id of the conversation to delete. */
181
+ id: string;
182
+ }
183
+ /** Payload of a `RENAME_CONVERSATION` request. */
184
+ export interface RenameConversationPayload {
185
+ /** Id of the conversation to rename. */
186
+ id: string;
187
+ /** New title for the conversation. */
188
+ newName: string;
189
+ }
190
+ /** Payload of a `CREATE_CONVERSATION` request. */
191
+ export interface CreateConversationPayload {
192
+ /** Deployment/model id to create the conversation with, if given. */
193
+ deploymentId?: string;
194
+ /** Initial message to persist immediately. Omitted/blank opens the composer instead. */
195
+ firstMessage?: string;
196
+ }
197
+ /** Response payload of a `GET_MESSAGES` request. */
198
+ export interface GetMessagesResponse {
199
+ /** Messages in the active conversation. */
200
+ messages: OverlayChatMessage[];
201
+ }
202
+ /** Response payload of a `SEND_MESSAGE` request. */
203
+ export interface SendMessageResponse {
204
+ /** Messages in the active conversation after the send. */
205
+ messages: OverlayChatMessage[];
206
+ }
207
+ /** Response payload of a `SET_SYSTEM_PROMPT` request. */
208
+ export interface SetSystemPromptResponse {
209
+ /** System prompt value that was persisted. */
210
+ systemPrompt: string;
211
+ }
212
+ /** Response payload of a `SET_TEMPERATURE` request. */
213
+ export interface SetTemperatureResponse {
214
+ /** Temperature value that was persisted. */
215
+ temperature: number;
216
+ }
217
+ /** Response payload of a `SET_OVERLAY_OPTIONS` request. */
218
+ export interface SetOverlayOptionsResponse {
219
+ /** Whether the supplied options were applied (`false` only signals a fallback, never a thrown error). */
220
+ applied: boolean;
221
+ }
222
+ /** Response payload of a `GET_CONVERSATIONS` request. */
223
+ export interface GetConversationsResponse {
224
+ /** The current user's conversation list. */
225
+ conversations: OverlayConversation[];
226
+ }
227
+ /** Response payload of a `GET_SELECTED_CONVERSATIONS` request. */
228
+ export interface GetSelectedConversationsResponse {
229
+ /** Currently displayed conversation(s); empty when no conversation is mounted. */
230
+ conversations: OverlayConversation[];
231
+ }
232
+ /** Response payload of a `SELECT_CONVERSATION` request. */
233
+ export interface SelectConversationResponse {
234
+ /** The now-selected conversation's projection, present on success. */
235
+ conversation?: OverlayConversation;
236
+ /** Present when the selection failed. */
237
+ error?: OverlayConversationError;
238
+ }
239
+ /** Response payload of a `CREATE_CONVERSATION` request. */
240
+ export interface CreateConversationResponse {
241
+ /** The created conversation's projection, or `null` when the composer path was taken. */
242
+ conversation: OverlayConversation | null;
243
+ /** Present when creation failed. */
244
+ error?: OverlayConversationError;
245
+ }
246
+ /** Response payload of a `CREATE_LOCAL_CONVERSATION` request. */
247
+ export interface CreateLocalConversationResponse {
248
+ /** Always `null` — the composer opens without persisting anything. */
249
+ conversation: null;
250
+ }
251
+ /** Response payload of a `DELETE_CONVERSATION` request. */
252
+ export interface DeleteConversationResponse {
253
+ /** Present when deletion failed. */
254
+ error?: OverlayConversationError;
255
+ }
256
+ /** Response payload of a `RENAME_CONVERSATION` request. */
257
+ export interface RenameConversationResponse {
258
+ /** The renamed conversation's projection, present on success. */
259
+ conversation?: OverlayConversation;
260
+ /** Present when the rename failed. */
261
+ error?: OverlayConversationError;
262
+ }
263
+ /**
264
+ * A request message sent from the host (library) to the embedded app.
265
+ * `type` is always `'${OverlayRequestType}'`.
266
+ */
267
+ export interface OverlayMessageRequest<TPayload = unknown> {
268
+ /** Full wire type string, one of the `OverlayRequestType` values. */
269
+ type: `${OverlayRequestType}`;
270
+ /** Unique id used to match this request to its response. */
271
+ requestId: string;
272
+ /**
273
+ * Epoch milliseconds after which the embedded app must stop waiting for
274
+ * prerequisites (such as an active conversation bridge) and drop the request.
275
+ */
276
+ expiresAt?: number;
277
+ /** Request-specific payload. */
278
+ payload?: TPayload;
279
+ }
280
+ /**
281
+ * A response message sent from the embedded app to the host (library),
282
+ * answering a specific request by `requestId`.
283
+ */
284
+ export interface OverlayMessageResponse<TPayload = unknown> {
285
+ /** Full wire type string, always `'${OverlayRequestType}/RESPONSE'`. */
286
+ type: `${OverlayRequestType}/RESPONSE`;
287
+ /** `requestId` of the request this message answers. */
288
+ requestId: string;
289
+ /** Response-specific payload. */
290
+ payload?: TPayload;
291
+ }
292
+ /**
293
+ * An event message sent from the embedded app to the host (library),
294
+ * with no associated request (no `requestId` field).
295
+ */
296
+ export interface OverlayMessageEvent<TPayload = unknown> {
297
+ /** Full wire type string, one of the `OverlayEventType` values. */
298
+ type: `${OverlayEventType}`;
299
+ /** Event-specific payload. */
300
+ payload?: TPayload;
301
+ }
302
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageRequest`. */
303
+ export declare const isOverlayMessageRequest: (data: unknown) => data is OverlayMessageRequest;
304
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageResponse`. */
305
+ export declare const isOverlayMessageResponse: (data: unknown) => data is OverlayMessageResponse;
306
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageEvent`. */
307
+ export declare const isOverlayMessageEvent: (data: unknown) => data is OverlayMessageEvent;
308
+ //# sourceMappingURL=overlay-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-protocol.d.ts","sourceRoot":"","sources":["../../../src/types/overlay/overlay-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,gDAAgD;IAChD,WAAW,+BAA+B;IAC1C,qDAAqD;IACrD,WAAW,+BAA+B;IAC1C,yDAAyD;IACzD,eAAe,oCAAoC;IACnD,mDAAmD;IACnD,eAAe,oCAAoC;IACnD,iDAAiD;IACjD,cAAc,kCAAkC;IAChD,2EAA2E;IAC3E,iBAAiB,sCAAsC;IACvD,kDAAkD;IAClD,gBAAgB,oCAAoC;IACpD,8DAA8D;IAC9D,wBAAwB,6CAA6C;IACrE,0DAA0D;IAC1D,kBAAkB,sCAAsC;IACxD,qFAAqF;IACrF,kBAAkB,sCAAsC;IACxD,kEAAkE;IAClE,uBAAuB,4CAA4C;IACnE,mCAAmC;IACnC,kBAAkB,sCAAsC;IACxD,mCAAmC;IACnC,kBAAkB,sCAAsC;CACzD;AAED;;;;GAIG;AACH,oBAAY,gBAAgB;IAC1B,iEAAiE;IACjE,SAAS,6BAA6B;IACtC,uDAAuD;IACvD,KAAK,wBAAwB;IAC7B,4FAA4F;IAC5F,eAAe,oCAAoC;IACnD,0FAA0F;IAC1F,0BAA0B,+CAA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initials avatar badge. */
2
+ export interface AvatarColorEntry {
3
+ /** CSS hex colour for the badge background. */
4
+ background: string;
5
+ /** CSS hex colour for the initials text. */
6
+ foreground: string;
7
+ }
8
+ /**
9
+ * Deterministically maps a display name to a palette entry using a
10
+ * char-code-sum hash. The same name always returns the same colours.
11
+ */
12
+ export declare const pickAvatarColor: (name: string) => AvatarColorEntry;
13
+ //# sourceMappingURL=avatar-color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar-color.d.ts","sourceRoot":"","sources":["../../src/utils/avatar-color.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAcD;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,gBAM9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CSSProperties } from 'react';
2
+ /**
3
+ * Builds a `CSSProperties` object from a record mapping CSS custom property
4
+ * names to values. Entries with `undefined` or empty-string values are omitted.
5
+ */
6
+ export declare const buildCssVars: (vars: Record<string, string | number | undefined>) => CSSProperties;
7
+ //# sourceMappingURL=build-css-vars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-css-vars.d.ts","sourceRoot":"","sources":["../../src/utils/build-css-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,KAChD,aAQF,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copies `text` to the clipboard. Returns `true` when the write succeeded,
3
+ * `false` when both paths failed (e.g. sandboxed iframe without clipboard
4
+ * permission).
5
+ *
6
+ * Strategy:
7
+ * 1. Async Clipboard API (`navigator.clipboard.writeText`) — the preferred
8
+ * path on modern browsers. Requires a secure context (HTTPS) and the page
9
+ * to be focused.
10
+ * 2. `execCommand('copy')` fallback — used when the Clipboard API is
11
+ * unavailable (HTTP, older browsers) or rejects. Uses `setSelectionRange`
12
+ * instead of `select()` because iOS Safari ignores `textarea.select()`.
13
+ */
14
+ export declare const copyToClipboard: (text: string) => Promise<boolean>;
15
+ //# sourceMappingURL=copy-to-clipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-to-clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/copy-to-clipboard.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAY7D,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Returns the file extension (without a leading dot) for a fenced-code-block language identifier, defaulting to `txt`. */
2
+ export declare const getFileExtensionForLanguage: (language: string) => string;
3
+ /** Creates a temporary anchor element and clicks it to trigger a browser download for `href`. */
4
+ export declare const triggerAnchorDownload: (href: string, filename: string) => void;
5
+ /** Triggers a browser download of `blob`, using a temporary object URL that is revoked afterward. */
6
+ export declare const triggerBlobDownload: (blob: Blob, filename: string) => void;
7
+ /** Triggers a browser download of `content` as a text file named `filename`. */
8
+ export declare const downloadTextFile: (content: string, filename: string) => void;
9
+ //# sourceMappingURL=file-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-download.d.ts","sourceRoot":"","sources":["../../src/utils/file-download.ts"],"names":[],"mappings":"AAyCA,2HAA2H;AAC3H,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,KAAG,MACT,CAAC;AAEvD,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,IAKtE,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,EAAE,UAAU,MAAM,KAAG,IAIlE,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,IAKpE,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Formats a byte count as a human-readable size string (e.g. `840 KB`, `2.4 MB`). */
2
+ export declare const formatFileSize: (bytes: number) => string;
3
+ //# sourceMappingURL=format-file-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-file-size.d.ts","sourceRoot":"","sources":["../../src/utils/format-file-size.ts"],"names":[],"mappings":"AAIA,sFAAsF;AACtF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAQ9C,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Converts a timestamp to a human-readable "last used" string,
3
+ * e.g. "just now", "5 min ago", "3 hours ago", "2 days ago".
4
+ *
5
+ * Returns an empty string when the input is falsy or not a valid date.
6
+ */
7
+ export declare const formatLastUsed: (timestamp?: number) => string;
8
+ //# sourceMappingURL=format-last-used.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-last-used.d.ts","sourceRoot":"","sources":["../../src/utils/format-last-used.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,KAAG,MA2BnD,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns 1–2 uppercase initials derived from a display name.
3
+ *
4
+ * - Empty/whitespace-only → `"?"`
5
+ * - Two or more words → first letter of each of the first two words (skipping leading punctuation like `[` or `(`)
6
+ * - Single word → first two letter characters of that word
7
+ */
8
+ export declare const extractInitials: (name: string) => string;
9
+ //# sourceMappingURL=initials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initials.d.ts","sourceRoot":"","sources":["../../src/utils/initials.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAa9C,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Returns `true` when `types` contains a wildcard or any audio MIME type; `false` otherwise. */
2
+ export declare const isAudioTranscriptionSupported: (types?: string[]) => boolean;
3
+ //# sourceMappingURL=is-audio-transcription-supported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-audio-transcription-supported.d.ts","sourceRoot":"","sources":["../../src/utils/is-audio-transcription-supported.ts"],"names":[],"mappings":"AAKA,iGAAiG;AACjG,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM,EAAE,KAAG,OAGrD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { default as classNames } from 'classnames';
2
+ /** Merge class names (classnames → tailwind-merge). */
3
+ export declare function mergeClasses(...inputs: Parameters<typeof classNames>): string;
4
+ //# sourceMappingURL=merge-class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-class.d.ts","sourceRoot":"","sources":["../../src/utils/merge-class.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,GAAG,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,MAAM,CAE7E"}
@@ -0,0 +1,22 @@
1
+ import { DisplayAttachment, MessageAttachment } from '../models/chat';
2
+ /**
3
+ * Optional app-owned callbacks used to resolve display URLs for an attachment.
4
+ * When omitted, the mapper falls back to the attachment's own `url` (or a
5
+ * synthesized `data:` URL when only inline base64 `data` is present).
6
+ */
7
+ export interface AttachmentDisplayResolvers {
8
+ /** Resolves the image preview URL for an attachment that has a remote `url`. */
9
+ resolvePreviewUrl?(dto: MessageAttachment): string | undefined;
10
+ /** Resolves the audio playback URL for an attachment that has a remote `url`. */
11
+ resolvePlayUrl?(dto: MessageAttachment): string | undefined;
12
+ }
13
+ /**
14
+ * Maps a {@link MessageAttachment} DTO to the display-only {@link DisplayAttachment}
15
+ * model used by UI components. This is a pure function: any app/host-specific URL
16
+ * resolution (catalog icon URLs, DIAL file download URLs, etc.) is injected through
17
+ * the optional `resolvers` argument rather than performed here.
18
+ */
19
+ export declare const messageAttachmentToDisplayAttachment: (dto: MessageAttachment, resolvers?: AttachmentDisplayResolvers) => DisplayAttachment;
20
+ /** Maps a list of {@link MessageAttachment} DTOs to display-only attachment models. */
21
+ export declare const messageAttachmentsToDisplayAttachments: (dtos: MessageAttachment[] | undefined, resolvers?: AttachmentDisplayResolvers) => DisplayAttachment[];
22
+ //# sourceMappingURL=message-attachment-to-display.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-attachment-to-display.d.ts","sourceRoot":"","sources":["../../src/utils/message-attachment-to-display.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAIxB;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,gFAAgF;IAChF,iBAAiB,CAAC,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,iFAAiF;IACjF,cAAc,CAAC,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7D;AAwCD;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,GAC/C,KAAK,iBAAiB,EACtB,YAAW,0BAA+B,KACzC,iBA6CF,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,sCAAsC,GACjD,MAAM,iBAAiB,EAAE,GAAG,SAAS,EACrC,YAAW,0BAA+B,KACzC,iBAAiB,EAEhB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Message, StatusMessage } from '../models/chat';
2
+ /**
3
+ * Narrows a `Message` to `StatusMessage` when its role is `MessageRole.Status`.
4
+ * The parameter accepts `Message | StatusMessage` because `StatusMessage.custom_content`
5
+ * is not assignable to `Message.custom_content`, so `StatusMessage` cannot be a
6
+ * structural subtype of `Message`. Callers with `Message`-typed values can still pass
7
+ * them directly since `Message` is assignable to the union.
8
+ */
9
+ export declare const isStatusMessage: (msg: Message | StatusMessage) => msg is StatusMessage;
10
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/utils/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,GAAG,aAAa,KAC3B,GAAG,IAAI,aAAgD,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Returns the UTF-8 byte length of `str`. */
2
+ export declare const getUtf8ByteLength: (str: string) => number;
3
+ /** Truncates `str` to at most `maxBytes` UTF-8 bytes without splitting multi-byte characters. */
4
+ export declare const truncateToUtf8Bytes: (str: string, maxBytes: number) => string;
5
+ //# sourceMappingURL=string-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../src/utils/string-utils.ts"],"names":[],"mappings":"AAGA,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,MACpB,CAAC;AAE7B,iGAAiG;AACjG,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,UAAU,MAAM,KAAG,MAanE,CAAC"}