@salesforce/sdk-core 1.122.1 → 1.123.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.
@@ -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,CAa5E"}
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 i = /* @__PURE__ */ ((e) => (e.UIBundle = "UIBundle", e.MicroFrontend = "Micro-Frontend", e.OpenAI = "OpenAI", e.SalesforceACC = "Salesforce-ACC", e.MCPApps = "MCP-Apps", e))(i || {});
1
+ var o = /* @__PURE__ */ ((e) => (e.UIBundle = "UIBundle", 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 {
@@ -12,7 +14,7 @@ function f() {
12
14
  const e = window;
13
15
  return e.$A || e.Aura ? "Salesforce-ACC" : "UIBundle";
14
16
  }
15
- function w(e) {
17
+ function A(e) {
16
18
  return e ?? d;
17
19
  }
18
20
  function l(e) {
@@ -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 S(e) {
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((o) => o(t.params));
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++, o = {
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(o, "*");
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, I = "2026-01-26";
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 o = /* @__PURE__ */ Symbol("timeout"), c = await Promise.race([
174
+ const i = /* @__PURE__ */ Symbol("timeout"), c = await Promise.race([
173
175
  this.request("ui/initialize", {
174
- protocolVersion: I,
176
+ protocolVersion: M,
175
177
  appInfo: n,
176
178
  appCapabilities: {}
177
179
  }),
178
- new Promise((a) => setTimeout(() => a(o), t))
180
+ new Promise((a) => setTimeout(() => a(i), t))
179
181
  ]);
180
- c !== o && (this.hostCtx = c.hostContext ?? {}, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (a) => {
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 M = {
212
+ const I = {
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
- }, A = {
270
+ }, w = {
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 P(e) {
290
+ function S(e) {
289
291
  switch (e) {
290
- case i.MCPApps:
291
- return { ...M };
292
- case i.OpenAI:
292
+ case o.MCPApps:
293
+ return { ...I };
294
+ case o.OpenAI:
293
295
  return { ...m };
294
- case i.SalesforceACC:
296
+ case o.SalesforceACC:
295
297
  return { ...y };
296
- case i.UIBundle:
297
- case i.MicroFrontend:
298
+ case o.Mosaic:
299
+ case o.UIBundle:
300
+ case o.MicroFrontend:
298
301
  default:
299
- return { ...A };
302
+ return { ...w };
300
303
  }
301
304
  }
302
305
  export {
303
306
  T as JsonRpcClient,
304
307
  r as McpAppsSession,
305
- i as Surface,
306
- w as getSurface,
307
- P as getSurfaceCapabilities,
308
+ o as Surface,
309
+ A as getSurface,
310
+ S as getSurfaceCapabilities,
308
311
  l as isJsonRpcBase,
309
312
  u as isJsonRpcErrorResponse,
310
313
  g as isJsonRpcNotification,
311
- S as isJsonRpcRequest,
314
+ P as isJsonRpcRequest,
312
315
  h as isJsonRpcResponse,
313
316
  p as isJsonRpcSuccessResponse
314
317
  };
package/dist/surface.d.ts CHANGED
@@ -11,7 +11,8 @@ export declare enum Surface {
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.
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,OAAO;IAClB,QAAQ,aAAa;IACrB,aAAa,mBAAmB;IAChC,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,OAAO,aAAa;CACpB;AAgCD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAEtD"}
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,OAAO;IAClB,QAAQ,aAAa;IACrB,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sdk-core",
3
- "version": "1.122.1",
3
+ "version": "1.123.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",