@epam/ai-dial-chat-overlay 1.1.0-dev.49 → 1.1.0-dev.492

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,33 @@
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.ShowAllStarters = "show-all-starters", e.HideFooterVersion = "hide-footer-version", 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 = /* @__PURE__ */ function(e) {
13
+ return e.Completed = "completed", e.Failed = "failed", e;
14
+ }({}), u = (e) => {
15
+ if (typeof e != "object" || !e) return !1;
16
+ let n = e;
17
+ 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));
18
+ }, d = (e) => {
19
+ if (typeof e != "object" || !e) return !1;
20
+ let n = e;
21
+ if (typeof n.type != "string" || typeof n.requestId != "string" || !Object.values(t).some((e) => n.type === `${e}/RESPONSE`)) return !1;
22
+ if (!("error" in n)) return !0;
23
+ let r = n.error;
24
+ return typeof r == "object" && !!r && typeof r.code == "string" && Object.values(c).includes(r.code) && typeof r.message == "string";
25
+ }, f = (e) => {
26
+ if (typeof e != "object" || !e) return !1;
27
+ let t = e;
28
+ return typeof t.type == "string" && Object.values(n).includes(t.type) && !("requestId" in t);
29
+ }, p = "<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>", m = 0, h = () => (m += 1, `dial-overlay-${Date.now()}-${m}`), g = class {
30
+ requestType;
4
31
  requestId;
5
32
  responseType;
6
33
  promise;
@@ -9,7 +36,7 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
9
36
  settled = !1;
10
37
  timeoutHandle;
11
38
  constructor(e, t) {
12
- this.requestId = u(), this.responseType = `${e}/RESPONSE`, this.promise = new Promise((e, t) => {
39
+ this.requestType = e, this.requestId = h(), this.responseType = `${e}/RESPONSE`, this.promise = new Promise((e, t) => {
13
40
  this.resolveFn = e, this.rejectFn = t;
14
41
  }), this.timeoutHandle = setTimeout(() => {
15
42
  this.reject(/* @__PURE__ */ Error(`ChatOverlay: request "${e}" timed out after ${t}ms`));
@@ -24,9 +51,17 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
24
51
  reject(e) {
25
52
  this.settled || (this.settled = !0, clearTimeout(this.timeoutHandle), this.rejectFn(e));
26
53
  }
27
- }, f = (e, t) => {
54
+ }, _ = (e, t) => {
28
55
  Object.assign(e.style, t);
29
- }, p = class {
56
+ }, v = (e, t) => {
57
+ if (document.getElementById(e)) return;
58
+ let n = document.createElement("style");
59
+ n.id = e, n.textContent = t, document.head.appendChild(n);
60
+ }, y = "dial-overlay-styles", b = /* @__PURE__ */ function(e) {
61
+ return e.Root = "dial-overlay-root", e.Iframe = "dial-overlay-iframe", e.Loader = "dial-overlay-loader", e.LoaderHidden = "dial-overlay-loader--hidden", e;
62
+ }({}), x = "\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", S = () => {
63
+ v(y, x);
64
+ }, C = class {
30
65
  promise;
31
66
  resolveFn;
32
67
  rejectFn;
@@ -42,41 +77,32 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
42
77
  reject(e) {
43
78
  this.settled || (this.settled = !0, this.rejectFn(e));
44
79
  }
45
- }, m = 1e4, h = "data-dial-overlay-loader", g = (e) => {
80
+ }, w = 1e4, T = "data-dial-overlay-loader", E = class extends Error {
81
+ code;
82
+ requestType;
83
+ constructor(e, t) {
84
+ super(`ChatOverlay: request "${e}" failed [${t.code}]: ${t.message}`), this.name = "ChatOverlayRequestError", this.code = t.code, this.requestType = e;
85
+ }
86
+ }, D = (e) => {
46
87
  if (typeof e != "string") return e;
47
88
  let t = document.querySelector(e);
48
89
  if (!t) throw Error(`ChatOverlay: no element matches selector "${e}"`);
49
90
  return t;
50
- }, _ = (e) => {
91
+ }, O = (e) => {
51
92
  let t = document.createElement("iframe");
52
93
  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
94
  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) => {
95
+ return e.enabledFeatures?.includes(r.VoiceInput) && n.push("microphone"), t.setAttribute("allow", n.join("; ")), t.className = b.Iframe, t;
96
+ }, k = (e) => {
61
97
  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 {
98
+ return t.setAttribute(T, ""), t.innerHTML = e.loaderInnerHTML ?? p, t.className = [b.Loader, e.loaderClass].filter(Boolean).join(" "), e.loaderStyles && _(t, e.loaderStyles), t;
99
+ }, A = class {
74
100
  root;
75
101
  iframe;
76
102
  loader;
77
103
  options;
78
104
  targetOrigin;
79
- readyGate = new p();
105
+ readyGate = new C();
80
106
  pendingRequests = /* @__PURE__ */ new Map();
81
107
  eventSubscribers = /* @__PURE__ */ new Map();
82
108
  messageListener = (e) => {
@@ -84,62 +110,62 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
84
110
  };
85
111
  isDestroyed = !1;
86
112
  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);
113
+ this.root = D(e), this.options = { ...t }, this.targetOrigin = new URL(t.domain).origin, S(), this.iframe = O(this.options), this.loader = k(this.options);
88
114
  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);
115
+ (n === "static" || n === "") && this.root.classList.add(b.Root), this.root.appendChild(this.loader), this.root.appendChild(this.iframe), window.addEventListener("message", this.messageListener), this.readyGate.promise.catch(() => void 0);
90
116
  }
91
117
  ready() {
92
118
  return this.readyGate.promise;
93
119
  }
94
120
  getMessages() {
95
- return this.send(a.GetMessages);
121
+ return this.send(t.GetMessages);
96
122
  }
97
123
  sendMessage(e) {
98
- let t = { content: e };
99
- return this.send(a.SendMessage, t);
124
+ let n = { content: e };
125
+ return this.send(t.SendMessage, n);
100
126
  }
101
127
  setInputContent(e) {
102
- let t = { content: e };
103
- return this.send(a.SetInputContent, t);
128
+ let n = { content: e };
129
+ return this.send(t.SetInputContent, n);
104
130
  }
105
131
  setSystemPrompt(e) {
106
- let t = { systemPrompt: e };
107
- return this.send(a.SetSystemPrompt, t);
132
+ let n = { systemPrompt: e };
133
+ return this.send(t.SetSystemPrompt, n);
108
134
  }
109
135
  setTemperature(e) {
110
- let t = { temperature: e };
111
- return this.send(a.SetTemperature, t);
136
+ let n = { temperature: e };
137
+ return this.send(t.SetTemperature, n);
112
138
  }
113
139
  getConversations() {
114
- return this.send(a.GetConversations);
140
+ return this.send(t.GetConversations);
115
141
  }
116
142
  getSelectedConversations() {
117
- return this.send(a.GetSelectedConversations);
143
+ return this.send(t.GetSelectedConversations);
118
144
  }
119
145
  selectConversation(e) {
120
- let t = { id: e };
121
- return this.send(a.SelectConversation, t);
146
+ let n = { id: e };
147
+ return this.send(t.SelectConversation, n);
122
148
  }
123
149
  createConversation(e) {
124
- let t = { ...e };
125
- return this.send(a.CreateConversation, t);
150
+ let n = { ...e };
151
+ return this.send(t.CreateConversation, n);
126
152
  }
127
153
  createLocalConversation() {
128
- return this.send(a.CreateLocalConversation);
154
+ return this.send(t.CreateLocalConversation);
129
155
  }
130
156
  deleteConversation(e) {
131
- let t = { id: e };
132
- return this.send(a.DeleteConversation, t);
157
+ let n = { id: e };
158
+ return this.send(t.DeleteConversation, n);
133
159
  }
134
- renameConversation(e, t) {
135
- let n = {
160
+ renameConversation(e, n) {
161
+ let r = {
136
162
  id: e,
137
- newName: t
163
+ newName: n
138
164
  };
139
- return this.send(a.RenameConversation, n);
165
+ return this.send(t.RenameConversation, r);
140
166
  }
141
167
  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();
168
+ 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
169
  }
144
170
  subscribe(e, t) {
145
171
  let n = this.eventSubscribers.get(e) ?? /* @__PURE__ */ new Set(), r = t;
@@ -162,14 +188,18 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
162
188
  }
163
189
  sendCurrentOverlayOptions() {
164
190
  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 });
191
+ 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);
192
+ let n = this.options.auth?.providerUiModes;
193
+ n !== void 0 && Object.keys(n).length > 0 && (e.authProviderUiModes = n);
194
+ let r = this.options.auth?.autoSignInProvider?.trim();
195
+ return r && (e.authAutoSignInProvider = r), this.send(t.SetOverlayOptions, e, { bypassReadyGate: !0 });
166
196
  }
167
197
  send(e, t, n) {
168
198
  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
199
  }
170
200
  dispatchRequest(e, t) {
171
201
  if (this.isDestroyed) return Promise.reject(/* @__PURE__ */ Error("ChatOverlay: instance was destroyed"));
172
- let n = this.options.requestTimeout ?? m, r = new d(e, n);
202
+ let n = this.options.requestTimeout ?? w, r = new g(e, n);
173
203
  this.pendingRequests.set(r.requestId, r), r.promise.finally(() => {
174
204
  this.pendingRequests.delete(r.requestId);
175
205
  }).catch(() => void 0);
@@ -184,61 +214,65 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
184
214
  handleMessage(e) {
185
215
  if (e.source !== this.iframe.contentWindow) return;
186
216
  let t = e.data;
187
- if (s(t)) {
217
+ if (d(t)) {
188
218
  this.handleResponse(t);
189
219
  return;
190
220
  }
191
- o(t) && this.handleEvent(t);
221
+ f(t) && this.handleEvent(t);
192
222
  }
193
223
  handleResponse(e) {
194
224
  let t = this.pendingRequests.get(e.requestId);
195
- !t || !t.matches(e.type, e.requestId) || (this.pendingRequests.delete(e.requestId), t.resolve(e.payload));
225
+ if (!(!t || !t.matches(e.type, e.requestId))) {
226
+ if (this.pendingRequests.delete(e.requestId), e.error) {
227
+ t.reject(new E(t.requestType, e.error));
228
+ return;
229
+ }
230
+ t.resolve(e.payload);
231
+ }
196
232
  }
197
233
  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);
234
+ let t = e.type;
235
+ 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
236
  }
201
237
  hideLoader() {
202
- this.loader.style.display = "none";
238
+ this.loader.classList.add(b.LoaderHidden), this.loader.style.removeProperty("display");
203
239
  }
204
240
  notifySubscribers(e, t) {
205
241
  this.eventSubscribers.get(e)?.forEach((e) => e(t));
206
242
  }
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) => {
243
+ }, j = 1279, M = 380, N = 600, P = 999999, F = "24px", I = "<svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M4 4h16v12H7l-3 3V4z\"/></svg>", L = "<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>", R = "<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>", z = "dial-overlay-manager-styles", B = "\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", V = () => {
244
+ v(z, B);
245
+ }, H = (e, t) => {
212
246
  let n = document.createElement("button");
213
247
  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) {
248
+ }, U = (e) => typeof e == "number" ? `${e}px` : e, W = /* @__PURE__ */ function(e) {
215
249
  return e.LeftBottom = "left-bottom", e.LeftTop = "left-top", e.RightBottom = "right-bottom", e.RightTop = "right-top", e;
216
- }({}), N = {
250
+ }({}), G = {
217
251
  "right-bottom": {
218
- insetInlineEnd: w,
219
- insetBlockEnd: w,
252
+ insetInlineEnd: F,
253
+ insetBlockEnd: F,
220
254
  insetInlineStart: "auto",
221
255
  insetBlockStart: "auto"
222
256
  },
223
257
  "right-top": {
224
- insetInlineEnd: w,
225
- insetBlockStart: w,
258
+ insetInlineEnd: F,
259
+ insetBlockStart: F,
226
260
  insetInlineStart: "auto",
227
261
  insetBlockEnd: "auto"
228
262
  },
229
263
  "left-bottom": {
230
- insetInlineStart: w,
231
- insetBlockEnd: w,
264
+ insetInlineStart: F,
265
+ insetBlockEnd: F,
232
266
  insetInlineEnd: "auto",
233
267
  insetBlockStart: "auto"
234
268
  },
235
269
  "left-top": {
236
- insetInlineStart: w,
237
- insetBlockStart: w,
270
+ insetInlineStart: F,
271
+ insetBlockStart: F,
238
272
  insetInlineEnd: "auto",
239
273
  insetBlockEnd: "auto"
240
274
  }
241
- }, P = class {
275
+ }, K = class {
242
276
  overlays = /* @__PURE__ */ new Map();
243
277
  abortController = new AbortController();
244
278
  isDestroyed = !1;
@@ -250,9 +284,9 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
250
284
  }
251
285
  createOverlay(e) {
252
286
  if (this.overlays.has(e.overlayId)) throw Error(`ChatOverlayManager: overlay "${e.overlayId}" already exists`);
253
- k();
287
+ V();
254
288
  let t = document.createElement("div");
255
- t.setAttribute("data-dial-overlay-container", e.overlayId), f(t, {
289
+ t.setAttribute("data-dial-overlay-container", e.overlayId), _(t, {
256
290
  display: "flex",
257
291
  flexDirection: "column",
258
292
  overflow: "hidden",
@@ -261,24 +295,24 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
261
295
  background: "#ffffff"
262
296
  });
263
297
  let n = document.createElement("div");
264
- f(n, {
298
+ _(n, {
265
299
  display: "flex",
266
300
  justifyContent: "flex-end",
267
301
  gap: "8px",
268
302
  padding: "8px"
269
303
  });
270
- let r = A(e.closeButtonAriaLabel ?? "Collapse", E);
304
+ let r = H(e.closeButtonAriaLabel ?? "Collapse", L);
271
305
  n.appendChild(r);
272
306
  let i;
273
- e.allowFullscreen && (i = A(e.fullscreenButtonAriaLabel ?? "Open full screen", D), n.appendChild(i));
307
+ e.allowFullscreen && (i = H(e.fullscreenButtonAriaLabel ?? "Open full screen", R), n.appendChild(i));
274
308
  let a = document.createElement("div");
275
- f(a, {
309
+ _(a, {
276
310
  flex: "1",
277
311
  minHeight: "0"
278
312
  }), t.appendChild(n), t.appendChild(a), document.body.appendChild(t);
279
- let o = new y(a, e);
313
+ let o = new A(a, e);
280
314
  e.allowFullscreen && o.allowFullscreen();
281
- let s = A(e.toggleButtonAriaLabel ?? "Open chat", T);
315
+ let s = H(e.toggleButtonAriaLabel ?? "Open chat", I);
282
316
  document.body.appendChild(s);
283
317
  let c = {
284
318
  overlay: o,
@@ -363,16 +397,16 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
363
397
  return t;
364
398
  }
365
399
  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, {
400
+ let { options: t, container: n, toggleButton: r } = e, i = t.position ?? "right-bottom", a = String(t.zIndex ?? P);
401
+ if (_(r, {
368
402
  position: "fixed",
369
403
  zIndex: a,
370
- ...N[i]
371
- }), f(n, {
404
+ ...G[i]
405
+ }), _(n, {
372
406
  position: "fixed",
373
407
  zIndex: a
374
- }), window.innerWidth <= b) {
375
- f(n, {
408
+ }), window.innerWidth <= j) {
409
+ _(n, {
376
410
  insetInlineStart: "0",
377
411
  insetInlineEnd: "0",
378
412
  insetBlockStart: "0",
@@ -383,12 +417,12 @@ var c = "<svg viewBox=\"0 0 50 50\" width=\"32\" height=\"32\" role=\"presentati
383
417
  });
384
418
  return;
385
419
  }
386
- f(n, {
387
- width: j(t.width ?? x),
388
- height: j(t.height ?? S),
389
- ...N[i]
420
+ _(n, {
421
+ width: U(t.width ?? M),
422
+ height: U(t.height ?? N),
423
+ ...G[i]
390
424
  });
391
425
  }
392
426
  };
393
427
  //#endregion
394
- export { y as ChatOverlay, P as ChatOverlayManager, e as OverlayEventType, n as OverlayFeature, M as OverlayPosition, i as OverlayRequestType };
428
+ export { A as ChatOverlay, K as ChatOverlayManager, E as ChatOverlayRequestError, i as DEPRECATED_OVERLAY_FEATURE_ALIASES, e as DIAL_OVERLAY_NAMESPACE, s as OverlayAuthUiMode, n as OverlayEventType, r as OverlayFeature, W as OverlayPosition, c as OverlayRequestErrorCode, t as OverlayRequestType, l as OverlayStageStatus, f as isOverlayMessageEvent, u as isOverlayMessageRequest, d 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,OA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OAAO,CAAC,eAAe;IA+BvB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,iBAAiB;CAO1B"}
@@ -1,4 +1,4 @@
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, 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. */
@@ -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+DnC,2EAA2E;AAC3E,oBAAY,eAAe;IACzB,+DAA+D;IAC/D,UAAU,gBAAgB;IAC1B,4DAA4D;IAC5D,OAAO,aAAa;IACpB,uEAAuE;IACvE,WAAW,iBAAiB;IAC5B,2DAA2D;IAC3D,QAAQ,cAAc;CACv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AE,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,5 +1,7 @@
1
1
  /** A single outstanding overlay request: owns its `requestId` and resolves/rejects when the matching response arrives or the timeout elapses. */
2
2
  export declare class DeferredRequest<T = unknown> {
3
+ /** Exact request type sent to the embedded app. */
4
+ readonly requestType: string;
3
5
  /** Unique id used to match this request to its response message. */
4
6
  readonly requestId: string;
5
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,iJAAiJ;AACjJ,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,14 @@
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
+ /** Injects the `ChatOverlay` stylesheet into `document.head`, once per document. */
13
+ export declare const ensureOverlayStylesInjected: () => void;
14
+ //# 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;AAkDD,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.49",
4
+ "version": "1.1.0-dev.492",
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.49"
20
- },
21
18
  "repository": {
22
19
  "type": "git",
23
20
  "url": "git+https://github.com/epam/ai-dial-chat.git",
@@ -0,0 +1,499 @@
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
+ * Renders every conversation starter, each on its own row, instead of
168
+ * fitting as many as the measured width allows on one line and collapsing
169
+ * the rest into a "…" dropdown. Intended for narrow embeds, where the row
170
+ * has space for a single starter and hides the remainder behind the menu.
171
+ */
172
+ ShowAllStarters = "show-all-starters",
173
+ /**
174
+ * Hides the application version label in the footer. The label is
175
+ * diagnostic chrome an embedding host usually owns itself, and it is not
176
+ * gated by the operator's `footer` capability flag.
177
+ */
178
+ HideFooterVersion = "hide-footer-version"
179
+ }
180
+ /**
181
+ * Wire values a host may still be sending that were renamed, mapped to the
182
+ * canonical `OverlayFeature` member. Accepted for backward compatibility on a
183
+ * transitional basis: a deprecated value resolves to its replacement instead of
184
+ * being dropped. Remove an entry once hosts have migrated, and record the
185
+ * rename in the migration guide's "Renamed flags" table.
186
+ */
187
+ export declare const DEPRECATED_OVERLAY_FEATURE_ALIASES: Readonly<Record<string, OverlayFeature>>;
188
+ /**
189
+ * Resolves a raw wire value to an `OverlayFeature`, accepting the deprecated
190
+ * aliases in `DEPRECATED_OVERLAY_FEATURE_ALIASES`. Returns `undefined` for an
191
+ * unrecognized value so the caller can drop it and warn.
192
+ */
193
+ export declare const resolveOverlayFeature: (value: string) => OverlayFeature | undefined;
194
+ /** Controls how an overlay starts authentication for a configured provider. */
195
+ export declare enum OverlayAuthUiMode {
196
+ /** Opens authentication in a separate browser window or tab. */
197
+ External = "external",
198
+ /** Navigates the embedded overlay window through authentication. */
199
+ SameWindow = "sameWindow"
200
+ }
201
+ /** Machine-readable reasons why an overlay request could not be completed. */
202
+ export declare enum OverlayRequestErrorCode {
203
+ /** The method requires an open conversation, but the composer is currently shown. */
204
+ ActiveConversationUnavailable = "ACTIVE_CONVERSATION_UNAVAILABLE",
205
+ /** The method requires the conversation-list integration, but it is not available. */
206
+ ConversationListUnavailable = "CONVERSATION_LIST_UNAVAILABLE",
207
+ /** The request payload does not match the method contract. */
208
+ InvalidPayload = "INVALID_PAYLOAD",
209
+ /** The embedded chat failed while executing the requested operation. */
210
+ RequestExecutionFailed = "REQUEST_EXECUTION_FAILED"
211
+ }
212
+ /** Structured failure returned for an overlay request. */
213
+ export interface OverlayRequestError {
214
+ /** Stable code suitable for programmatic handling. */
215
+ code: OverlayRequestErrorCode;
216
+ /** Human-readable explanation suitable for logs and diagnostics. */
217
+ message: string;
218
+ }
219
+ /** Settled outcome of an agent execution stage carried over the protocol. */
220
+ export declare enum OverlayStageStatus {
221
+ /** The stage completed successfully. */
222
+ Completed = "completed",
223
+ /** The stage encountered an error. */
224
+ Failed = "failed"
225
+ }
226
+ /**
227
+ * One agent execution stage (a tool call, retrieval step, or reasoning step)
228
+ * projected into the protocol. A host reads these to react to what an agent
229
+ * did — e.g. refreshing its own view when a particular tool has run.
230
+ */
231
+ export interface OverlayMessageStage {
232
+ /** Zero-based ordering key, stable across updates to the same stage. */
233
+ index: number;
234
+ /** Human-readable stage label, e.g. `'Lookup available terms'`. */
235
+ name: string;
236
+ /** `null` while the stage is still running; a settled value once it finishes. */
237
+ status: OverlayStageStatus | null;
238
+ /** Text content accumulated for this stage, when the agent produced any. */
239
+ content?: string;
240
+ /** Short source/category label shown beside the name, e.g. `'MCP'`. */
241
+ tag?: string;
242
+ }
243
+ /** Minimal message shape carried in overlay protocol payloads. */
244
+ export interface OverlayChatMessage {
245
+ /** Message id. */
246
+ id: string;
247
+ /** Author role, e.g. `'user'`, `'assistant'`, or `'system'`. */
248
+ role: string;
249
+ /** Message text content. */
250
+ content: string;
251
+ /**
252
+ * Agent execution stages attached to this message, omitted when it has
253
+ * none. Stage attachments are not carried — the protocol projects labels,
254
+ * status, and text only.
255
+ */
256
+ stages?: OverlayMessageStage[];
257
+ }
258
+ /** Host-agnostic conversation projection for the overlay protocol. */
259
+ export interface OverlayConversation {
260
+ /** Conversation id. */
261
+ id: string;
262
+ /** Conversation title. */
263
+ title: string;
264
+ /** Epoch milliseconds of the conversation's last update. */
265
+ updatedAt: number;
266
+ /** Whether the conversation is pinned. */
267
+ isPinned: boolean;
268
+ /** Whether the current user has read-only access. */
269
+ isReadonly: boolean;
270
+ /** Whether the conversation was shared with the current user. */
271
+ sharedWithMe: boolean;
272
+ /** Whether the conversation was published with the current user. */
273
+ publishedWithMe: boolean;
274
+ }
275
+ /** Error signal carried by conversation-list method responses. */
276
+ export interface OverlayConversationError {
277
+ /** `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). */
278
+ code: 'NOT_FOUND' | 'FORBIDDEN' | 'INVALID_ARGUMENT';
279
+ /** Human-readable description of the failure. */
280
+ message: string;
281
+ }
282
+ /** Options passed to `ChatOverlay`'s constructor. */
283
+ export interface ChatOverlayOptions {
284
+ /** Full URL of the chat app instance to embed (origin + optional path). */
285
+ domain: string;
286
+ /** Milliseconds to wait for a request's response before rejecting. Defaults to `10000`. */
287
+ requestTimeout?: number;
288
+ /**
289
+ * Inline CSS properties applied to the loader element while it is visible.
290
+ * A `display` entry is dropped once `loaderHideEvent` arrives — use
291
+ * `loaderHideEvent` to control visibility, not `display`.
292
+ */
293
+ loaderStyles?: Record<string, string>;
294
+ /** CSS class applied to the loader element. */
295
+ loaderClass?: string;
296
+ /** Custom HTML rendered inside the loader element, replacing the default spinner. */
297
+ loaderInnerHTML?: string;
298
+ /** Event whose receipt hides the loader. Defaults to `OverlayEventType.Ready`. */
299
+ loaderHideEvent?: OverlayEventType;
300
+ /** Embed-time features to enable, e.g. microphone access for voice input. */
301
+ enabledFeatures?: OverlayFeature[];
302
+ /** Theme name applied to the embedded app. */
303
+ theme?: string;
304
+ /** Deployment/model id to select in the embedded app. */
305
+ modelId?: string;
306
+ /** Conversation id the embedded app should load and display. */
307
+ overlayConversationId?: string;
308
+ /** Per-provider authentication UI behavior configured by the embedding host. */
309
+ auth?: {
310
+ providerUiModes?: Record<string, OverlayAuthUiMode>;
311
+ /**
312
+ * Provider id whose login the embedded app starts on its own, with no user
313
+ * interaction, while the session is unauthenticated. Presence enables the
314
+ * behavior — there is no separate boolean — and the same provider must be
315
+ * mapped to `OverlayAuthUiMode.SameWindow` in `providerUiModes`, because
316
+ * only that path navigates the iframe itself. Supersedes the legacy
317
+ * `signInOptions.autoSignIn` + `signInProvider` pair.
318
+ */
319
+ autoSignInProvider?: string;
320
+ };
321
+ }
322
+ /** Payload of a `SET_OVERLAY_OPTIONS` request. */
323
+ export interface SetOverlayOptionsPayload {
324
+ /** Origin of the host page, used by the app to target responses/events. */
325
+ hostDomain: string;
326
+ /** Theme name to apply, if provided. */
327
+ theme?: string;
328
+ /** Deployment/model id to select, if provided. */
329
+ modelId?: string;
330
+ /** Conversation id to navigate to and load, if provided. */
331
+ overlayConversationId?: string;
332
+ /**
333
+ * UI-feature keys that replace (not merge with) the app's current effective
334
+ * UI-feature set, if provided. Array only — no comma-separated-string form.
335
+ */
336
+ enabledFeatures?: string[];
337
+ /** Opaque per-provider authentication UI modes supplied by the host. */
338
+ authProviderUiModes?: Record<string, string>;
339
+ /** Opaque wire form of `ChatOverlayOptions.auth.autoSignInProvider`. */
340
+ authAutoSignInProvider?: string;
341
+ }
342
+ /** Payload of a `SEND_MESSAGE` request. */
343
+ export interface SendMessagePayload {
344
+ /** Text content of the message to send. */
345
+ content: string;
346
+ }
347
+ /** Payload of a `SET_INPUT_CONTENT` request. */
348
+ export interface SetInputContentPayload {
349
+ /** Text content to set in the message input. */
350
+ content: string;
351
+ }
352
+ /** Payload of a `SET_SYSTEM_PROMPT` request. */
353
+ export interface SetSystemPromptPayload {
354
+ /** System prompt to persist on the active conversation. */
355
+ systemPrompt: string;
356
+ }
357
+ /** Payload of a `SET_TEMPERATURE` request. */
358
+ export interface SetTemperaturePayload {
359
+ /** Temperature value to persist on the active conversation. */
360
+ temperature: number;
361
+ }
362
+ /** Payload of a `SELECT_CONVERSATION` request. */
363
+ export interface SelectConversationPayload {
364
+ /** Id of the conversation to select. */
365
+ id: string;
366
+ }
367
+ /** Payload of a `DELETE_CONVERSATION` request. */
368
+ export interface DeleteConversationPayload {
369
+ /** Id of the conversation to delete. */
370
+ id: string;
371
+ }
372
+ /** Payload of a `RENAME_CONVERSATION` request. */
373
+ export interface RenameConversationPayload {
374
+ /** Id of the conversation to rename. */
375
+ id: string;
376
+ /** New title for the conversation. */
377
+ newName: string;
378
+ }
379
+ /** Payload of a `CREATE_CONVERSATION` request. */
380
+ export interface CreateConversationPayload {
381
+ /** Deployment/model id to create the conversation with, if given. */
382
+ deploymentId?: string;
383
+ /** Initial message to persist immediately. Omitted/blank opens the composer instead. */
384
+ firstMessage?: string;
385
+ }
386
+ /** Response payload of a `GET_MESSAGES` request. */
387
+ export interface GetMessagesResponse {
388
+ /** Messages in the active conversation. */
389
+ messages: OverlayChatMessage[];
390
+ }
391
+ /** Response payload of a `SEND_MESSAGE` request. */
392
+ export interface SendMessageResponse {
393
+ /** Messages in the active conversation after the send. */
394
+ messages: OverlayChatMessage[];
395
+ }
396
+ /** Response payload of a `SET_SYSTEM_PROMPT` request. */
397
+ export interface SetSystemPromptResponse {
398
+ /** System prompt value that was persisted. */
399
+ systemPrompt: string;
400
+ }
401
+ /** Response payload of a `SET_TEMPERATURE` request. */
402
+ export interface SetTemperatureResponse {
403
+ /** Temperature value that was persisted. */
404
+ temperature: number;
405
+ }
406
+ /** Response payload of a `SET_OVERLAY_OPTIONS` request. */
407
+ export interface SetOverlayOptionsResponse {
408
+ /** Whether the supplied options were applied (`false` only signals a fallback, never a thrown error). */
409
+ applied: boolean;
410
+ }
411
+ /** Response payload of a `GET_CONVERSATIONS` request. */
412
+ export interface GetConversationsResponse {
413
+ /** The current user's conversation list. */
414
+ conversations: OverlayConversation[];
415
+ }
416
+ /** Response payload of a `GET_SELECTED_CONVERSATIONS` request. */
417
+ export interface GetSelectedConversationsResponse {
418
+ /** Currently displayed conversation(s); empty when no conversation is mounted. */
419
+ conversations: OverlayConversation[];
420
+ }
421
+ /** Response payload of a `SELECT_CONVERSATION` request. */
422
+ export interface SelectConversationResponse {
423
+ /** The now-selected conversation's projection, present on success. */
424
+ conversation?: OverlayConversation;
425
+ /** Present when the selection failed. */
426
+ error?: OverlayConversationError;
427
+ }
428
+ /** Response payload of a `CREATE_CONVERSATION` request. */
429
+ export interface CreateConversationResponse {
430
+ /** The created conversation's projection, or `null` when the composer path was taken. */
431
+ conversation: OverlayConversation | null;
432
+ /** Present when creation failed. */
433
+ error?: OverlayConversationError;
434
+ }
435
+ /** Response payload of a `CREATE_LOCAL_CONVERSATION` request. */
436
+ export interface CreateLocalConversationResponse {
437
+ /** Always `null` — the composer opens without persisting anything. */
438
+ conversation: null;
439
+ }
440
+ /** Response payload of a `DELETE_CONVERSATION` request. */
441
+ export interface DeleteConversationResponse {
442
+ /** Present when deletion failed. */
443
+ error?: OverlayConversationError;
444
+ }
445
+ /** Response payload of a `RENAME_CONVERSATION` request. */
446
+ export interface RenameConversationResponse {
447
+ /** The renamed conversation's projection, present on success. */
448
+ conversation?: OverlayConversation;
449
+ /** Present when the rename failed. */
450
+ error?: OverlayConversationError;
451
+ }
452
+ /**
453
+ * A request message sent from the host (library) to the embedded app.
454
+ * `type` is always `'${OverlayRequestType}'`.
455
+ */
456
+ export interface OverlayMessageRequest<TPayload = unknown> {
457
+ /** Full wire type string, one of the `OverlayRequestType` values. */
458
+ type: `${OverlayRequestType}`;
459
+ /** Unique id used to match this request to its response. */
460
+ requestId: string;
461
+ /**
462
+ * Epoch milliseconds after which the embedded app must stop waiting for
463
+ * prerequisites (such as an active conversation bridge) and drop the request.
464
+ */
465
+ expiresAt?: number;
466
+ /** Request-specific payload. */
467
+ payload?: TPayload;
468
+ }
469
+ /**
470
+ * A response message sent from the embedded app to the host (library),
471
+ * answering a specific request by `requestId`.
472
+ */
473
+ export interface OverlayMessageResponse<TPayload = unknown> {
474
+ /** Full wire type string, always `'${OverlayRequestType}/RESPONSE'`. */
475
+ type: `${OverlayRequestType}/RESPONSE`;
476
+ /** `requestId` of the request this message answers. */
477
+ requestId: string;
478
+ /** Response-specific payload. */
479
+ payload?: TPayload;
480
+ /** Present when the embedded chat could not complete the request. */
481
+ error?: OverlayRequestError;
482
+ }
483
+ /**
484
+ * An event message sent from the embedded app to the host (library),
485
+ * with no associated request (no `requestId` field).
486
+ */
487
+ export interface OverlayMessageEvent<TPayload = unknown> {
488
+ /** Full wire type string, one of the `OverlayEventType` values. */
489
+ type: `${OverlayEventType}`;
490
+ /** Event-specific payload. */
491
+ payload?: TPayload;
492
+ }
493
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageRequest`. */
494
+ export declare const isOverlayMessageRequest: (data: unknown) => data is OverlayMessageRequest;
495
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageResponse`. */
496
+ export declare const isOverlayMessageResponse: (data: unknown) => data is OverlayMessageResponse;
497
+ /** Narrows an arbitrary value to a well-formed `OverlayMessageEvent`. */
498
+ export declare const isOverlayMessageEvent: (data: unknown) => data is OverlayMessageEvent;
499
+ //# 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,s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V,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"}