@salesforce/platform-sdk 12.12.1 → 12.13.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.
Files changed (41) hide show
  1. package/dist/analytics/index.js +1 -1
  2. package/dist/{analytics-wESbWdca.js → analytics-TRyVm9Ub.js} +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/{capabilities-B0mU0_G0.js → capabilities-B3Raifjg.js} +2 -1
  5. package/dist/chat/index.d.ts.map +1 -1
  6. package/dist/chat/index.js +11 -10
  7. package/dist/core/capabilities.d.ts +2 -2
  8. package/dist/core/capabilities.d.ts.map +1 -1
  9. package/dist/core/data.d.ts +5 -5
  10. package/dist/core/index.d.ts +2 -2
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/core/index.js +2 -2
  13. package/dist/core/mcpapps-session.d.ts +19 -8
  14. package/dist/core/mcpapps-session.d.ts.map +1 -1
  15. package/dist/core/surface.d.ts +12 -10
  16. package/dist/core/surface.d.ts.map +1 -1
  17. package/dist/core/view.d.ts +118 -4
  18. package/dist/core/view.d.ts.map +1 -1
  19. package/dist/data/index.d.ts +44 -2
  20. package/dist/data/index.d.ts.map +1 -1
  21. package/dist/data/index.js +314 -248
  22. package/dist/data/mcpapps/index.d.ts +9 -0
  23. package/dist/data/mcpapps/index.d.ts.map +1 -0
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +3 -3
  27. package/dist/lightning/index.d.ts.map +1 -1
  28. package/dist/lightning/index.js +5 -4
  29. package/dist/{surface-DWDgqdpN.js → surface-Cg3eyRpj.js} +44 -26
  30. package/dist/ui-embedding/session.js +1 -1
  31. package/dist/view/embedding.d.ts +18 -1
  32. package/dist/view/embedding.d.ts.map +1 -1
  33. package/dist/view/index.d.ts +1 -1
  34. package/dist/view/index.d.ts.map +1 -1
  35. package/dist/view/index.js +79 -35
  36. package/dist/view/utils.d.ts +5 -0
  37. package/dist/view/utils.d.ts.map +1 -1
  38. package/docs/data/02-caching-and-freshness.md +3 -3
  39. package/docs/data/03-reactive-handle-lifecycle.md +2 -2
  40. package/docs/data/04-surfaces-and-guards.md +35 -4
  41. package/package.json +3 -3
