@salesforce/sdk-core 1.122.2 → 1.126.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/capabilities.d.ts.map +1 -1
- package/dist/index.js +27 -24
- package/dist/surface.d.ts +3 -2
- package/dist/surface.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAEnC,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IAGnB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,MAAM,EAAE,OAAO,CAAC;CAChB;AA0FD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAEnC,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IAGnB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,MAAM,EAAE,OAAO,CAAC;CAChB;AA0FD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAc5E"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o = /* @__PURE__ */ ((e) => (e.WebApp = "WebApp", e.MicroFrontend = "Micro-Frontend", e.OpenAI = "OpenAI", e.SalesforceACC = "Salesforce-ACC", e.MCPApps = "MCP-Apps", e.Mosaic = "Mosaic", e))(o || {});
|
|
2
2
|
const d = f();
|
|
3
3
|
function f() {
|
|
4
|
+
if (typeof window > "u")
|
|
5
|
+
return "Mosaic";
|
|
4
6
|
if (window.openai)
|
|
5
7
|
return "OpenAI";
|
|
6
8
|
try {
|
|
@@ -10,7 +12,7 @@ function f() {
|
|
|
10
12
|
return "Micro-Frontend";
|
|
11
13
|
}
|
|
12
14
|
const e = window;
|
|
13
|
-
return e.$A || e.Aura ? "Salesforce-ACC" : "
|
|
15
|
+
return e.$A || e.Aura ? "Salesforce-ACC" : "WebApp";
|
|
14
16
|
}
|
|
15
17
|
function w(e) {
|
|
16
18
|
return e ?? d;
|
|
@@ -30,7 +32,7 @@ function h(e) {
|
|
|
30
32
|
function g(e) {
|
|
31
33
|
return l(e) && "method" in e && typeof e.method == "string" && !("id" in e);
|
|
32
34
|
}
|
|
33
|
-
function
|
|
35
|
+
function P(e) {
|
|
34
36
|
return l(e) && "id" in e && typeof e.id == "number" && "method" in e && typeof e.method == "string";
|
|
35
37
|
}
|
|
36
38
|
class T {
|
|
@@ -73,7 +75,7 @@ class T {
|
|
|
73
75
|
}
|
|
74
76
|
if (g(t)) {
|
|
75
77
|
const n = this.notificationHandlers.get(t.method);
|
|
76
|
-
n && n.forEach((
|
|
78
|
+
n && n.forEach((i) => i(t.params));
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
81
|
/**
|
|
@@ -90,7 +92,7 @@ class T {
|
|
|
90
92
|
* });
|
|
91
93
|
*/
|
|
92
94
|
request(s, t) {
|
|
93
|
-
const n = this.nextRequestId++,
|
|
95
|
+
const n = this.nextRequestId++, i = {
|
|
94
96
|
jsonrpc: "2.0",
|
|
95
97
|
id: n,
|
|
96
98
|
method: s,
|
|
@@ -100,7 +102,7 @@ class T {
|
|
|
100
102
|
this.pending.set(n, {
|
|
101
103
|
resolve: c,
|
|
102
104
|
reject: a
|
|
103
|
-
}), window.parent?.postMessage(
|
|
105
|
+
}), window.parent?.postMessage(i, "*");
|
|
104
106
|
});
|
|
105
107
|
}
|
|
106
108
|
/**
|
|
@@ -135,7 +137,7 @@ class T {
|
|
|
135
137
|
window.parent?.postMessage(n, "*");
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
|
-
const C = 500,
|
|
140
|
+
const C = 500, M = "2026-01-26";
|
|
139
141
|
class r extends T {
|
|
140
142
|
static initPromise = null;
|
|
141
143
|
hostCtx = {};
|
|
@@ -169,15 +171,15 @@ class r extends T {
|
|
|
169
171
|
async handshake(s) {
|
|
170
172
|
const t = s?.handshakeTimeoutMs ?? C, n = s?.appInfo ?? { name: "mcp-app", version: "1.0.0" };
|
|
171
173
|
try {
|
|
172
|
-
const
|
|
174
|
+
const i = /* @__PURE__ */ Symbol("timeout"), c = await Promise.race([
|
|
173
175
|
this.request("ui/initialize", {
|
|
174
|
-
protocolVersion:
|
|
176
|
+
protocolVersion: M,
|
|
175
177
|
appInfo: n,
|
|
176
178
|
appCapabilities: {}
|
|
177
179
|
}),
|
|
178
|
-
new Promise((a) => setTimeout(() => a(
|
|
180
|
+
new Promise((a) => setTimeout(() => a(i), t))
|
|
179
181
|
]);
|
|
180
|
-
c !==
|
|
182
|
+
c !== i && (this.hostCtx = c.hostContext ?? {}, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (a) => {
|
|
181
183
|
this.hostCtx = {
|
|
182
184
|
...this.hostCtx,
|
|
183
185
|
...a
|
|
@@ -207,7 +209,7 @@ class r extends T {
|
|
|
207
209
|
super.registerNotificationHandler(s, t);
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
|
-
const
|
|
212
|
+
const A = {
|
|
211
213
|
callTool: !0,
|
|
212
214
|
sendMessageToHost: !0,
|
|
213
215
|
readResource: !0,
|
|
@@ -265,7 +267,7 @@ const M = {
|
|
|
265
267
|
displayModal: !1,
|
|
266
268
|
getTheme: !0,
|
|
267
269
|
resize: !1
|
|
268
|
-
},
|
|
270
|
+
}, I = {
|
|
269
271
|
callTool: !1,
|
|
270
272
|
sendMessageToHost: !1,
|
|
271
273
|
readResource: !1,
|
|
@@ -285,30 +287,31 @@ const M = {
|
|
|
285
287
|
getTheme: !1,
|
|
286
288
|
resize: !1
|
|
287
289
|
};
|
|
288
|
-
function
|
|
290
|
+
function S(e) {
|
|
289
291
|
switch (e) {
|
|
290
|
-
case
|
|
291
|
-
return { ...
|
|
292
|
-
case
|
|
292
|
+
case o.MCPApps:
|
|
293
|
+
return { ...A };
|
|
294
|
+
case o.OpenAI:
|
|
293
295
|
return { ...m };
|
|
294
|
-
case
|
|
296
|
+
case o.SalesforceACC:
|
|
295
297
|
return { ...y };
|
|
296
|
-
case
|
|
297
|
-
case
|
|
298
|
+
case o.Mosaic:
|
|
299
|
+
case o.WebApp:
|
|
300
|
+
case o.MicroFrontend:
|
|
298
301
|
default:
|
|
299
|
-
return { ...
|
|
302
|
+
return { ...I };
|
|
300
303
|
}
|
|
301
304
|
}
|
|
302
305
|
export {
|
|
303
306
|
T as JsonRpcClient,
|
|
304
307
|
r as McpAppsSession,
|
|
305
|
-
|
|
308
|
+
o as Surface,
|
|
306
309
|
w as getSurface,
|
|
307
|
-
|
|
310
|
+
S as getSurfaceCapabilities,
|
|
308
311
|
l as isJsonRpcBase,
|
|
309
312
|
u as isJsonRpcErrorResponse,
|
|
310
313
|
g as isJsonRpcNotification,
|
|
311
|
-
|
|
314
|
+
P as isJsonRpcRequest,
|
|
312
315
|
h as isJsonRpcResponse,
|
|
313
316
|
p as isJsonRpcSuccessResponse
|
|
314
317
|
};
|
package/dist/surface.d.ts
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* Enumeration of possible runtime surfaces
|
|
8
8
|
*/
|
|
9
9
|
export declare enum Surface {
|
|
10
|
-
|
|
10
|
+
WebApp = "WebApp",
|
|
11
11
|
MicroFrontend = "Micro-Frontend",
|
|
12
12
|
OpenAI = "OpenAI",
|
|
13
13
|
SalesforceACC = "Salesforce-ACC",
|
|
14
|
-
MCPApps = "MCP-Apps"
|
|
14
|
+
MCPApps = "MCP-Apps",
|
|
15
|
+
Mosaic = "Mosaic"
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Returns the surface to use for SDK initialization.
|
package/dist/surface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,OAAO;IAClB,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,OAAO;IAClB,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,OAAO,aAAa;IACpB,MAAM,WAAW;CACjB;AAoCD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAEtD"}
|