@salesforce/sdk-chat 1.120.4 → 1.120.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAKvF;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD,iEAAiE;IACjE,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAyB9E;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvE,YAAY,EACX,WAAW,EACX,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,QAAQ,EACR,SAAS,GACT,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAKvF;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD,iEAAiE;IACjE,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB9E;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvE,YAAY,EACX,WAAW,EACX,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,QAAQ,EACR,SAAS,GACT,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getSurface as c, Surface as n, McpAppsSession as d } from "@salesforce/sdk-core";
2
- class p {
1
+ import { getSurface as u, Surface as n, McpAppsSession as c } from "@salesforce/sdk-core";
2
+ class d {
3
3
  constructor(t) {
4
4
  this.session = t;
5
5
  const e = t.getHostContext();
@@ -43,7 +43,7 @@ class p {
43
43
  */
44
44
  handleToolCancelled(t) {
45
45
  const o = t.reason ?? "";
46
- this.canceledCallbacks.forEach((u) => u(o));
46
+ this.canceledCallbacks.forEach((r) => r(o));
47
47
  }
48
48
  /**
49
49
  * Request display mode change from host
@@ -133,8 +133,8 @@ class p {
133
133
  this.subscriptions.forEach((t) => t());
134
134
  }
135
135
  }
136
- const r = "openai:set_globals";
137
- class l {
136
+ const l = "openai:set_globals";
137
+ class p {
138
138
  sendMessageToHost(t) {
139
139
  return window.openai.sendFollowUpMessage({ prompt: t.content });
140
140
  }
@@ -169,12 +169,12 @@ class l {
169
169
  }
170
170
  subscribe(t) {
171
171
  const e = () => t();
172
- return window.addEventListener(r, e), () => {
173
- window.removeEventListener(r, e);
172
+ return window.addEventListener(l, e), () => {
173
+ window.removeEventListener(l, e);
174
174
  };
175
175
  }
176
176
  }
177
- class f {
177
+ class h {
178
178
  async sendMessageToHost(t) {
179
179
  throw console.warn("SalesforceACCChatSDK.sendMessageToHost: stub implementation", t), new Error("SalesforceACCChatSDK.sendMessageToHost not yet implemented");
180
180
  }
@@ -184,7 +184,7 @@ class f {
184
184
  }
185
185
  let i = null, a = null;
186
186
  function w(s) {
187
- return i || (i = h(s).then((t) => (a = t, t))), i;
187
+ return i || (i = f(s).then((t) => (a = t, t))), i;
188
188
  }
189
189
  function b() {
190
190
  return a;
@@ -192,26 +192,26 @@ function b() {
192
192
  function S() {
193
193
  i = null, a = null;
194
194
  }
195
- async function h(s) {
196
- switch (c(s?.surface)) {
195
+ async function f(s) {
196
+ switch (u(s?.surface)) {
197
197
  case n.OpenAI:
198
- return new l();
198
+ return new p();
199
199
  case n.UIBundle:
200
- case n.MicroFrontend:
201
200
  return {};
202
201
  case n.SalesforceACC:
203
- return new f();
202
+ return new h();
203
+ case n.MicroFrontend:
204
204
  case n.MCPApps: {
205
- const e = await d.getInstance(s?.mcpApps);
206
- return e.handshakeSucceeded ? new p(e) : window.openai ? new l() : {};
205
+ const e = await c.getInstance(s?.mcpApps);
206
+ return e.handshakeSucceeded ? new d(e) : {};
207
207
  }
208
208
  default:
209
209
  return {};
210
210
  }
211
211
  }
212
212
  export {
213
- p as MCPAppsChatSDK,
214
- h as createChatSDK,
213
+ d as MCPAppsChatSDK,
214
+ f as createChatSDK,
215
215
  w as getChatSDK,
216
216
  b as getChatSDKSync,
217
217
  S as resetChatSDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sdk-chat",
3
- "version": "1.120.4",
3
+ "version": "1.120.7",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "test:coverage": "vitest run --coverage"
27
27
  },
28
28
  "dependencies": {
29
- "@salesforce/sdk-core": "^1.120.4"
29
+ "@salesforce/sdk-core": "^1.120.7"
30
30
  },
31
31
  "devDependencies": {
32
32
  "vite": "^7.3.1",