@@ -0,0 +1,9 @@
1
+ import { DataSDK, DataSDKGraphQL, McpAppsSession } from '../../core';
2
+ import { ClaudeDataSDKOptions, MCPAppsDataSDKOptions } from '../index';
3
+ export declare class MCPAppsDataSDK implements DataSDK {
4
+ #private;
5
+ readonly graphql: DataSDKGraphQL;
6
+ readonly apiVersion: string;
7
+ constructor(session: McpAppsSession, options?: ClaudeDataSDKOptions | MCPAppsDataSDKOptions);
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mcpapps/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,OAAO,EACP,cAAc,EAGd,cAAc,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA8D5E,qBAAa,cAAe,YAAW,OAAO;;IAC7C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAGhB,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,qBAAqB;CAqE3F"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  export * from './core';
7
7
  export { createChatSDK, type ChatSDKOptions, MCPAppsChatSDK, getChatSDK, getChatSDKSync, resetChatSDK, } from './chat';
8
8
  export { createViewSDK, type ViewSDKOptions, MCPAppsViewSDK, getViewSDK, getViewSDKSync, resetViewSDK, } from './view';
9
- export { createDataSDK, defineDataExtension, type DataSDKOptions, type DataSDKExtension, type DataSDKWithExtensions, type WebAppDataSDKOptions, type MosaicDataSDKOptions, type StatusCallback, type NodeOfConnection, gql, } from './data';
9
+ export { createDataSDK, defineDataExtension, type DataSDKOptions, type DataSDKExtension, type DataSDKWithExtensions, type WebAppDataSDKOptions, type MosaicDataSDKOptions, type ClaudeDataSDKOptions, type MCPAppsDataSDKOptions, type StatusCallback, type NodeOfConnection, gql, } from './data';
10
10
  export { createLightningSDK, type LightningSDKOptions } from './lightning';
11
11
  export { getCurrentApp, type CurrentAppOptions, type AppIdentity, type CurrentApp, WebAppCurrentApp, } from './app';
12
12
  export { createTelemetryTransport, registerTelemetryUploader, TelemetryUploader, type TelemetryTransport, type TelemetryTransportOptions, type EnvelopeEntry, type EnvelopeMetadata, type TelemetryUploaderOptions, type OnEnvelopeCallback, type FlushReason, type TelemetryUploadContext, type TelemetryUploaderErrorContext, type InstrumentedAppLike, type DisposeOptions, } from './telemetry';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,KAAK,cAAc,EACnB,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,GAAG,GACH,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG3E,OAAO,EACN,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,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EACzB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-DWDgqdpN.js";
2
- import { g as c } from "./capabilities-B0mU0_G0.js";
1
+ import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-Cg3eyRpj.js";
2
+ import { g as c } from "./capabilities-B3Raifjg.js";
3
3
  import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
4
  import { MCPAppsChatSDK as n, createChatSDK as K, getChatSDK as l, getChatSDKSync as x, resetChatSDK as A } from "./chat/index.js";
5
5
  import { MCPAppsViewSDK as d, createViewSDK as w, getViewSDK as T, getViewSDKSync as h, resetViewSDK as u } from "./view/index.js";
@@ -8,7 +8,7 @@ import { createLightningSDK as E } from "./lightning/index.js";
8
8
  import { WebAppCurrentApp as I, getCurrentApp as U } from "./app/index.js";
9
9
  import { c as q } from "./transport-D9QstWle.js";
10
10
  import { T as F, r as L } from "./TelemetryUploader-DKkdppe9.js";
11
- import { P as W, c as Y, v as j } from "./analytics-wESbWdca.js";
11
+ import { P as W, c as Y, v as j } from "./analytics-TRyVm9Ub.js";
12
12
  export {
13
13
  n as MCPAppsChatSDK,
14
14
  d as MCPAppsViewSDK,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lightning/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGxD;;GAEG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;CAAG;AAE1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CA6BvF;AAED,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lightning/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGxD;;GAEG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;CAAG;AAE1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8BvF;AAED,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
- import { g as n, S as r } from "../surface-DWDgqdpN.js";
2
- import { w as a } from "../sdk-promise-D0sy7OW1.js";
1
+ import { g as a, S as r } from "../surface-Cg3eyRpj.js";
2
+ import { w as n } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as c } from "../ui-embedding/session.js";
4
4
  class t {
5
5
  // @ts-expect-error TS6138: `session` stays unread until the first method body lands
@@ -13,11 +13,11 @@ class t {
13
13
  }
14
14
  }
15
15
  function f(s) {
16
- return a(
16
+ return n(
17
17
  (async () => {
18
18
  let e;
19
19
  try {
20
- e = await n(s?.surface);
20
+ e = await a(s?.surface);
21
21
  } catch {
22
22
  return {};
23
23
  }
@@ -28,6 +28,7 @@ function f(s) {
28
28
  return {};
29
29
  case r.MicroFrontend:
30
30
  return t.create();
31
+ case r.Claude:
31
32
  case r.MCPApps:
32
33
  return {};
33
34
  case r.Mosaic:
@@ -1,16 +1,17 @@
1
- import { readHostMetaData as p } from "@salesforce/sf-embedding-bridge";
2
- import { JsonRpcClient as d, WindowPostMessageTransport as f } from "@salesforce/jsonrpc";
1
+ import { readHostMetaData as d } from "@salesforce/sf-embedding-bridge";
2
+ import { JsonRpcClient as p, WindowPostMessageTransport as f } from "@salesforce/jsonrpc";
3
3
  class h extends Error {
4
4
  constructor() {
5
5
  super(
6
- "MCPApps surface requires a completed SEP-1865 handshake, but it has not succeeded. This usually means `{ surface: Surface.MCPApps }` was forced outside a real MCP Apps host, or the handshake timed out. Omit the surface override to let detection fall back gracefully."
6
+ "MCP Apps surfaces require a completed SEP-1865 handshake, but it has not succeeded. This usually means `{ surface: Surface.MCPApps }` or `{ surface: Surface.Claude }` was forced outside a real MCP Apps host, or the handshake timed out. Omit the surface override to let detection fall back gracefully."
7
7
  ), this.name = "McpAppsNotAvailableError";
8
8
  }
9
9
  }
10
10
  const l = 500, m = "2026-01-26";
11
- class s extends d {
11
+ class s extends p {
12
12
  static initPromise = null;
13
13
  hostCtx = {};
14
+ _hostInfo;
14
15
  _handshakeSucceeded = !1;
15
16
  /**
16
17
  * Gets or creates the shared session singleton.
@@ -53,18 +54,18 @@ class s extends d {
53
54
  async handshake(t) {
54
55
  const n = t?.handshakeTimeoutMs ?? l, i = t?.appInfo ?? { name: "mcp-app", version: "1.0.0" };
55
56
  try {
56
- const c = /* @__PURE__ */ Symbol("timeout"), u = await Promise.race([
57
+ const u = /* @__PURE__ */ Symbol("timeout"), o = await Promise.race([
57
58
  this.request("ui/initialize", {
58
59
  protocolVersion: m,
59
60
  appInfo: i,
60
61
  appCapabilities: {}
61
62
  }),
62
- new Promise((o) => setTimeout(() => o(c), n))
63
+ new Promise((c) => setTimeout(() => c(u), n))
63
64
  ]);
64
- u !== c && (this.hostCtx = u.hostContext ?? {}, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (o) => {
65
+ o !== u && (this.hostCtx = o.hostContext ?? {}, this._hostInfo = o.hostInfo, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (c) => {
65
66
  this.hostCtx = {
66
67
  ...this.hostCtx,
67
- ...o
68
+ ...c
68
69
  };
69
70
  }), this.sendNotification("ui/notifications/initialized"));
70
71
  } catch {
@@ -74,6 +75,10 @@ class s extends d {
74
75
  getHostContext() {
75
76
  return this.hostCtx;
76
77
  }
78
+ /** Returns the host identity from the handshake, or `undefined` when the host sent none. */
79
+ getHostInfo() {
80
+ return this._hostInfo;
81
+ }
77
82
  /** True when the `ui/initialize` handshake completed successfully, without timing out. */
78
83
  get handshakeSucceeded() {
79
84
  return this._handshakeSucceeded;
@@ -91,25 +96,38 @@ class s extends d {
91
96
  super.registerNotificationHandler(t, n);
92
97
  }
93
98
  }
94
- var w = /* @__PURE__ */ ((e) => (e.WebApp = "WebApp", e.MicroFrontend = "Micro-Frontend", e.OpenAI = "OpenAI", e.MCPApps = "MCP-Apps", e.Mosaic = "Mosaic", e))(w || {});
99
+ var w = /* @__PURE__ */ ((e) => (e.WebApp = "WebApp", e.MicroFrontend = "Micro-Frontend", e.OpenAI = "OpenAI", e.MCPApps = "MCP-Apps", e.Mosaic = "Mosaic", e.Claude = "Claude", e))(w || {});
100
+ const g = /claude/i;
95
101
  let r = null, a;
96
- function g(e, t) {
102
+ function A(e, t) {
97
103
  const n = e ?? {}, i = t ?? {};
98
104
  return n.targetOrigin === i.targetOrigin && n.handshakeTimeoutMs === i.handshakeTimeoutMs && n.appInfo?.name === i.appInfo?.name && n.appInfo?.version === i.appInfo?.version;
99
105
  }
100
- async function A() {
101
- return typeof window > "u" ? "Mosaic" : window.openai ? "OpenAI" : y() ? P() ? "Micro-Frontend" : (await s.getInstance(a)).handshakeSucceeded ? "MCP-Apps" : "WebApp" : "WebApp";
106
+ async function C() {
107
+ if (typeof window > "u")
108
+ return "Mosaic";
109
+ if (window.openai)
110
+ return "OpenAI";
111
+ if (!M())
112
+ return "WebApp";
113
+ if (y())
114
+ return "Micro-Frontend";
115
+ const e = await s.getInstance(a);
116
+ if (!e.handshakeSucceeded)
117
+ return "WebApp";
118
+ const t = e.getHostInfo()?.name;
119
+ return typeof t == "string" && g.test(t) ? "Claude" : "MCP-Apps";
102
120
  }
103
- async function M(e) {
121
+ async function I(e) {
104
122
  if (!r)
105
- a = e?.mcpApps, r = A();
106
- else if (e?.mcpApps && !g(e.mcpApps, a))
123
+ a = e?.mcpApps, r = C();
124
+ else if (e?.mcpApps && !A(e.mcpApps, a))
107
125
  throw new Error(
108
126
  "initialize() was already called with different MCP Apps options. The MCP Apps session is per-page and configured once: call initialize() with your options before creating any SDK (SDK factories auto-initialize with defaults, which can pre-empt a later call)."
109
127
  );
110
128
  return r;
111
129
  }
112
- function y() {
130
+ function M() {
113
131
  if (typeof window > "u") return !1;
114
132
  try {
115
133
  return window.parent !== window;
@@ -117,7 +135,7 @@ function y() {
117
135
  return !0;
118
136
  }
119
137
  }
120
- function P() {
138
+ function y() {
121
139
  if (typeof window > "u") return !1;
122
140
  try {
123
141
  if (window.parent === window) return !1;
@@ -125,25 +143,25 @@ function P() {
125
143
  return !1;
126
144
  }
127
145
  const e = window.location?.search;
128
- return typeof e != "string" ? !1 : p(e) !== null;
146
+ return typeof e != "string" ? !1 : d(e) !== null;
129
147
  }
130
- async function O(e) {
131
- const t = await M();
148
+ async function k(e) {
149
+ const t = await I();
132
150
  if (e == null)
133
151
  return t;
134
- if (e === "MCP-Apps" && !(await s.getInstance(a)).handshakeSucceeded)
152
+ if ((e === "MCP-Apps" || e === "Claude") && !(await s.getInstance(a)).handshakeSucceeded)
135
153
  throw new h();
136
154
  return e;
137
155
  }
138
- function k() {
156
+ function b() {
139
157
  r = null, a = void 0, s.resetInstance();
140
158
  }
141
159
  export {
142
160
  h as M,
143
161
  w as S,
144
162
  s as a,
145
- P as b,
146
- O as g,
147
- M as i,
148
- k as r
163
+ y as b,
164
+ k as g,
165
+ I as i,
166
+ b as r
149
167
  };
@@ -1,5 +1,5 @@
1
1
  import { bootstrapSession as t } from "@salesforce/sf-embedding-bridge";
2
- import { b as i } from "../surface-DWDgqdpN.js";
2
+ import { b as i } from "../surface-Cg3eyRpj.js";
3
3
  let r;
4
4
  if (i()) {
5
5
  const n = t();
@@ -1,4 +1,4 @@
1
- import { UiState, ViewSDK } from '../core';
1
+ import { ModalOptions, ModalResult, PageReference, ToastOptions, UiState, ViewSDK } from '../core';
2
2
  /** Pixel-only dimension string: bare number or `Npx`. The empty string is allowed so a caller can omit one axis. */
3
3
  export type PixelSize = `${number}` | `${number}px` | "";
4
4
  /**
@@ -67,6 +67,23 @@ export declare class EmbeddingViewSDK extends EventTarget implements ViewSDK {
67
67
  clearDirtyState(label?: string): Promise<void>;
68
68
  /** Resize the embedded surface. Pass `""` for either axis to leave it unchanged; both empty is a no-op. */
69
69
  resize(width: PixelSize, height: PixelSize): Promise<void>;
70
+ /**
71
+ * Ask the host to navigate (`ui/navigate-to`); the host drives Lightning navigation. A URL
72
+ * string is sent as a `standard__webPage` page reference; a page reference is sent as is.
73
+ * Rejects when the page reference is not structured-cloneable.
74
+ */
75
+ navigateTo(destination: string | PageReference): Promise<void>;
76
+ /**
77
+ * Ask the host to show a toast (`ui/display-toast`). Resolves once the host queues the
78
+ * toast, not when it is dismissed. `level` maps to the host's toast `variant`.
79
+ */
80
+ displayToast(options: ToastOptions): Promise<void>;
81
+ /**
82
+ * Ask the host to open a registered modal component (`ui/display-modal`). Resolves only
83
+ * when the user dismisses the modal, with its close result; rejects when the host does
84
+ * not register `componentReference` or when `params` is not structured-cloneable.
85
+ */
86
+ displayModal(options: ModalOptions): Promise<ModalResult>;
70
87
  /**
71
88
  * Send an event to the host over the wire. Private wire-layer plumbing; the public
72
89
  * entry point is {@link dispatchEvent}, which calls this in addition to notifying
@@ -1 +1 @@
1
- {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS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AQzB;;;;;;;;;;;;;;;OAeG;YACW,oBAAoB;IAyBlC;;;;;;;;OAQG;YACW,kBAAkB;IA2BhC,OAAO,CAAC,QAAQ;CAOhB"}
@@ -25,5 +25,5 @@ export interface ViewSDKOptions extends SDKOptions {
25
25
  export declare function createViewSDK(options?: ViewSDKOptions): Promise<ViewSDK>;
26
26
  export { MCPAppsViewSDK } from './mcpapps';
27
27
  export { getViewSDK, getViewSDKSync, resetViewSDK } from './singleton';
28
- export type { AlertOptions, ModalOptions, SDKOptions, Theme, ThemeMode, ToastOptions, UiState, UiStyles, ViewSDK, } from '../core';
28
+ export type { AlertOptions, ModalOptions, ModalResult, PageAttributes, PageReference, SDKOptions, Theme, ThemeMode, ToastOptions, UiState, UiStyles, ViewSDK, } from '../core';
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAKnD;;;;;;GAMG;AAEH,MAAM,WAAW,cAAe,SAAQ,UAAU;CAAG;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAgCxE;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvE,YAAY,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAKnD;;;;;;GAMG;AAEH,MAAM,WAAW,cAAe,SAAQ,UAAU;CAAG;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAiCxE;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvE,YAAY,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,UAAU,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,SAAS,CAAC"}
@@ -1,7 +1,7 @@
1
- import { g as h, S as n, a as w } from "../surface-DWDgqdpN.js";
1
+ import { g as m, S as a, a as w } from "../surface-Cg3eyRpj.js";
2
2
  import { w as p } from "../sdk-promise-D0sy7OW1.js";
3
- import { requireSharedSession as m } from "../ui-embedding/session.js";
4
- function f(i) {
3
+ import { requireSharedSession as b } from "../ui-embedding/session.js";
4
+ function g(i) {
5
5
  switch (i) {
6
6
  case "info":
7
7
  return "ℹ️";
@@ -15,8 +15,8 @@ function f(i) {
15
15
  return "ℹ️";
16
16
  }
17
17
  }
18
- function u(i, e) {
19
- return `${f(e)} ${i}`;
18
+ function l(i, e) {
19
+ return `${g(e)} ${i}`;
20
20
  }
21
21
  function o(i, e) {
22
22
  const s = i.trim();
@@ -34,14 +34,22 @@ function o(i, e) {
34
34
  error: `Invalid ${e}: "${i}". Value must be a positive number.`
35
35
  } : { success: !0, value: r };
36
36
  }
37
- const b = "trackdirtystate";
38
- class l extends EventTarget {
37
+ function h(i, e) {
38
+ try {
39
+ structuredClone(e);
40
+ } catch (s) {
41
+ const t = s instanceof Error ? s.message : String(s);
42
+ throw new Error(`${i}: options must be structured-cloneable (${t})`, { cause: s });
43
+ }
44
+ }
45
+ const f = "trackdirtystate";
46
+ class u extends EventTarget {
39
47
  constructor(e) {
40
48
  super(), this.session = e;
41
49
  }
42
50
  session;
43
51
  static async create() {
44
- const e = await m("EmbeddingViewSDK"), s = new l(e);
52
+ const e = await b("EmbeddingViewSDK"), s = new u(e);
45
53
  return await Promise.all([s.subscribeToHostEvent(), s.subscribeToUiState()]), s;
46
54
  }
47
55
  // Latest snapshot, refreshed on every host push. Session-scoped — the wire subscription
@@ -126,6 +134,41 @@ class l extends EventTarget {
126
134
  ...r.value !== void 0 ? { height: r.value } : {}
127
135
  });
128
136
  }
137
+ /**
138
+ * Ask the host to navigate (`ui/navigate-to`); the host drives Lightning navigation. A URL
139
+ * string is sent as a `standard__webPage` page reference; a page reference is sent as is.
140
+ * Rejects when the page reference is not structured-cloneable.
141
+ */
142
+ async navigateTo(e) {
143
+ const s = typeof e == "string" ? { type: "standard__webPage", attributes: { url: e } } : e;
144
+ h("navigateTo", s), await this.session.bridge.sendNavigateTo(s);
145
+ }
146
+ /**
147
+ * Ask the host to show a toast (`ui/display-toast`). Resolves once the host queues the
148
+ * toast, not when it is dismissed. `level` maps to the host's toast `variant`.
149
+ */
150
+ async displayToast(e) {
151
+ await this.session.bridge.sendDisplayToast({
152
+ message: e.message,
153
+ ...e.title !== void 0 ? { title: e.title } : {},
154
+ ...e.level !== void 0 ? { variant: e.level } : {},
155
+ ...e.mode !== void 0 ? { mode: e.mode } : {}
156
+ });
157
+ }
158
+ /**
159
+ * Ask the host to open a registered modal component (`ui/display-modal`). Resolves only
160
+ * when the user dismisses the modal, with its close result; rejects when the host does
161
+ * not register `componentReference` or when `params` is not structured-cloneable.
162
+ */
163
+ async displayModal(e) {
164
+ const s = {
165
+ component: e.componentReference,
166
+ ...e.params !== void 0 ? { attributes: e.params } : {},
167
+ ...e.size !== void 0 ? { size: e.size } : {},
168
+ ...e.label !== void 0 ? { label: e.label } : {}
169
+ };
170
+ return h("displayModal", s), this.session.bridge.sendDisplayModal(s);
171
+ }
129
172
  /**
130
173
  * Send an event to the host over the wire. Private wire-layer plumbing; the public
131
174
  * entry point is {@link dispatchEvent}, which calls this in addition to notifying
@@ -205,14 +248,14 @@ class l extends EventTarget {
205
248
  }
206
249
  }
207
250
  setDirty(e, s) {
208
- this.session.bridge.sendEventDispatch(b, {
251
+ this.session.bridge.sendEventDispatch(f, {
209
252
  isDirty: e,
210
253
  instanceId: this.session.hostMetaData.instanceId,
211
254
  label: s ?? ""
212
255
  });
213
256
  }
214
257
  }
215
- class g {
258
+ class v {
216
259
  constructor(e) {
217
260
  this.session = e;
218
261
  }
@@ -223,7 +266,7 @@ class g {
223
266
  * @param level - The message severity level (defaults to "info")
224
267
  */
225
268
  async sendMessage(e, s = "info") {
226
- const t = u(e, s);
269
+ const t = l(e, s);
227
270
  await this.session.request("ui/message", {
228
271
  role: "user",
229
272
  content: [
@@ -258,13 +301,13 @@ class g {
258
301
  return t.value !== void 0 && (c.width = t.value), r.value !== void 0 && (c.height = r.value), this.session.sendNotification("ui/notifications/size-changed", c), Promise.resolve();
259
302
  }
260
303
  }
261
- class v {
304
+ class y {
262
305
  async displayAlert(e) {
263
- const s = e.level || "info", t = u(e.message, s);
306
+ const s = e.level || "info", t = l(e.message, s);
264
307
  await window.openai.sendFollowUpMessage({ prompt: t });
265
308
  }
266
309
  async displayToast(e) {
267
- const s = e.level || "info", t = u(e.message, s);
310
+ const s = e.level || "info", t = l(e.message, s);
268
311
  await window.openai.sendFollowUpMessage({ prompt: t });
269
312
  }
270
313
  async displayModal(e) {
@@ -278,31 +321,32 @@ class v {
278
321
  return e ? { mode: e } : null;
279
322
  }
280
323
  }
281
- let a = null, d = null;
282
- function M(i) {
283
- return a || (a = y(i).then((e) => (d = e, e))), a;
324
+ let n = null, d = null;
325
+ function T(i) {
326
+ return n || (n = S(i).then((e) => (d = e, e))), n;
284
327
  }
285
- function T() {
328
+ function V() {
286
329
  return d;
287
330
  }
288
- function V() {
289
- a = null, d = null;
331
+ function K() {
332
+ n = null, d = null;
290
333
  }
291
- function y(i) {
334
+ function S(i) {
292
335
  return p(
293
336
  (async () => {
294
337
  try {
295
- switch (await h(i?.surface)) {
296
- case n.OpenAI:
297
- return new v();
298
- case n.WebApp:
299
- case n.Mosaic:
338
+ switch (await m(i?.surface)) {
339
+ case a.OpenAI:
340
+ return new y();
341
+ case a.WebApp:
342
+ case a.Mosaic:
300
343
  return {};
301
- case n.MicroFrontend:
302
- return await l.create();
303
- case n.MCPApps: {
344
+ case a.MicroFrontend:
345
+ return await u.create();
346
+ case a.Claude:
347
+ case a.MCPApps: {
304
348
  const s = await w.getInstance();
305
- return new g(s);
349
+ return new v(s);
306
350
  }
307
351
  default:
308
352
  return {};
@@ -315,9 +359,9 @@ function y(i) {
315
359
  );
316
360
  }
317
361
  export {
318
- g as MCPAppsViewSDK,
319
- y as createViewSDK,
320
- M as getViewSDK,
321
- T as getViewSDKSync,
322
- V as resetViewSDK
362
+ v as MCPAppsViewSDK,
363
+ S as createViewSDK,
364
+ T as getViewSDK,
365
+ V as getViewSDKSync,
366
+ K as resetViewSDK
323
367
  };
@@ -56,4 +56,9 @@ export type ParseDimensionResult = {
56
56
  * parseDimension("50%", "width") // Returns { success: false, error: "Invalid width..." }
57
57
  */
58
58
  export declare function parseDimension(value: string, dimensionName: string): ParseDimensionResult;
59
+ /**
60
+ * Throw if `payload` cannot be structured-cloned. The transport drops an uncloneable message
61
+ * silently, so without this check the request would never settle.
62
+ */
63
+ export declare function assertCloneable(method: string, payload: unknown): void;
59
64
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/view/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAa3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAGnF;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC/B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,oBAAoB,CAiCzF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/view/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAa3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAGnF;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC/B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,oBAAoB,CAiCzF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAOtE"}
@@ -13,8 +13,8 @@ buildCacheServices: dist/data/shared/graphql/cache/services.d.ts
13
13
  # Caching & freshness
14
14
 
15
15
  > **Surface caveat up front:** everything about _caching_ here is the **WebApp surface**. On the
16
- > uncached surfaces (Mosaic, OpenAI) there is no cache — see
17
- > [Uncached surfaces](#uncached-surfaces-mosaic-openai) below and
16
+ > uncached surfaces (Mosaic, OpenAI, Claude, MCPApps) there is no cache — see
17
+ > [Uncached surfaces](#uncached-surfaces-mosaic-openai-claude-mcpapps) below and
18
18
  > [04-surfaces-and-guards.md](./04-surfaces-and-guards.md). The `query`/`mutate` shape is identical
19
19
  > on every surface, so call sites stay portable.
20
20
 
@@ -169,7 +169,7 @@ a held query (see [Refresh after a mutation](./03-reactive-handle-lifecycle.md#r
169
169
  pushes to existing subscribers** and is a method on a live handle, while `no-cache` is a fresh
170
170
  one-shot call with no subscribers.
171
171
 
172
- ## Uncached surfaces (Mosaic, OpenAI)
172
+ ## Uncached surfaces (Mosaic, OpenAI, Claude, MCPApps)
173
173
 
174
174
  - **No cache exists.** Every `query()` is a network request.
175
175
  - **`cacheControl` is silently ignored** — `"no-cache"`, `"only-if-cached"`, and `max-age` have no
@@ -78,7 +78,7 @@ one-shot `cacheControl` — is a strategy call. See the two-refresh-tools table
78
78
 
79
79
  ## Uncached surfaces
80
80
 
81
- On Mosaic / OpenAI the handle exists but `subscribe` only emits in response to `refresh()` — there
81
+ On Mosaic / OpenAI / Claude / MCPApps the handle exists but `subscribe` only emits in response to `refresh()` — there
82
82
  is no background cache to push updates, and each `refresh()` costs a network request. See
83
- [Uncached surfaces](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai) and
83
+ [Uncached surfaces](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai-claude-mcpapps) and
84
84
  [04-surfaces-and-guards.md](./04-surfaces-and-guards.md).
@@ -5,6 +5,8 @@ DataSDKOptions: dist/data/index.d.ts
5
5
  WebAppDataSDKOptions: dist/data/index.d.ts
6
6
  StatusCallback: dist/data/index.d.ts
7
7
  MosaicDataSDKOptions: dist/data/mosaic/index.d.ts
8
+ ClaudeDataSDKOptions: dist/data/index.d.ts
9
+ MCPAppsDataSDKOptions: dist/data/index.d.ts
8
10
  NodeOfConnection: dist/data/index.d.ts
9
11
  -->
10
12
 
@@ -20,7 +22,7 @@ to read `errors`, the resolved `apiVersion`, and the per-surface options.
20
22
  ## `apiVersion` — the resolved adapter version
21
23
 
22
24
  `sdk.apiVersion` is the optional, read-only Salesforce API version selected by the resolved surface
23
- adapter. WebApp and Mosaic expose it and derive their data request paths from that same value;
25
+ adapter. WebApp, Mosaic, Claude, and MCPApps expose it and derive their data request paths from that same value;
24
26
  `apiVersion: "63.0"`, for example, produces paths under `/services/data/v63.0`. Tool-backed OpenAI
25
27
  and degraded surfaces do not expose a comparable org request version, so the property is absent.
26
28
 
@@ -69,6 +71,14 @@ What it carries, per surface:
69
71
  rather than assuming it.
70
72
  - **OpenAI** — no `.fetch`. That surface exposes only `.graphql` via an MCP tool, so guard for
71
73
  `.fetch`'s absence rather than assuming it.
74
+ - **Claude / MCPApps** — no `.fetch`. Only `.graphql` is exposed through H360 dispatch tools.
75
+ A successful SEP-1865 handshake is required; failed verification or session acquisition degrades
76
+ to an empty SDK. Feature-detect both members rather than assuming host support.
77
+ Queries go through the `dispatch_readonly` tool and mutations through `dispatch`. The host must
78
+ expose both (the H360 MCP server); when a tool is missing, the call fails with "Data SDK GraphQL
79
+ dispatch tool is unavailable." In Core, `dispatch` is gated by
80
+ `orgAccessCheck(isHeadless360McpDispatchToolEnabled)`, but `dispatch_readonly` has no such check.
81
+ An org can therefore have working queries and failing mutations.
72
82
 
73
83
  Two things `.fetch` does **not** do, both by contrast with `.graphql`:
74
84
 
@@ -138,14 +148,35 @@ declarations own the field lists — this is just the routing:
138
148
  `accessToken` / `apiVersion`. Uncached.
139
149
  - **OpenAI** — no surface options bag; delegates to an MCP tool. Uncached, and it exposes no header
140
150
  channel, so per-request `headers` are ignored there.
141
-
142
- ## Uncached surfaces (Mosaic, OpenAI)
151
+ - **Claude** — `ClaudeDataSDKOptions` (`options.claude`) and **MCPApps** — `MCPAppsDataSDKOptions`
152
+ (`options.mcpApps`): separate bags, each read only on its own surface. Both currently carry
153
+ `apiVersion`, defaulting to the SDK's existing `API_VERSION`; an override such as `"66.0"` selects
154
+ `/services/data/v66.0/graphql` and is exposed as `sdk.apiVersion`. Extension `minApiVersion`
155
+ checks apply before setup. Session configuration (origin, identity, handshake timeout) belongs to
156
+ `initialize`, not these option bags.
157
+
158
+ ### Claude / MCPApps H360 transport
159
+
160
+ Queries call `tools/call` with `dispatch_readonly`, `method: "GET"`, and
161
+ `queryParams.queryInput` containing JSON `{ query, variables?, operationName? }`. Mutations call
162
+ `dispatch` with `method: "POST"` and the same input object as `body`. Nullish optional fields are
163
+ omitted; per-request headers are not forwarded. Authentication stays with the host/session.
164
+
165
+ The adapter unwraps the dispatch envelope `{ status_code, body, url }`, preferring
166
+ `structuredContent` whenever present. JSON text content is a fallback only when structured content
167
+ is absent. The status must be numeric and the GraphQL body must be an object with its own `data`
168
+ or `errors`; string bodies and malformed payloads are rejected. `data: null` and errors-only bodies
169
+ are valid GraphQL responses. Tool errors, non-2xx statuses, and `error_code` never count as success.
170
+ Failures surface through `result.errors`: valid GraphQL errors are preserved, while transport and
171
+ malformed-envelope errors use safe generic messages without dumping URLs, queries, or bodies.
172
+
173
+ ## Uncached surfaces (Mosaic, OpenAI, Claude, MCPApps)
143
174
 
144
175
  - No cache exists — every `query()` is a network request, and `cacheControl` is silently ignored.
145
176
  - `subscribe` is real but only emits in response to `refresh()`.
146
177
 
147
178
  The full uncached-surface behaviour and the caching model it contrasts with are in
148
- [02-caching-and-freshness.md](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai) and
179
+ [02-caching-and-freshness.md](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai-claude-mcpapps) and
149
180
  [03-reactive-handle-lifecycle.md](./03-reactive-handle-lifecycle.md). The `query`/`mutate` shape is
150
181
  identical across surfaces, so the same call site runs everywhere — only caching differs.
151
182
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "12.12.1",
3
+ "version": "12.13.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -147,8 +147,8 @@
147
147
  "@conduit-client/service-pubsub": "3.19.6",
148
148
  "@conduit-client/service-retry": "3.19.6",
149
149
  "@conduit-client/utils": "3.19.6",
150
- "@salesforce/jsonrpc": "^12.12.1",
151
- "@salesforce/sf-embedding-bridge": "2.2.5-rc.2"
150
+ "@salesforce/jsonrpc": "^12.13.0",
151
+ "@salesforce/sf-embedding-bridge": "2.3.0-rc.3"
152
152
  },
153
153
  "peerDependencies": {
154
154
  "o11y": ">=266.13.0",