@salesforce/sdk-chat 1.130.1 → 1.131.0
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -31
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CA6BxE;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 {
|
|
2
|
-
class
|
|
1
|
+
import { wrapSDKPromise as u, getSurface as c, Surface as n, McpAppsSession as d } from "@salesforce/sdk-core";
|
|
2
|
+
class p {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
this.session = t;
|
|
5
5
|
const e = t.getHostContext();
|
|
@@ -134,7 +134,7 @@ class d {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
const r = "openai:set_globals";
|
|
137
|
-
class
|
|
137
|
+
class h {
|
|
138
138
|
sendMessageToHost(t) {
|
|
139
139
|
return window.openai.sendFollowUpMessage({ prompt: t.content });
|
|
140
140
|
}
|
|
@@ -174,7 +174,7 @@ class p {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
class
|
|
177
|
+
class f {
|
|
178
178
|
async sendMessageToHost(t) {
|
|
179
179
|
throw console.warn("SalesforceACCChatSDK.sendMessageToHost: stub implementation", t), new Error("SalesforceACCChatSDK.sendMessageToHost not yet implemented");
|
|
180
180
|
}
|
|
@@ -182,38 +182,43 @@ class h {
|
|
|
182
182
|
return console.warn("SalesforceACCChatSDK.followUpActions: stub implementation"), [];
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
let
|
|
186
|
-
function
|
|
187
|
-
return
|
|
185
|
+
let a = null, i = null;
|
|
186
|
+
function S(s) {
|
|
187
|
+
return a || (a = g(s).then((t) => (i = t, t))), a;
|
|
188
188
|
}
|
|
189
189
|
function b() {
|
|
190
|
-
return
|
|
190
|
+
return i;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
|
|
192
|
+
function C() {
|
|
193
|
+
a = null, i = null;
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
195
|
+
function g(s) {
|
|
196
|
+
return u(
|
|
197
|
+
(async () => {
|
|
198
|
+
switch (c(s?.surface)) {
|
|
199
|
+
case n.OpenAI:
|
|
200
|
+
return new h();
|
|
201
|
+
case n.WebApp:
|
|
202
|
+
case n.Mosaic:
|
|
203
|
+
return {};
|
|
204
|
+
case n.SalesforceACC:
|
|
205
|
+
return new f();
|
|
206
|
+
case n.MicroFrontend:
|
|
207
|
+
case n.MCPApps: {
|
|
208
|
+
const e = await d.getInstance(s?.mcpApps);
|
|
209
|
+
return e.handshakeSucceeded ? new p(e) : {};
|
|
210
|
+
}
|
|
211
|
+
default:
|
|
212
|
+
return {};
|
|
213
|
+
}
|
|
214
|
+
})(),
|
|
215
|
+
"createChatSDK"
|
|
216
|
+
);
|
|
212
217
|
}
|
|
213
218
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
p as MCPAppsChatSDK,
|
|
220
|
+
g as createChatSDK,
|
|
221
|
+
S as getChatSDK,
|
|
217
222
|
b as getChatSDKSync,
|
|
218
|
-
|
|
223
|
+
C as resetChatSDK
|
|
219
224
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sdk-chat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.131.0",
|
|
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.
|
|
29
|
+
"@salesforce/sdk-core": "^1.131.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"vite": "^7.3.1",
|