@epam/ai-dial-chat-overlay 1.1.0-dev.44 → 1.1.0-dev.441

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/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export { ChatOverlay } from './lib/ChatOverlay';
1
+ export { ChatOverlay, ChatOverlayRequestError } from './lib/ChatOverlay';
2
2
  export { ChatOverlayManager, OverlayPosition } from './lib/ChatOverlayManager';
3
3
  export type { ChatOverlayManagerOptions } from './lib/ChatOverlayManager';
4
- export type { ChatOverlayOptions, CreateConversationPayload, CreateConversationResponse, CreateLocalConversationResponse, DeleteConversationPayload, DeleteConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, OverlayChatMessage, OverlayConversation, OverlayConversationError, RenameConversationPayload, RenameConversationResponse, SelectConversationPayload, SelectConversationResponse, SendMessageResponse, SetOverlayOptionsResponse, SetSystemPromptResponse, SetTemperatureResponse, } from '@epam/ai-dial-chat-shared';
5
- export { OverlayEventType, OverlayFeature, OverlayRequestType, } from '@epam/ai-dial-chat-shared';
4
+ export * from './protocol';
6
5
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC/E,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,YAAY,EACV,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC/E,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,cAAc,YAAY,CAAC"}
package/index.js CHANGED
@@ -1,6 +1,31 @@
1
- import { OverlayEventType as e, OverlayEventType as t, OverlayFeature as n, OverlayFeature as r, OverlayRequestType as i, OverlayRequestType as a, isOverlayMessageEvent as o, isOverlayMessageResponse as s } from "@epam/ai-dial-chat-shared";
2
- //#region src/lib/internal/default-loader.ts
3
- var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentation\" aria-hidden=\"true\"><circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-dasharray=\"31.4 31.4\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"1s\" repeatCount=\"indefinite\" /></circle></svg>", l = 0, u = () => (l += 1, `dial-overlay-${Date.now()}-${l}`), d = class {
1
+ //#region src/protocol/overlay-protocol.ts
2
+ var e = "@DIAL_OVERLAY", t = /* @__PURE__ */ function(e) {
3
+ return e.GetMessages = "@DIAL_OVERLAY/GET_MESSAGES", e.SendMessage = "@DIAL_OVERLAY/SEND_MESSAGE", e.SetInputContent = "@DIAL_OVERLAY/SET_INPUT_CONTENT", e.SetSystemPrompt = "@DIAL_OVERLAY/SET_SYSTEM_PROMPT", e.SetTemperature = "@DIAL_OVERLAY/SET_TEMPERATURE", e.SetOverlayOptions = "@DIAL_OVERLAY/SET_OVERLAY_OPTIONS", e.GetConversations = "@DIAL_OVERLAY/GET_CONVERSATIONS", e.GetSelectedConversations = "@DIAL_OVERLAY/GET_SELECTED_CONVERSATIONS", e.SelectConversation = "@DIAL_OVERLAY/SELECT_CONVERSATION", e.CreateConversation = "@DIAL_OVERLAY/CREATE_CONVERSATION", e.CreateLocalConversation = "@DIAL_OVERLAY/CREATE_LOCAL_CONVERSATION", e.DeleteConversation = "@DIAL_OVERLAY/DELETE_CONVERSATION", e.RenameConversation = "@DIAL_OVERLAY/RENAME_CONVERSATION", e;
4
+ }({}), n = /* @__PURE__ */ function(e) {
5
+ return e.InitReady = "@DIAL_OVERLAY/INIT_READY", e.Ready = "@DIAL_OVERLAY/READY", e.ReadyToInteract = "@DIAL_OVERLAY/READY_TO_INTERACT", e.SelectedConversationLoaded = "@DIAL_OVERLAY/SELECTED_CONVERSATION_LOADED", e.GptStartGenerating = "@DIAL_OVERLAY/GPT_START_GENERATING", e.GptEndGenerating = "@DIAL_OVERLAY/GPT_END_GENERATING", e.StopGenerating = "@DIAL_OVERLAY/STOP_GENERATING", e.ConversationsUpdated = "@DIAL_OVERLAY/CONVERSATIONS_UPDATED", e;
6
+ }({}), r = /* @__PURE__ */ function(e) {
7
+ return e.CodeApps = "code-apps", e.SchemaApps = "schema-apps", e.HideCustomAppCreation = "hide-custom-app-creation", e.DisabledSend = "disabled-send", e.SkipFocusChatInputOnload = "skip-focus-chat-input-onload", e.ChatSettings = "chat-settings", e.RemovableTools = "removable-tools", e.DislikeComment = "dislike-comment", e.InputFiles = "input-files", e.Likes = "likes", e.LiveChatInteraction = "live-chat-interaction", e.DisallowChangeAgent = "disallow-change-agent", e.HideChangeAgent = "hide-change-agent", e.HideNewConversation = "hide-new-conversation", e.EmptyChatSettings = "empty-chat-settings", e.HideEmptyChatChangeAgent = "hide-empty-chat-change-agent", e.AttachmentsManager = "attachments-manager", e.ConversationsPanelToggle = "conversations-panel-toggle", e.ConversationsSection = "conversations-section", e.Header = "header", e.HideNavigationMenu = "hide-navigation-menu", e.ShowConversationsSectionByDefault = "showConversationsSectionByDefault", e.HideConversationsFilter = "hide-conversations-filter", e.Catalog = "catalog", e.CatalogHideMyApps = "catalog-hide-my-apps", e.CatalogTableView = "catalog-table-view", e.FileManager = "file-manager", e.HideDeleteUserMessage = "hide-delete-user-message", e.HideEditUserMessage = "hide-edit-user-message", e.HideRegenerateAssistantMessage = "hide-regenerate-assistant-message", e.ConversationsPublishing = "conversations-publishing", e.ApplicationsSharing = "applications-sharing", e.ConversationsSharing = "conversations-sharing", e.ToolsetsSharing = "toolsets-sharing", e.Toolsets = "toolsets", e.Prompts = "prompts", e.Skills = "skills", e.CustomApps = "custom-apps", e.HideUserMenu = "hide-user-menu", e.HideUserSettings = "hide-user-settings", e.HideKeyboardShortcuts = "hide-keyboard-shortcuts", e.VoiceInput = "voice-input", e;
8
+ }({}), i = { "custom-applications": "schema-apps" }, a = new Set(Object.values(r)), o = (e) => a.has(e) ? e : i[e], s = /* @__PURE__ */ function(e) {
9
+ return e.External = "external", e.SameWindow = "sameWindow", e;
10
+ }({}), c = /* @__PURE__ */ function(e) {
11
+ return e.ActiveConversationUnavailable = "ACTIVE_CONVERSATION_UNAVAILABLE", e.ConversationListUnavailable = "CONVERSATION_LIST_UNAVAILABLE", e.InvalidPayload = "INVALID_PAYLOAD", e.RequestExecutionFailed = "REQUEST_EXECUTION_FAILED", e;
12
+ }({}), l = (e) => {
13
+ if (typeof e != "object" || !e) return !1;
14
+ let n = e;
15
+ return typeof n.type == "string" && Object.values(t).includes(n.type) && typeof n.requestId == "string" && (!("expiresAt" in n) || typeof n.expiresAt == "number" && Number.isFinite(n.expiresAt));
16
+ }, u = (e) => {
17
+ if (typeof e != "object" || !e) return !1;
18
+ let n = e;
19
+ if (typeof n.type != "string" || typeof n.requestId != "string" || !Object.values(t).some((e) => n.type === `${e}/RESPONSE`)) return !1;
20
+ if (!("error" in n)) return !0;
21
+ let r = n.error;
22
+ return typeof r == "object" && !!r && typeof r.code == "string" && Object.values(c).includes(r.code) && typeof r.message == "string";
23
+ }, d = (e) => {
24
+ if (typeof e != "object" || !e) return !1;
25
+ let t = e;
26
+ return typeof t.type == "string" && Object.values(n).includes(t.type) && !("requestId" in t);
27
+ }, f = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentation\" aria-hidden=\"true\"><circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-dasharray=\"31.4 31.4\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"1s\" repeatCount=\"indefinite\" /></circle></svg>", p = 0, m = () => (p += 1, `dial-overlay-${Date.now()}-${p}`), h = class {
28
+ requestType;
4
29
  requestId;
5
30
  responseType;
6
31
  promise;
@@ -9,7 +34,7 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
9
34
  settled = !1;
10
35
  timeoutHandle;
11
36
  constructor(e, t) {
12
- this.requestId = u(), this.responseType = `${e}/RESPONSE`, this.promise = new Promise((e, t) => {
37
+ this.requestType = e, this.requestId = m(), this.responseType = `${e}/RESPONSE`, this.promise = new Promise((e, t) => {
13
38
  this.resolveFn = e, this.rejectFn = t;
14
39
  }), this.timeoutHandle = setTimeout(() => {
15
40
  this.reject(/* @__PURE__ */ Error(`ChatOverlay: request "${e}" timed out after ${t}ms`));
@@ -24,9 +49,17 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
24
49
  reject(e) {
25
50
  this.settled || (this.settled = !0, clearTimeout(this.timeoutHandle), this.rejectFn(e));
26
51
  }
27
- }, f = (e, t) => {
52
+ }, g = (e, t) => {
28
53
  Object.assign(e.style, t);
29
- }, p = class {
54
+ }, _ = (e, t) => {
55
+ if (document.getElementById(e)) return;
56
+ let n = document.createElement("style");
57
+ n.id = e, n.textContent = t, document.head.appendChild(n);
58
+ }, v = "dial-overlay-styles", y = /* @__PURE__ */ function(e) {
59
+ return e.Root = "dial-overlay-root", e.Iframe = "dial-overlay-iframe", e.Loader = "dial-overlay-loader", e.LoaderHidden = "dial-overlay-loader--hidden", e;
60
+ }({}), b = "\n.dial-overlay-root {\n position: relative;\n}\n.dial-overlay-iframe {\n display: block;\n width: 100%;\n height: 100%;\n border: none;\n}\n.dial-overlay-loader {\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n background: var(--dial-overlay-loader-background, #ffffff);\n color: var(--dial-overlay-loader-color, #2764d9);\n}\n.dial-overlay-loader--hidden {\n display: none !important;\n}\n", x = () => {
61
+ _(v, b);
62
+ }, S = class {
30
63
  promise;
31
64
  resolveFn;
32
65
  rejectFn;
@@ -42,41 +75,32 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
42
75
  reject(e) {
43
76
  this.settled || (this.settled = !0, this.rejectFn(e));
44
77
  }
45
- }, m = 1e4, h = "data-dial-overlay-loader", g = (e) => {
78
+ }, C = 1e4, w = "data-dial-overlay-loader", T = class extends Error {
79
+ code;
80
+ requestType;
81
+ constructor(e, t) {
82
+ super(`ChatOverlay: request "${e}" failed [${t.code}]: ${t.message}`), this.name = "ChatOverlayRequestError", this.code = t.code, this.requestType = e;
83
+ }
84
+ }, E = (e) => {
46
85
  if (typeof e != "string") return e;
47
86
  let t = document.querySelector(e);
48
87
  if (!t) throw Error(`ChatOverlay: no element matches selector "${e}"`);
49
88
  return t;
50
- }, _ = (e) => {
89
+ }, D = (e) => {
51
90
  let t = document.createElement("iframe");
52
91
  t.src = e.domain, t.name = "overlay", t.setAttribute("aria-label", "DIAL Chat"), t.setAttribute("sandbox", "allow-same-origin allow-scripts allow-modals allow-forms allow-popups allow-downloads allow-popups-to-escape-sandbox");
53
92
  let n = ["clipboard-write"];
54
- return e.enabledFeatures?.includes(r.VoiceInput) && n.push("microphone"), t.setAttribute("allow", n.join("; ")), f(t, {
55
- border: "none",
56
- display: "block",
57
- width: "100%",
58
- height: "100%"
59
- }), t;
60
- }, v = (e) => {
93
+ return e.enabledFeatures?.includes(r.VoiceInput) && n.push("microphone"), t.setAttribute("allow", n.join("; ")), t.className = y.Iframe, t;
94
+ }, O = (e) => {
61
95
  let t = document.createElement("div");
62
- return t.setAttribute(h, ""), t.innerHTML = e.loaderInnerHTML ?? c, f(t, {
63
- position: "absolute",
64
- inset: "0",
65
- zIndex: "2",
66
- display: "flex",
67
- alignItems: "center",
68
- justifyContent: "center",
69
- boxSizing: "border-box",
70
- background: "#ffffff",
71
- color: "#2764d9"
72
- }), e.loaderClass && (t.className = e.loaderClass), e.loaderStyles && f(t, e.loaderStyles), t;
73
- }, y = class {
96
+ return t.setAttribute(w, ""), t.innerHTML = e.loaderInnerHTML ?? f, t.className = [y.Loader, e.loaderClass].filter(Boolean).join(" "), e.loaderStyles && g(t, e.loaderStyles), t;
97
+ }, k = class {
74
98
  root;
75
99
  iframe;
76
100
  loader;
77
101
  options;
78
102
  targetOrigin;
79
- readyGate = new p();
103
+ readyGate = new S();
80
104
  pendingRequests = /* @__PURE__ */ new Map();
81
105
  eventSubscribers = /* @__PURE__ */ new Map();
82
106
  messageListener = (e) => {
@@ -84,62 +108,62 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
84
108
  };
85
109
  isDestroyed = !1;
86
110
  constructor(e, t) {
87
- this.root = g(e), this.options = { ...t }, this.targetOrigin = new URL(t.domain).origin, this.iframe = _(this.options), this.loader = v(this.options);
111
+ this.root = E(e), this.options = { ...t }, this.targetOrigin = new URL(t.domain).origin, x(), this.iframe = D(this.options), this.loader = O(this.options);
88
112
  let n = window.getComputedStyle(this.root).position;
89
- (n === "static" || n === "") && f(this.root, { position: "relative" }), this.root.appendChild(this.loader), this.root.appendChild(this.iframe), window.addEventListener("message", this.messageListener), this.readyGate.promise.catch(() => void 0);
113
+ (n === "static" || n === "") && this.root.classList.add(y.Root), this.root.appendChild(this.loader), this.root.appendChild(this.iframe), window.addEventListener("message", this.messageListener), this.readyGate.promise.catch(() => void 0);
90
114
  }
91
115
  ready() {
92
116
  return this.readyGate.promise;
93
117
  }
94
118
  getMessages() {
95
- return this.send(a.GetMessages);
119
+ return this.send(t.GetMessages);
96
120
  }
97
121
  sendMessage(e) {
98
- let t = { content: e };
99
- return this.send(a.SendMessage, t);
122
+ let n = { content: e };
123
+ return this.send(t.SendMessage, n);
100
124
  }
101
125
  setInputContent(e) {
102
- let t = { content: e };
103
- return this.send(a.SetInputContent, t);
126
+ let n = { content: e };
127
+ return this.send(t.SetInputContent, n);
104
128
  }
105
129
  setSystemPrompt(e) {
106
- let t = { systemPrompt: e };
107
- return this.send(a.SetSystemPrompt, t);
130
+ let n = { systemPrompt: e };
131
+ return this.send(t.SetSystemPrompt, n);
108
132
  }
109
133
  setTemperature(e) {
110
- let t = { temperature: e };
111
- return this.send(a.SetTemperature, t);
134
+ let n = { temperature: e };
135
+ return this.send(t.SetTemperature, n);
112
136
  }
113
137
  getConversations() {
114
- return this.send(a.GetConversations);
138
+ return this.send(t.GetConversations);
115
139
  }
116
140
  getSelectedConversations() {
117
- return this.send(a.GetSelectedConversations);
141
+ return this.send(t.GetSelectedConversations);
118
142
  }
119
143
  selectConversation(e) {
120
- let t = { id: e };
121
- return this.send(a.SelectConversation, t);
144
+ let n = { id: e };
145
+ return this.send(t.SelectConversation, n);
122
146
  }
123
147
  createConversation(e) {
124
- let t = { ...e };
125
- return this.send(a.CreateConversation, t);
148
+ let n = { ...e };
149
+ return this.send(t.CreateConversation, n);
126
150
  }
127
151
  createLocalConversation() {
128
- return this.send(a.CreateLocalConversation);
152
+ return this.send(t.CreateLocalConversation);
129
153
  }
130
154
  deleteConversation(e) {
131
- let t = { id: e };
132
- return this.send(a.DeleteConversation, t);
155
+ let n = { id: e };
156
+ return this.send(t.DeleteConversation, n);
133
157
  }
134
- renameConversation(e, t) {
135
- let n = {
158
+ renameConversation(e, n) {
159
+ let r = {
136
160
  id: e,
137
- newName: t
161
+ newName: n
138
162
  };
139
- return this.send(a.RenameConversation, n);
163
+ return this.send(t.RenameConversation, r);
140
164
  }
141
165
  setOverlayOptions(e) {
142
- return this.options.theme = e.theme ?? this.options.theme, this.options.modelId = e.modelId ?? this.options.modelId, this.options.overlayConversationId = e.overlayConversationId ?? this.options.overlayConversationId, this.options.enabledFeatures = e.enabledFeatures ?? this.options.enabledFeatures, this.sendCurrentOverlayOptions();
166
+ return this.options.theme = e.theme ?? this.options.theme, this.options.modelId = e.modelId ?? this.options.modelId, this.options.overlayConversationId = e.overlayConversationId ?? this.options.overlayConversationId, this.options.enabledFeatures = e.enabledFeatures ?? this.options.enabledFeatures, Object.hasOwn(e, "auth") && (this.options.auth = e.auth), this.sendCurrentOverlayOptions();
143
167
  }
144
168
  subscribe(e, t) {
145
169
  let n = this.eventSubscribers.get(e) ?? /* @__PURE__ */ new Set(), r = t;
@@ -162,14 +186,16 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
162
186
  }
163
187
  sendCurrentOverlayOptions() {
164
188
  let e = { hostDomain: window.location.origin };
165
- return this.options.theme !== void 0 && (e.theme = this.options.theme), this.options.modelId !== void 0 && (e.modelId = this.options.modelId), this.options.overlayConversationId !== void 0 && (e.overlayConversationId = this.options.overlayConversationId), this.options.enabledFeatures !== void 0 && (e.enabledFeatures = this.options.enabledFeatures), this.send(a.SetOverlayOptions, e, { bypassReadyGate: !0 });
189
+ this.options.theme !== void 0 && (e.theme = this.options.theme), this.options.modelId !== void 0 && (e.modelId = this.options.modelId), this.options.overlayConversationId !== void 0 && (e.overlayConversationId = this.options.overlayConversationId), this.options.enabledFeatures !== void 0 && (e.enabledFeatures = this.options.enabledFeatures);
190
+ let n = this.options.auth?.providerUiModes;
191
+ return n !== void 0 && Object.keys(n).length > 0 && (e.authProviderUiModes = n), this.send(t.SetOverlayOptions, e, { bypassReadyGate: !0 });
166
192
  }
167
193
  send(e, t, n) {
168
194
  return this.isDestroyed ? Promise.reject(/* @__PURE__ */ Error("ChatOverlay: instance was destroyed")) : n?.bypassReadyGate ? this.dispatchRequest(e, t) : this.readyGate.promise.then(() => this.dispatchRequest(e, t));
169
195
  }
170
196
  dispatchRequest(e, t) {
171
197
  if (this.isDestroyed) return Promise.reject(/* @__PURE__ */ Error("ChatOverlay: instance was destroyed"));
172
- let n = this.options.requestTimeout ?? m, r = new d(e, n);
198
+ let n = this.options.requestTimeout ?? C, r = new h(e, n);
173
199
  this.pendingRequests.set(r.requestId, r), r.promise.finally(() => {
174
200
  this.pendingRequests.delete(r.requestId);
175
201
  }).catch(() => void 0);
@@ -184,61 +210,65 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
184
210
  handleMessage(e) {
185
211
  if (e.source !== this.iframe.contentWindow) return;
186
212
  let t = e.data;
187
- if (s(t)) {
213
+ if (u(t)) {
188
214
  this.handleResponse(t);
189
215
  return;
190
216
  }
191
- o(t) && this.handleEvent(t);
217
+ d(t) && this.handleEvent(t);
192
218
  }
193
219
  handleResponse(e) {
194
220
  let t = this.pendingRequests.get(e.requestId);
195
- !t || !t.matches(e.type, e.requestId) || (this.pendingRequests.delete(e.requestId), t.resolve(e.payload));
221
+ if (!(!t || !t.matches(e.type, e.requestId))) {
222
+ if (this.pendingRequests.delete(e.requestId), e.error) {
223
+ t.reject(new T(t.requestType, e.error));
224
+ return;
225
+ }
226
+ t.resolve(e.payload);
227
+ }
196
228
  }
197
229
  handleEvent(e) {
198
- let n = e.type;
199
- n === t.Ready && this.sendCurrentOverlayOptions().catch(() => void 0), n === (this.options.loaderHideEvent ?? t.Ready) && this.hideLoader(), n === t.ReadyToInteract && this.readyGate.resolve(!0), this.notifySubscribers(n, e.payload);
230
+ let t = e.type;
231
+ t === n.Ready && this.sendCurrentOverlayOptions().catch(() => void 0), t === (this.options.loaderHideEvent ?? n.Ready) && this.hideLoader(), t === n.ReadyToInteract && this.readyGate.resolve(!0), this.notifySubscribers(t, e.payload);
200
232
  }
201
233
  hideLoader() {
202
- this.loader.style.display = "none";
234
+ this.loader.classList.add(y.LoaderHidden), this.loader.style.removeProperty("display");
203
235
  }
204
236
  notifySubscribers(e, t) {
205
237
  this.eventSubscribers.get(e)?.forEach((e) => e(t));
206
238
  }
207
- }, b = 768, x = 380, S = 600, C = 999999, w = "24px", T = "<svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M4 4h16v12H7l-3 3V4z\"/></svg>", E = "<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M18.3 5.71 12 12.01l-6.3-6.3-1.4 1.41 6.29 6.29-6.29 6.29 1.4 1.41 6.3-6.3 6.3 6.3 1.4-1.41-6.29-6.29 6.29-6.29z\"/></svg>", D = "<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M4 4h6v2H6v4H4V4zm10 0h6v6h-2V6h-4V4zM4 14h2v4h4v2H4v-6zm14 0h2v6h-6v-2h4v-4z\"/></svg>", O = "dial-overlay-manager-styles", k = () => {
208
- if (document.getElementById(O)) return;
209
- let e = document.createElement("style");
210
- e.id = O, e.textContent = "\n.dial-overlay-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border: none;\n border-radius: 999px;\n cursor: pointer;\n background: #2764d9;\n color: #ffffff;\n}\n.dial-overlay-btn:hover,\n.dial-overlay-btn:focus-visible {\n background: #1d4fb8;\n outline: 2px solid #1d4fb8;\n outline-offset: 2px;\n}\n", document.head.appendChild(e);
211
- }, A = (e, t) => {
239
+ }, A = 768, j = 380, M = 600, N = 999999, P = "24px", F = "<svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M4 4h16v12H7l-3 3V4z\"/></svg>", I = "<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M18.3 5.71 12 12.01l-6.3-6.3-1.4 1.41 6.29 6.29-6.29 6.29 1.4 1.41 6.3-6.3 6.3 6.3 1.4-1.41-6.29-6.29 6.29-6.29z\"/></svg>", L = "<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M4 4h6v2H6v4H4V4zm10 0h6v6h-2V6h-4V4zM4 14h2v4h4v2H4v-6zm14 0h2v6h-6v-2h4v-4z\"/></svg>", R = "dial-overlay-manager-styles", z = "\n.dial-overlay-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border: none;\n border-radius: 999px;\n cursor: pointer;\n background: var(--dial-overlay-btn-background, #2764d9);\n color: var(--dial-overlay-btn-color, #ffffff);\n}\n.dial-overlay-btn:hover,\n.dial-overlay-btn:focus-visible {\n background: var(--dial-overlay-btn-background-hover, #1d4fb8);\n outline: 2px solid var(--dial-overlay-btn-outline, #1d4fb8);\n outline-offset: 2px;\n}\n", B = () => {
240
+ _(R, z);
241
+ }, V = (e, t) => {
212
242
  let n = document.createElement("button");
213
243
  return n.type = "button", n.className = "dial-overlay-btn", n.setAttribute("aria-label", e), n.innerHTML = t, n;
214
- }, j = (e) => typeof e == "number" ? `${e}px` : e, M = /* @__PURE__ */ function(e) {
244
+ }, H = (e) => typeof e == "number" ? `${e}px` : e, U = /* @__PURE__ */ function(e) {
215
245
  return e.LeftBottom = "left-bottom", e.LeftTop = "left-top", e.RightBottom = "right-bottom", e.RightTop = "right-top", e;
216
- }({}), N = {
246
+ }({}), W = {
217
247
  "right-bottom": {
218
- insetInlineEnd: w,
219
- insetBlockEnd: w,
248
+ insetInlineEnd: P,
249
+ insetBlockEnd: P,
220
250
  insetInlineStart: "auto",
221
251
  insetBlockStart: "auto"
222
252
  },
223
253
  "right-top": {
224
- insetInlineEnd: w,
225
- insetBlockStart: w,
254
+ insetInlineEnd: P,
255
+ insetBlockStart: P,
226
256
  insetInlineStart: "auto",
227
257
  insetBlockEnd: "auto"
228
258
  },
229
259
  "left-bottom": {
230
- insetInlineStart: w,
231
- insetBlockEnd: w,
260
+ insetInlineStart: P,
261
+ insetBlockEnd: P,
232
262
  insetInlineEnd: "auto",
233
263
  insetBlockStart: "auto"
234
264
  },
235
265
  "left-top": {
236
- insetInlineStart: w,
237
- insetBlockStart: w,
266
+ insetInlineStart: P,
267
+ insetBlockStart: P,
238
268
  insetInlineEnd: "auto",
239
269
  insetBlockEnd: "auto"
240
270
  }
241
- }, P = class {
271
+ }, G = class {
242
272
  overlays = /* @__PURE__ */ new Map();
243
273
  abortController = new AbortController();
244
274
  isDestroyed = !1;
@@ -250,9 +280,9 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
250
280
  }
251
281
  createOverlay(e) {
252
282
  if (this.overlays.has(e.overlayId)) throw Error(`ChatOverlayManager: overlay "${e.overlayId}" already exists`);
253
- k();
283
+ B();
254
284
  let t = document.createElement("div");
255
- t.setAttribute("data-dial-overlay-container", e.overlayId), f(t, {
285
+ t.setAttribute("data-dial-overlay-container", e.overlayId), g(t, {
256
286
  display: "flex",
257
287
  flexDirection: "column",
258
288
  overflow: "hidden",
@@ -261,24 +291,24 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
261
291
  background: "#ffffff"
262
292
  });
263
293
  let n = document.createElement("div");
264
- f(n, {
294
+ g(n, {
265
295
  display: "flex",
266
296
  justifyContent: "flex-end",
267
297
  gap: "8px",
268
298
  padding: "8px"
269
299
  });
270
- let r = A(e.closeButtonAriaLabel ?? "Collapse", E);
300
+ let r = V(e.closeButtonAriaLabel ?? "Collapse", I);
271
301
  n.appendChild(r);
272
302
  let i;
273
- e.allowFullscreen && (i = A(e.fullscreenButtonAriaLabel ?? "Open full screen", D), n.appendChild(i));
303
+ e.allowFullscreen && (i = V(e.fullscreenButtonAriaLabel ?? "Open full screen", L), n.appendChild(i));
274
304
  let a = document.createElement("div");
275
- f(a, {
305
+ g(a, {
276
306
  flex: "1",
277
307
  minHeight: "0"
278
308
  }), t.appendChild(n), t.appendChild(a), document.body.appendChild(t);
279
- let o = new y(a, e);
309
+ let o = new k(a, e);
280
310
  e.allowFullscreen && o.allowFullscreen();
281
- let s = A(e.toggleButtonAriaLabel ?? "Open chat", T);
311
+ let s = V(e.toggleButtonAriaLabel ?? "Open chat", F);
282
312
  document.body.appendChild(s);
283
313
  let c = {
284
314
  overlay: o,
@@ -363,16 +393,16 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
363
393
  return t;
364
394
  }
365
395
  applyLayout(e) {
366
- let { options: t, container: n, toggleButton: r } = e, i = t.position ?? "right-bottom", a = String(t.zIndex ?? C);
367
- if (f(r, {
396
+ let { options: t, container: n, toggleButton: r } = e, i = t.position ?? "right-bottom", a = String(t.zIndex ?? N);
397
+ if (g(r, {
368
398
  position: "fixed",
369
399
  zIndex: a,
370
- ...N[i]
371
- }), f(n, {
400
+ ...W[i]
401
+ }), g(n, {
372
402
  position: "fixed",
373
403
  zIndex: a
374
- }), window.innerWidth <= b) {
375
- f(n, {
404
+ }), window.innerWidth <= A) {
405
+ g(n, {
376
406
  insetInlineStart: "0",
377
407
  insetInlineEnd: "0",
378
408
  insetBlockStart: "0",
@@ -383,12 +413,12 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
383
413
  });
384
414
  return;
385
415
  }
386
- f(n, {
387
- width: j(t.width ?? x),
388
- height: j(t.height ?? S),
389
- ...N[i]
416
+ g(n, {
417
+ width: H(t.width ?? j),
418
+ height: H(t.height ?? M),
419
+ ...W[i]
390
420
  });
391
421
  }
392
422
  };
393
423
  //#endregion
394
- export { y as ChatOverlay, P as ChatOverlayManager, e as OverlayEventType, n as OverlayFeature, M as OverlayPosition, i as OverlayRequestType };
424
+ export { k as ChatOverlay, G as ChatOverlayManager, T as ChatOverlayRequestError, i as DEPRECATED_OVERLAY_FEATURE_ALIASES, e as DIAL_OVERLAY_NAMESPACE, s as OverlayAuthUiMode, n as OverlayEventType, r as OverlayFeature, U as OverlayPosition, c as OverlayRequestErrorCode, t as OverlayRequestType, d as isOverlayMessageEvent, l as isOverlayMessageRequest, u as isOverlayMessageResponse, o as resolveOverlayFeature };
@@ -1,4 +1,12 @@
1
- import { ChatOverlayOptions, CreateConversationResponse, CreateLocalConversationResponse, DeleteConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, OverlayEventType, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetOverlayOptionsResponse, SetSystemPromptResponse, SetTemperatureResponse } from '@epam/ai-dial-chat-shared';
1
+ import { ChatOverlayOptions, CreateConversationResponse, CreateLocalConversationResponse, DeleteConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, OverlayRequestError, OverlayEventType, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetOverlayOptionsResponse, SetSystemPromptResponse, SetTemperatureResponse } from '../protocol';
2
+ /** Error returned by the embedded chat for a well-formed overlay request. */
3
+ export declare class ChatOverlayRequestError extends Error {
4
+ /** Stable embedded-chat error code. */
5
+ readonly code: OverlayRequestError['code'];
6
+ /** Request type that failed. */
7
+ readonly requestType: string;
8
+ constructor(requestType: string, error: OverlayRequestError);
9
+ }
2
10
  /**
3
11
  * A single embedded DIAL Chat iframe controlled over the `@DIAL_OVERLAY`
4
12
  * `postMessage` protocol. Construct with a root element (or selector) and
@@ -55,7 +63,7 @@ export declare class ChatOverlay {
55
63
  * embedded app. Bypasses the readiness gate — it is also how the initial
56
64
  * handshake options exchange happens, before `ready()` resolves.
57
65
  */
58
- setOverlayOptions(options: Partial<Pick<ChatOverlayOptions, 'theme' | 'modelId' | 'overlayConversationId' | 'enabledFeatures'>>): Promise<SetOverlayOptionsResponse>;
66
+ setOverlayOptions(options: Partial<Pick<ChatOverlayOptions, 'theme' | 'modelId' | 'overlayConversationId' | 'enabledFeatures' | 'auth'>>): Promise<SetOverlayOptionsResponse>;
59
67
  /** Registers `callback` to be invoked with each `eventType` event's payload. */
60
68
  subscribe<T = unknown>(eventType: OverlayEventType, callback: (payload: T) => void): () => void;
61
69
  /** Grants the iframe permission to enter fullscreen. */
@@ -1 +1 @@
1
- {"version":3,"file":"ChatOverlay.d.ts","sourceRoot":"","sources":["../../src/lib/ChatOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EAEpC,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,gCAAgC,EAIrC,gBAAgB,EAIhB,KAAK,0BAA0B,EAE/B,KAAK,0BAA0B,EAE/B,KAAK,mBAAmB,EAGxB,KAAK,yBAAyB,EAE9B,KAAK,uBAAuB,EAE5B,KAAK,sBAAsB,EAG5B,MAAM,2BAA2B,CAAC;AAmEnC;;;;GAIG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAG5B;IACJ,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAG7B;IACJ,OAAO,CAAC,QA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Options, CreateConversationResponse, CreateLocalConversationResponse, DeleteConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, OverlayEventType, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetOverlayOptionsResponse, SetSystemPromptResponse, SetTemperatureResponse } from '@epam/ai-dial-chat-shared';
1
+ import { ChatOverlayOptions, CreateConversationResponse, CreateLocalConversationResponse, DeleteConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, OverlayEventType, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetOverlayOptionsResponse, SetSystemPromptResponse, SetTemperatureResponse } from '../protocol';
2
2
  /** Fixed-position placement for a `ChatOverlayManager`-created overlay. */
3
3
  export declare enum OverlayPosition {
4
4
  /** Anchored to the start (left in LTR) edge, bottom corner. */
@@ -31,11 +31,7 @@ export interface ChatOverlayManagerOptions extends ChatOverlayOptions {
31
31
  /** Accessible name for the fullscreen button. Defaults to `'Open full screen'`. */
32
32
  fullscreenButtonAriaLabel?: string;
33
33
  }
34
- /**
35
- * Creates and positions one or more `ChatOverlay` instances behind
36
- * fixed-position toggle/close/(optional) fullscreen chrome, keyed by
37
- * `overlayId`.
38
- */
34
+ /** Creates and positions one or more `ChatOverlay` instances behind fixed-position toggle/close/fullscreen chrome, keyed by `overlayId`. */
39
35
  export declare class ChatOverlayManager {
40
36
  private readonly overlays;
41
37
  private readonly abortController;
@@ -1 +1 @@
1
- {"version":3,"file":"ChatOverlayManager.d.ts","sourceRoot":"","sources":["../../src/lib/ChatOverlayManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,gCAAgC,EAChC,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AA+D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E,CACF,GACA,OAAO,CAAC,yBAAyB,CAAC;IAIrC,8DAA8D;IAC9D,SAAS,CAAC,CAAC,GAAG,OAAO,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,gBAAgB,EAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,GAC7B,MAAM,IAAI;IAIb,2CAA2C;IAC3C,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,wFAAwF;IACxF,OAAO,IAAI,IAAI;IAcf,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,WAAW;CAgCpB"}
@@ -1,9 +1,7 @@
1
- /**
2
- * A single outstanding request: owns its `requestId`, races its response
3
- * promise against a per-request timeout, and rejects with a descriptive
4
- * error naming the request type and timeout when unanswered in time.
5
- */
1
+ /** A single outstanding overlay request: owns its `requestId` and resolves/rejects when the matching response arrives or the timeout elapses. */
6
2
  export declare class DeferredRequest<T = unknown> {
3
+ /** Exact request type sent to the embedded app. */
4
+ readonly requestType: string;
7
5
  /** Unique id used to match this request to its response message. */
8
6
  readonly requestId: string;
9
7
  /** Exact response type expected for this request. */
@@ -1 +1 @@
1
- {"version":3,"file":"deferred-request.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/deferred-request.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,qBAAa,eAAe,CAAC,CAAC,GAAG,OAAO;IACtC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;gBAElD,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAgBlD,uEAAuE;IACvE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAIzD,mEAAmE;IACnE,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IASvB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;CAQ/B"}
1
+ {"version":3,"file":"deferred-request.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/deferred-request.ts"],"names":[],"mappings":"AAOA,iJAAiJ;AACjJ,qBAAa,eAAe,CAAC,CAAC,GAAG,OAAO;IACtC,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7B,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;gBAElD,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAiBlD,uEAAuE;IACvE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAIzD,mEAAmE;IACnE,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IASvB,mEAAmE;IACnE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;CAQ/B"}
@@ -1,3 +1,9 @@
1
1
  /** Applies each entry of `styles` as an inline style property on `element`. */
2
2
  export declare const setStyles: (element: HTMLElement, styles: Record<string, string>) => void;
3
+ /**
4
+ * Appends a `<style id="{id}">` element carrying `css` to `document.head`,
5
+ * once per document. Repeat calls with the same `id` are a no-op, so every
6
+ * overlay instance can call it during construction.
7
+ */
8
+ export declare const injectStyleSheet: (id: string, css: string) => void;
3
9
  //# sourceMappingURL=dom-styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom-styles.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/dom-styles.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,SAAS,GACpB,SAAS,WAAW,EACpB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC7B,IAEF,CAAC"}
1
+ {"version":3,"file":"dom-styles.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/dom-styles.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,SAAS,GACpB,SAAS,WAAW,EACpB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC7B,IAEF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM,EAAE,KAAK,MAAM,KAAG,IAQ1D,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** Class names applied by `ChatOverlay` to the host root, iframe, and loader. */
2
+ export declare enum OverlayClassName {
3
+ /** Positioning context on the host-provided root element. */
4
+ Root = "dial-overlay-root",
5
+ /** The embedded chat iframe. */
6
+ Iframe = "dial-overlay-iframe",
7
+ /** The loader shown until the configured hide event arrives. */
8
+ Loader = "dial-overlay-loader",
9
+ /** Hidden state of the loader. */
10
+ LoaderHidden = "dial-overlay-loader--hidden"
11
+ }
12
+ /**
13
+ * Custom properties the injected stylesheet reads, each with a literal
14
+ * fallback. This lib deliberately ships no CSS file and no `--cs-*` theming
15
+ * channel, so these are the supported way for a host to retheme the loader
16
+ * palette without an `!important` fight against the injected source order.
17
+ */
18
+ export declare enum OverlayCssVariable {
19
+ /** Loader backdrop. Defaults to `#ffffff`. */
20
+ LoaderBackground = "--dial-overlay-loader-background",
21
+ /** Loader foreground, inherited by the spinner's `currentColor` stroke. Defaults to `#2764d9`. */
22
+ LoaderColor = "--dial-overlay-loader-color"
23
+ }
24
+ /** Injects the `ChatOverlay` stylesheet into `document.head`, once per document. */
25
+ export declare const ensureOverlayStylesInjected: () => void;
26
+ //# sourceMappingURL=overlay-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-styles.d.ts","sourceRoot":"","sources":["../../../src/lib/internal/overlay-styles.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,oBAAY,gBAAgB;IAC1B,6DAA6D;IAC7D,IAAI,sBAAsB;IAC1B,gCAAgC;IAChC,MAAM,wBAAwB;IAC9B,gEAAgE;IAChE,MAAM,wBAAwB;IAC9B,kCAAkC;IAClC,YAAY,gCAAgC;CAC7C;AAED;;;;;GAKG;AACH,oBAAY,kBAAkB;IAC5B,8CAA8C;IAC9C,gBAAgB,qCAAqC;IACrD,kGAAkG;IAClG,WAAW,gCAAgC;CAC5C;AAqCD,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,QAAO,IAE9C,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-overlay",
3
3
  "description": "Embeddable postMessage-based ChatOverlay/ChatOverlayManager widget for hosting a DIAL Chat instance inside a third-party page",
4
- "version": "1.1.0-dev.44",
4
+ "version": "1.1.0-dev.441",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -15,9 +15,6 @@
15
15
  "default": "./index.js"
16
16
  }
17
17
  },
18
- "peerDependencies": {
19
- "@epam/ai-dial-chat-shared": "1.1.0-dev.44"
20
- },
21
18
  "repository": {
22
19
  "type": "git",
23
20
  "url": "git+https://github.com/epam/ai-dial-chat.git",
@@ -0,0 +1,445 @@
1
+ /** Namespace prefix for every `@DIAL_OVERLAY` postMessage type string. */
2
+ export declare const DIAL_OVERLAY_NAMESPACE = "@DIAL_OVERLAY";
3
+ /** Request message types the host can send to the embedded app. */
4
+ export declare enum OverlayRequestType {
5
+ /** Fetch the active conversation's messages. */
6
+ GetMessages = "@DIAL_OVERLAY/GET_MESSAGES",
7
+ /** Send a new message in the active conversation. */
8
+ SendMessage = "@DIAL_OVERLAY/SEND_MESSAGE",
9
+ /** Set the current text content of the message input. */
10
+ SetInputContent = "@DIAL_OVERLAY/SET_INPUT_CONTENT",
11
+ /** Set the active conversation's system prompt. */
12
+ SetSystemPrompt = "@DIAL_OVERLAY/SET_SYSTEM_PROMPT",
13
+ /** Set the active conversation's temperature. */
14
+ SetTemperature = "@DIAL_OVERLAY/SET_TEMPERATURE",
15
+ /** Set host-provided options (theme, model, conversation, host domain). */
16
+ SetOverlayOptions = "@DIAL_OVERLAY/SET_OVERLAY_OPTIONS",
17
+ /** Fetch the current user's conversation list. */
18
+ GetConversations = "@DIAL_OVERLAY/GET_CONVERSATIONS",
19
+ /** Fetch the currently displayed (active) conversation(s). */
20
+ GetSelectedConversations = "@DIAL_OVERLAY/GET_SELECTED_CONVERSATIONS",
21
+ /** Navigate to and load a specific conversation by id. */
22
+ SelectConversation = "@DIAL_OVERLAY/SELECT_CONVERSATION",
23
+ /** Create a new conversation, persisting immediately if a first message is given. */
24
+ CreateConversation = "@DIAL_OVERLAY/CREATE_CONVERSATION",
25
+ /** Open the conversation composer without persisting anything. */
26
+ CreateLocalConversation = "@DIAL_OVERLAY/CREATE_LOCAL_CONVERSATION",
27
+ /** Delete a conversation by id. */
28
+ DeleteConversation = "@DIAL_OVERLAY/DELETE_CONVERSATION",
29
+ /** Rename a conversation by id. */
30
+ RenameConversation = "@DIAL_OVERLAY/RENAME_CONVERSATION"
31
+ }
32
+ /** Event message types the embedded app sends to the host. */
33
+ export declare enum OverlayEventType {
34
+ /** Sent once, immediately, before any host identity is known. */
35
+ InitReady = "@DIAL_OVERLAY/INIT_READY",
36
+ /** Sent once, after auth/model-load state resolves. */
37
+ Ready = "@DIAL_OVERLAY/READY",
38
+ /** Sent once, after the active conversation has been selected/loaded for the first time. */
39
+ ReadyToInteract = "@DIAL_OVERLAY/READY_TO_INTERACT",
40
+ /** Sent whenever the app finishes loading a conversation (initial load or navigation). */
41
+ SelectedConversationLoaded = "@DIAL_OVERLAY/SELECTED_CONVERSATION_LOADED",
42
+ /** Sent when a generation starts for the active conversation. */
43
+ GptStartGenerating = "@DIAL_OVERLAY/GPT_START_GENERATING",
44
+ /** Sent when a generation completes for the active conversation. */
45
+ GptEndGenerating = "@DIAL_OVERLAY/GPT_END_GENERATING",
46
+ /** Sent when a user (or host) stops an in-flight generation. */
47
+ StopGenerating = "@DIAL_OVERLAY/STOP_GENERATING",
48
+ /** Sent whenever the app's conversation list changes. */
49
+ ConversationsUpdated = "@DIAL_OVERLAY/CONVERSATIONS_UPDATED"
50
+ }
51
+ /** Optional embed-time features a host can opt into via `ChatOverlayOptions.enabledFeatures`. */
52
+ export declare enum OverlayFeature {
53
+ /** Enables the "Add app" menu's Code Apps entry. */
54
+ CodeApps = "code-apps",
55
+ /**
56
+ * Enables the catalog's Quick App creation entry, i.e. applications built
57
+ * on an `applicationTypeSchemaId`. Schema-less applications are gated by
58
+ * `CustomApps` instead.
59
+ */
60
+ SchemaApps = "schema-apps",
61
+ /**
62
+ * Hides both of the catalog's app-creation entries, "Create Quick App" and
63
+ * "Create Custom app", regardless of `SchemaApps` / `CustomApps`.
64
+ */
65
+ HideCustomAppCreation = "hide-custom-app-creation",
66
+ /** Disables the send action on the chat input without removing the button. */
67
+ DisabledSend = "disabled-send",
68
+ /** Suppresses the chat input's auto-focus effect on load. */
69
+ SkipFocusChatInputOnload = "skip-focus-chat-input-onload",
70
+ /**
71
+ * Enables the "Chat settings" entry (temperature, system prompt, response
72
+ * format) in the conversation input's "+" menu, on every screen that renders
73
+ * that input. Disabling it removes the entry everywhere, regardless of
74
+ * `EmptyChatSettings`.
75
+ */
76
+ ChatSettings = "chat-settings",
77
+ /**
78
+ * Enables removing a deployment tool from the conversation input: each tool
79
+ * chip gets a × that drops it from the row, and the "+" menu gets a "Tools"
80
+ * entry that brings a dropped chip back. Disabling it makes every chip a
81
+ * persistent on/off toggle that the user cannot add or remove.
82
+ */
83
+ RemovableTools = "removable-tools",
84
+ /** Enables the comment field in the negative-feedback (dislike) modal. */
85
+ DislikeComment = "dislike-comment",
86
+ /** Enables attaching files to a message via the conversation input. */
87
+ InputFiles = "input-files",
88
+ /** Enables like/dislike actions on assistant messages. */
89
+ Likes = "likes",
90
+ /** Enables the live-chat-interaction sign-in UI affordance. */
91
+ LiveChatInteraction = "live-chat-interaction",
92
+ /** Restricts (disables) changing the selected agent/model on the conversation top bar. */
93
+ DisallowChangeAgent = "disallow-change-agent",
94
+ /** Hides the agent/model selector on the in-chat conversation input. */
95
+ HideChangeAgent = "hide-change-agent",
96
+ /** Hides the new-conversation controls in the header/layout. */
97
+ HideNewConversation = "hide-new-conversation",
98
+ /**
99
+ * Enables the empty-chat (new conversation composer) settings UI. Narrows
100
+ * `ChatSettings` to that screen only — both must be enabled for the entry to
101
+ * appear there.
102
+ */
103
+ EmptyChatSettings = "empty-chat-settings",
104
+ /** Hides the model selector on the empty-chat composer screen. */
105
+ HideEmptyChatChangeAgent = "hide-empty-chat-change-agent",
106
+ /** Enables the attachments-manager (`AttachmentCanvasProvider`) mount. */
107
+ AttachmentsManager = "attachments-manager",
108
+ /** Enables the conversations-panel toggle button. */
109
+ ConversationsPanelToggle = "conversations-panel-toggle",
110
+ /** Enables the conversations sidebar section. */
111
+ ConversationsSection = "conversations-section",
112
+ /** Enables the app header. */
113
+ Header = "header",
114
+ /**
115
+ * Hides the header's hamburger button and the navigation sheet it opens —
116
+ * the mobile-breakpoint navigation surface carrying the nav items, profile,
117
+ * keyboard shortcuts, and log out.
118
+ */
119
+ HideNavigationMenu = "hide-navigation-menu",
120
+ /** Makes the conversations sidebar section open by default. */
121
+ ShowConversationsSectionByDefault = "showConversationsSectionByDefault",
122
+ /** Hides the conversations panel's source filter tabs (All / My chats / Shared / Organization). */
123
+ HideConversationsFilter = "hide-conversations-filter",
124
+ /** Enables the catalog (`/catalog`) route. */
125
+ Catalog = "catalog",
126
+ /** Restricts the catalog to hide the current user's own/shared-with-me apps. */
127
+ CatalogHideMyApps = "catalog-hide-my-apps",
128
+ /** Makes the catalog's table view the initial default (instead of grid). */
129
+ CatalogTableView = "catalog-table-view",
130
+ /** Enables the file manager (`/files`) route and its navigation entry. */
131
+ FileManager = "file-manager",
132
+ /** Hides the delete action on a user's own messages. */
133
+ HideDeleteUserMessage = "hide-delete-user-message",
134
+ /** Hides the edit action on a user's own messages. */
135
+ HideEditUserMessage = "hide-edit-user-message",
136
+ /** Hides the regenerate action on assistant messages. */
137
+ HideRegenerateAssistantMessage = "hide-regenerate-assistant-message",
138
+ /** Enables the conversation-publishing entry point. */
139
+ ConversationsPublishing = "conversations-publishing",
140
+ /** Enables the application-sharing entry point. */
141
+ ApplicationsSharing = "applications-sharing",
142
+ /** Enables the conversation-sharing entry point. */
143
+ ConversationsSharing = "conversations-sharing",
144
+ /** Enables the toolset-sharing entry point. */
145
+ ToolsetsSharing = "toolsets-sharing",
146
+ /** Enables toolsets functionality. */
147
+ Toolsets = "toolsets",
148
+ /** Enables prompts: the catalog's Prompts tab, its create option, and the prompt editor route. */
149
+ Prompts = "prompts",
150
+ /** Enables skills: the catalog's Skills tab and the skill details panel. */
151
+ Skills = "skills",
152
+ /**
153
+ * Enables the catalog's custom-app creation entry, the editability of
154
+ * schema-less applications, and the custom-app editor route. Applications
155
+ * built on a schema are gated by `SchemaApps` instead.
156
+ */
157
+ CustomApps = "custom-apps",
158
+ /** Hides the user avatar/menu button in the header. */
159
+ HideUserMenu = "hide-user-menu",
160
+ /** Hides the settings entry in the user menu. */
161
+ HideUserSettings = "hide-user-settings",
162
+ /** Hides the keyboard-shortcuts entry in the user menu and the mobile profile sheet. */
163
+ HideKeyboardShortcuts = "hide-keyboard-shortcuts",
164
+ /** Enables the `microphone` permission on the iframe's `allow` attribute for voice input. */
165
+ VoiceInput = "voice-input"
166
+ }
167
+ /**
168
+ * Wire values a host may still be sending that were renamed, mapped to the
169
+ * canonical `OverlayFeature` member. Accepted for backward compatibility on a
170
+ * transitional basis: a deprecated value resolves to its replacement instead of
171
+ * being dropped. Remove an entry once hosts have migrated, and record the
172
+ * rename in the migration guide's "Renamed flags" table.
173
+ */
174
+ export declare const DEPRECATED_OVERLAY_FEATURE_ALIASES: Readonly<Record<string, OverlayFeature>>;
175
+ /**
176
+ * Resolves a raw wire value to an `OverlayFeature`, accepting the deprecated
177
+ * aliases in `DEPRECATED_OVERLAY_FEATURE_ALIASES`. Returns `undefined` for an
178
+ * unrecognized value so the caller can drop it and warn.
179
+ */
180
+ export declare const resolveOverlayFeature: (value: string) => OverlayFeature | undefined;
181
+ /** Controls how an overlay starts authentication for a configured provider. */
182
+ export declare enum OverlayAuthUiMode {
183
+ /** Opens authentication in a separate browser window or tab. */
184
+ External = "external",
185
+ /** Navigates the embedded overlay window through authentication. */
186
+ SameWindow = "sameWindow"
187
+ }
188
+ /** Machine-readable reasons why an overlay request could not be completed. */
189
+ export declare enum OverlayRequestErrorCode {
190
+ /** The method requires an open conversation, but the composer is currently shown. */
191
+ ActiveConversationUnavailable = "ACTIVE_CONVERSATION_UNAVAILABLE",
192
+ /** The method requires the conversation-list integration, but it is not available. */
193
+ ConversationListUnavailable = "CONVERSATION_LIST_UNAVAILABLE",
194
+ /** The request payload does not match the method contract. */
195
+ InvalidPayload = "INVALID_PAYLOAD",
196
+ /** The embedded chat failed while executing the requested operation. */
197
+ RequestExecutionFailed = "REQUEST_EXECUTION_FAILED"
198
+ }
199
+ /** Structured failure returned for an overlay request. */
200
+ export interface OverlayRequestError {
201
+ /** Stable code suitable for programmatic handling. */
202
+ code: OverlayRequestErrorCode;
203
+ /** Human-readable explanation suitable for logs and diagnostics. */
204
+ message: string;
205
+ }
206
+ /** Minimal message shape carried in overlay protocol payloads. */
207
+ export interface OverlayChatMessage {
208
+ /** Message id. */
209
+ id: string;
210
+ /** Author role, e.g. `'user'`, `'assistant'`, or `'system'`. */
211
+ role: string;
212
+ /** Message text content. */
213
+ content: string;
214
+ }
215
+ /** Host-agnostic conversation projection for the overlay protocol. */
216
+ export interface OverlayConversation {
217
+ /** Conversation id. */
218
+ id: string;
219
+ /** Conversation title. */
220
+ title: string;
221
+ /** Epoch milliseconds of the conversation's last update. */
222
+ updatedAt: number;
223
+ /** Whether the conversation is pinned. */
224
+ isPinned: boolean;
225
+ /** Whether the current user has read-only access. */
226
+ isReadonly: boolean;
227
+ /** Whether the conversation was shared with the current user. */
228
+ sharedWithMe: boolean;
229
+ /** Whether the conversation was published with the current user. */
230
+ publishedWithMe: boolean;
231
+ }
232
+ /** Error signal carried by conversation-list method responses. */
233
+ export interface OverlayConversationError {
234
+ /** `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). */
235
+ code: 'NOT_FOUND' | 'FORBIDDEN' | 'INVALID_ARGUMENT';
236
+ /** Human-readable description of the failure. */
237
+ message: string;
238
+ }
239
+ /** Options passed to `ChatOverlay`'s constructor. */
240
+ export interface ChatOverlayOptions {
241
+ /** Full URL of the chat app instance to embed (origin + optional path). */
242
+ domain: string;
243
+ /** Milliseconds to wait for a request's response before rejecting. Defaults to `10000`. */
244
+ requestTimeout?: number;
245
+ /**
246
+ * Inline CSS properties applied to the loader element while it is visible.
247
+ * A `display` entry is dropped once `loaderHideEvent` arrives — use
248
+ * `loaderHideEvent` to control visibility, not `display`.
249
+ */
250
+ loaderStyles?: Record<string, string>;
251
+ /** CSS class applied to the loader element. */
252
+ loaderClass?: string;
253
+ /** Custom HTML rendered inside the loader element, replacing the default spinner. */
254
+ loaderInnerHTML?: string;
255
+ /** Event whose receipt hides the loader. Defaults to `OverlayEventType.Ready`. */
256
+ loaderHideEvent?: OverlayEventType;
257
+ /** Embed-time features to enable, e.g. microphone access for voice input. */
258
+ enabledFeatures?: OverlayFeature[];
259
+ /** Theme name applied to the embedded app. */
260
+ theme?: string;
261
+ /** Deployment/model id to select in the embedded app. */
262
+ modelId?: string;
263
+ /** Conversation id the embedded app should load and display. */
264
+ overlayConversationId?: string;
265
+ /** Per-provider authentication UI behavior configured by the embedding host. */
266
+ auth?: {
267
+ providerUiModes?: Record<string, OverlayAuthUiMode>;
268
+ };
269
+ }
270
+ /** Payload of a `SET_OVERLAY_OPTIONS` request. */
271
+ export interface SetOverlayOptionsPayload {
272
+ /** Origin of the host page, used by the app to target responses/events. */
273
+ hostDomain: string;
274
+ /** Theme name to apply, if provided. */
275
+ theme?: string;
276
+ /** Deployment/model id to select, if provided. */
277
+ modelId?: string;
278
+ /** Conversation id to navigate to and load, if provided. */
279
+ overlayConversationId?: string;
280
+ /**
281
+ * UI-feature keys that replace (not merge with) the app's current effective
282
+ * UI-feature set, if provided. Array only — no comma-separated-string form.
283
+ */
284
+ enabledFeatures?: string[];
285
+ /** Opaque per-provider authentication UI modes supplied by the host. */
286
+ authProviderUiModes?: Record<string, string>;
287
+ }
288
+ /** Payload of a `SEND_MESSAGE` request. */
289
+ export interface SendMessagePayload {
290
+ /** Text content of the message to send. */
291
+ content: string;
292
+ }
293
+ /** Payload of a `SET_INPUT_CONTENT` request. */
294
+ export interface SetInputContentPayload {
295
+ /** Text content to set in the message input. */
296
+ content: string;
297
+ }
298
+ /** Payload of a `SET_SYSTEM_PROMPT` request. */
299
+ export interface SetSystemPromptPayload {
300
+ /** System prompt to persist on the active conversation. */
301
+ systemPrompt: string;
302
+ }
303
+ /** Payload of a `SET_TEMPERATURE` request. */
304
+ export interface SetTemperaturePayload {
305
+ /** Temperature value to persist on the active conversation. */
306
+ temperature: number;
307
+ }
308
+ /** Payload of a `SELECT_CONVERSATION` request. */
309
+ export interface SelectConversationPayload {
310
+ /** Id of the conversation to select. */
311
+ id: string;
312
+ }
313
+ /** Payload of a `DELETE_CONVERSATION` request. */
314
+ export interface DeleteConversationPayload {
315
+ /** Id of the conversation to delete. */
316
+ id: string;
317
+ }
318
+ /** Payload of a `RENAME_CONVERSATION` request. */
319
+ export interface RenameConversationPayload {
320
+ /** Id of the conversation to rename. */
321
+ id: string;
322
+ /** New title for the conversation. */
323
+ newName: string;
324
+ }
325
+ /** Payload of a `CREATE_CONVERSATION` request. */
326
+ export interface CreateConversationPayload {
327
+ /** Deployment/model id to create the conversation with, if given. */
328
+ deploymentId?: string;
329
+ /** Initial message to persist immediately. Omitted/blank opens the composer instead. */
330
+ firstMessage?: string;
331
+ }
332
+ /** Response payload of a `GET_MESSAGES` request. */
333
+ export interface GetMessagesResponse {
334
+ /** Messages in the active conversation. */
335
+ messages: OverlayChatMessage[];
336
+ }
337
+ /** Response payload of a `SEND_MESSAGE` request. */
338
+ export interface SendMessageResponse {
339
+ /** Messages in the active conversation after the send. */
340
+ messages: OverlayChatMessage[];
341
+ }
342
+ /** Response payload of a `SET_SYSTEM_PROMPT` request. */
343
+ export interface SetSystemPromptResponse {
344
+ /** System prompt value that was persisted. */
345
+ systemPrompt: string;
346
+ }
347
+ /** Response payload of a `SET_TEMPERATURE` request. */
348
+ export interface SetTemperatureResponse {
349
+ /** Temperature value that was persisted. */
350
+ temperature: number;
351
+ }
352
+ /** Response payload of a `SET_OVERLAY_OPTIONS` request. */
353
+ export interface SetOverlayOptionsResponse {
354
+ /** Whether the supplied options were applied (`false` only signals a fallback, never a thrown error). */
355
+ applied: boolean;
356
+ }
357
+ /** Response payload of a `GET_CONVERSATIONS` request. */
358
+ export interface GetConversationsResponse {
359
+ /** The current user's conversation list. */
360
+ conversations: OverlayConversation[];
361
+ }
362
+ /** Response payload of a `GET_SELECTED_CONVERSATIONS` request. */
363
+ export interface GetSelectedConversationsResponse {
364
+ /** Currently displayed conversation(s); empty when no conversation is mounted. */
365
+ conversations: OverlayConversation[];
366
+ }
367
+ /** Response payload of a `SELECT_CONVERSATION` request. */
368
+ export interface SelectConversationResponse {
369
+ /** The now-selected conversation's projection, present on success. */
370
+ conversation?: OverlayConversation;
371
+ /** Present when the selection failed. */
372
+ error?: OverlayConversationError;
373
+ }
374
+ /** Response payload of a `CREATE_CONVERSATION` request. */
375
+ export interface CreateConversationResponse {
376
+ /** The created conversation's projection, or `null` when the composer path was taken. */
377
+ conversation: OverlayConversation | null;
378
+ /** Present when creation failed. */
379
+ error?: OverlayConversationError;
380
+ }
381
+ /** Response payload of a `CREATE_LOCAL_CONVERSATION` request. */
382
+ export interface CreateLocalConversationResponse {
383
+ /** Always `null` — the composer opens without persisting anything. */
384
+ conversation: null;
385
+ }
386
+ /** Response payload of a `DELETE_CONVERSATION` request. */
387
+ export interface DeleteConversationResponse {
388
+ /** Present when deletion failed. */
389
+ error?: OverlayConversationError;
390
+ }
391
+ /** Response payload of a `RENAME_CONVERSATION` request. */
392
+ export interface RenameConversationResponse {
393
+ /** The renamed conversation's projection, present on success. */
394
+ conversation?: OverlayConversation;
395
+ /** Present when the rename failed. */
396
+ error?: OverlayConversationError;
397
+ }
398
+ /**
399
+ * A request message sent from the host (library) to the embedded app.
400
+ * `type` is always `'${OverlayRequestType}'`.
401
+ */
402
+ export interface OverlayMessageRequest<TPayload = unknown> {
403
+ /** Full wire type string, one of the `OverlayRequestType` values. */
404
+ type: `${OverlayRequestType}`;
405
+ /** Unique id used to match this request to its response. */
406
+ requestId: string;
407
+ /**
408
+ * Epoch milliseconds after which the embedded app must stop waiting for
409
+ * prerequisites (such as an active conversation bridge) and drop the request.
410
+ */
411
+ expiresAt?: number;
412
+ /** Request-specific payload. */
413
+ payload?: TPayload;
414
+ }
415
+ /**
416
+ * A response message sent from the embedded app to the host (library),
417
+ * answering a specific request by `requestId`.
418
+ */
419
+ export interface OverlayMessageResponse<TPayload = unknown> {
420
+ /** Full wire type string, always `'${OverlayRequestType}/RESPONSE'`. */
421
+ type: `${OverlayRequestType}/RESPONSE`;
422
+ /** `requestId` of the request this message answers. */
423
+ requestId: string;
424
+ /** Response-specific payload. */
425
+ payload?: TPayload;
426
+ /** Present when the embedded chat could not complete the request. */
427
+ error?: OverlayRequestError;
428
+ }
429
+ /**
430
+ * An event message sent from the embedded app to the host (library),
431
+ * with no associated request (no `requestId` field).
432
+ */
433
+ export interface OverlayMessageEvent<TPayload = unknown> {
434
+ /** Full wire type string, one of the `OverlayEventType` values. */
435
+ type: `${OverlayEventType}`;
436
+ /** Event-specific payload. */
437
+ payload?: TPayload;
438
+ }
439
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageRequest`. */
440
+ export declare const isOverlayMessageRequest: (data: unknown) => data is OverlayMessageRequest;
441
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageResponse`. */
442
+ export declare const isOverlayMessageResponse: (data: unknown) => data is OverlayMessageResponse;
443
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageEvent`. */
444
+ export declare const isOverlayMessageEvent: (data: unknown) => data is OverlayMessageEvent;
445
+ //# sourceMappingURL=overlay-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/overlay-protocol.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAEtD,mEAAmE;AACnE,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,8DAA8D;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AAO,KACZ,IAAI,IAAI,sBA8BV,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,GAChC,MAAM,OAAO,KACZ,IAAI,IAAI,mBAUV,CAAC"}
package/protocol.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './protocol/overlay-protocol';
2
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}