@salesforce/platform-sdk 12.18.0 → 13.0.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 (42) hide show
  1. package/README.md +18 -0
  2. package/dist/analytics/index.js +1 -1
  3. package/dist/{analytics-DtUm3Bhb.js → analytics-BqVdGxvp.js} +1 -1
  4. package/dist/app/index.js +1 -1
  5. package/dist/{capabilities-B3Raifjg.js → capabilities-Gf8lYbjH.js} +1 -2
  6. package/dist/chat/index.d.ts.map +1 -1
  7. package/dist/chat/index.js +26 -27
  8. package/dist/chat/mcpapps.d.ts.map +1 -1
  9. package/dist/core/capabilities.d.ts +2 -2
  10. package/dist/core/capabilities.d.ts.map +1 -1
  11. package/dist/core/chat.d.ts +7 -1
  12. package/dist/core/chat.d.ts.map +1 -1
  13. package/dist/core/data.d.ts +4 -4
  14. package/dist/core/index.js +2 -2
  15. package/dist/core/mcpapps-session.d.ts +8 -9
  16. package/dist/core/mcpapps-session.d.ts.map +1 -1
  17. package/dist/core/surface.d.ts +8 -11
  18. package/dist/core/surface.d.ts.map +1 -1
  19. package/dist/data/index.d.ts +1 -22
  20. package/dist/data/index.d.ts.map +1 -1
  21. package/dist/data/index.js +368 -269
  22. package/dist/data/mcpapps/index.d.ts +2 -2
  23. package/dist/data/mcpapps/index.d.ts.map +1 -1
  24. package/dist/data/telemetry.d.ts +39 -0
  25. package/dist/data/telemetry.d.ts.map +1 -0
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -3
  29. package/dist/internal-telemetry/define.d.ts +55 -0
  30. package/dist/internal-telemetry/define.d.ts.map +1 -0
  31. package/dist/internal-telemetry/index.d.ts +24 -0
  32. package/dist/internal-telemetry/index.d.ts.map +1 -0
  33. package/dist/lightning/index.d.ts.map +1 -1
  34. package/dist/lightning/index.js +4 -5
  35. package/dist/{surface-Cg3eyRpj.js → surface-DyglgPiz.js} +43 -48
  36. package/dist/ui-embedding/session.js +1 -1
  37. package/dist/view/index.d.ts.map +1 -1
  38. package/dist/view/index.js +1 -2
  39. package/docs/data/02-caching-and-freshness.md +3 -3
  40. package/docs/data/03-reactive-handle-lifecycle.md +2 -2
  41. package/docs/data/04-surfaces-and-guards.md +20 -8
  42. package/package.json +12 -11
@@ -1,9 +1,9 @@
1
1
  import { DataSDK, DataSDKGraphQL, McpAppsSession } from '../../core';
2
- import { ClaudeDataSDKOptions, MCPAppsDataSDKOptions } from '../index';
2
+ import { MCPAppsDataSDKOptions } from '../index';
3
3
  export declare class MCPAppsDataSDK implements DataSDK {
4
4
  #private;
5
5
  readonly graphql: DataSDKGraphQL;
6
6
  readonly apiVersion: string;
7
- constructor(session: McpAppsSession, options?: ClaudeDataSDKOptions | MCPAppsDataSDKOptions);
7
+ constructor(session: McpAppsSession, options?: MCPAppsDataSDKOptions);
8
8
  }
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA8DtD,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,qBAAqB;CAqEpE"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /** The Platform SDK Product Feature that carries Data SDK adoption. */
7
+ export declare const DATA_SDK_PRODUCT_FEATURE_ID = "aJCEE000000fZZh4AM";
8
+ /** The Data SDK base-use milestone. The PF owner approves each event name. */
9
+ export declare const DATA_SDK_USED_EVENT_NAME = "dataSdk.used";
10
+ /** The fields this SDK fills on the standard PDP event. Both values are constants. */
11
+ export interface DataSdkUsedPayload {
12
+ productFeatureId: typeof DATA_SDK_PRODUCT_FEATURE_ID;
13
+ eventName: typeof DATA_SDK_USED_EVENT_NAME;
14
+ }
15
+ /** The payload of every adoption event. Constants only, so it cannot carry customer data. */
16
+ export declare const DATA_SDK_USED_PAYLOAD: Readonly<DataSdkUsedPayload>;
17
+ /** The standard PDP event. */
18
+ export declare const dataSdkUsed: import('../internal-telemetry').LogDefinition<DataSdkUsedPayload>;
19
+ /**
20
+ * Records Data SDK adoption. Call once `createDataSDK()` has resolved its base and its
21
+ * extensions have attached. Adoption is use, not health: a degraded base still counts.
22
+ *
23
+ * @remarks
24
+ * A module-level latch limits this to one call per SDK copy. The latch closes on the first call
25
+ * and is checked before the facade is called, so the order is check, set, call.
26
+ *
27
+ * Trade-offs of this latch:
28
+ * - It is once per SDK copy per page load. N webapps on one page emit N events, and a reload
29
+ * emits another. PDP's distinct-org and distinct-user metrics absorb the duplicates.
30
+ * - On an unapproved surface the facade drops the event, but the latch still closes. This is
31
+ * harmless, because the surface of a copy does not change.
32
+ * - On Node and Mosaic one module instance is one server process, so the latch would cap that
33
+ * process at one event for its whole life. Redesign it before Mosaic is an approved surface.
34
+ *
35
+ * A failed attach rejects `createDataSDK()` and never reaches this function, so it does not
36
+ * close the latch.
37
+ */
38
+ export declare function recordDataSdkAdoption(): void;
39
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/data/telemetry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAEvD,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IAClC,gBAAgB,EAAE,OAAO,2BAA2B,CAAC;IACrD,SAAS,EAAE,OAAO,wBAAwB,CAAC;CAC3C;AAED,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,kBAAkB,CAG7D,CAAC;AAEH,8BAA8B;AAC9B,eAAO,MAAM,WAAW,mEAKtB,CAAC;AAKH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C"}
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 ClaudeDataSDKOptions, type MCPAppsDataSDKOptions, type StatusCallback, type NodeOfConnection, gql, } from './data';
9
+ export { createDataSDK, defineDataExtension, type DataSDKOptions, type DataSDKExtension, type DataSDKWithExtensions, type WebAppDataSDKOptions, type MosaicDataSDKOptions, 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,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,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,OAAO,CAAC;AAGf,OAAO,EACN,wBAAwB,EACxB,yBAAyB,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"}
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,qBAAqB,EAC1B,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,OAAO,CAAC;AAGf,OAAO,EACN,wBAAwB,EACxB,yBAAyB,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-Cg3eyRpj.js";
2
- import { g as c } from "./capabilities-B3Raifjg.js";
1
+ import { M as t, a, S as p, g as s, i as o, b as i, r as S } from "./surface-DyglgPiz.js";
2
+ import { g as c } from "./capabilities-Gf8lYbjH.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-mZWIhtRG.js";
11
- import { P as W, c as Y, v as j } from "./analytics-DtUm3Bhb.js";
11
+ import { P as W, c as Y, v as j } from "./analytics-BqVdGxvp.js";
12
12
  export {
13
13
  n as MCPAppsChatSDK,
14
14
  d as MCPAppsViewSDK,
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * The shape of a published `o11y_schema` descriptor, as the facade needs it.
8
+ *
9
+ * @remarks
10
+ * This is declared here rather than imported from `o11y/shared`, because the installed `o11y`
11
+ * ships no type declarations. It is structurally compatible with o11y's `Schema`.
12
+ */
13
+ export interface LogSchema {
14
+ readonly namespace: string;
15
+ readonly name: string;
16
+ readonly pbjsSchema: object;
17
+ }
18
+ /**
19
+ * A reviewed declaration of one schema-backed log signal.
20
+ *
21
+ * @typeParam Payload - The payload type. Descriptors ship no TypeScript types, so the author
22
+ * of a definition writes this type and must match it to the descriptor.
23
+ */
24
+ export interface LogDefinition<Payload> {
25
+ readonly kind: "log";
26
+ /** Selects the o11y instrumentation name, `platform-sdk-<area>`. */
27
+ readonly area: string;
28
+ /** Which question the signal answers. Never sent. */
29
+ readonly description: string;
30
+ /** The published `o11y_schema` descriptor. It owns the namespace, name and wire fields. */
31
+ readonly schema: LogSchema;
32
+ /**
33
+ * Phantom field that carries {@link Payload} for inference. Never set at runtime.
34
+ *
35
+ * @remarks
36
+ * It is a function from `Payload` to `Payload`, so `LogDefinition` is invariant in `Payload`.
37
+ * A plain `readonly __payload?: Payload` is covariant: a definition for a narrow payload would
38
+ * be assignable to a definition for a wider one, and a call could widen the payload type with
39
+ * no cast (explicit type argument, annotated assignment or a generic helper parameter).
40
+ * Invariance makes each of those a compile error.
41
+ */
42
+ readonly __payload?: (payload: Payload) => Payload;
43
+ }
44
+ /**
45
+ * Declares a log signal. It registers, validates and emits nothing; it tags the object with its
46
+ * `kind`, freezes it and returns it.
47
+ *
48
+ * @remarks
49
+ * `Payload` defaults to `never`. Nothing in `definition` mentions it, so without an explicit
50
+ * type argument (or a `LogDefinition<...>` annotation on the result) it cannot be inferred. A
51
+ * default of `unknown` would make every payload compile; `never` makes every `log()` call on
52
+ * the definition fail, which forces the author to state the type.
53
+ */
54
+ export declare function defineLog<Payload = never>(definition: Omit<LogDefinition<Payload>, "kind" | "__payload">): LogDefinition<Payload>;
55
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/internal-telemetry/define.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,OAAO;IACrC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;CACnD;AAED;;;;;;;;;GASG;AAEH,wBAAgB,SAAS,CAAC,OAAO,GAAG,KAAK,EACxC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,GAC5D,aAAa,CAAC,OAAO,CAAC,CAExB"}
@@ -0,0 +1,24 @@
1
+ import { LogDefinition } from './define';
2
+ export { defineLog } from './define';
3
+ export type { LogDefinition, LogSchema } from './define';
4
+ /**
5
+ * The internal telemetry facade.
6
+ *
7
+ * @remarks
8
+ * Area code imports this and never imports `o11y-internal`. Each call makes exactly one
9
+ * `o11y-internal` call on an approved surface, and nothing otherwise. A failure inside the
10
+ * facade is caught, so telemetry can never change the result of an SDK operation.
11
+ *
12
+ * Not exported from any package entry point.
13
+ */
14
+ export declare const telemetry: {
15
+ /**
16
+ * Emits a schema-backed log record.
17
+ *
18
+ * @remarks
19
+ * The payload type comes from the definition only. `NoInfer` stops `tsc` from also inferring
20
+ * it from the argument, which would let an out-of-domain value compile.
21
+ */
22
+ log<Payload>(definition: LogDefinition<Payload>, payload: NoInfer<Payload>): void;
23
+ };
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal-telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA6BzD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;IACrB;;;;;;OAMG;QACC,OAAO,cAAc,aAAa,CAAC,OAAO,CAAC,WAAW,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI;CAsBjF,CAAC"}
@@ -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,CA8BvF;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,CA6BvF;AAED,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
- import { g as a, S as r } from "../surface-Cg3eyRpj.js";
2
- import { w as n } from "../sdk-promise-D0sy7OW1.js";
1
+ import { g as n, S as r } from "../surface-DyglgPiz.js";
2
+ import { w as a } 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 n(
16
+ return a(
17
17
  (async () => {
18
18
  let e;
19
19
  try {
20
- e = await a(s?.surface);
20
+ e = await n(s?.surface);
21
21
  } catch {
22
22
  return {};
23
23
  }
@@ -28,7 +28,6 @@ function f(s) {
28
28
  return {};
29
29
  case r.MicroFrontend:
30
30
  return t.create();
31
- case r.Claude:
32
31
  case r.MCPApps:
33
32
  return {};
34
33
  case r.Mosaic:
@@ -1,14 +1,14 @@
1
- import { readHostMetaData as d } from "@salesforce/sf-embedding-bridge";
2
- import { JsonRpcClient as p, WindowPostMessageTransport as f } from "@salesforce/jsonrpc";
3
- class h extends Error {
1
+ import { readHostMetaData as p } from "@salesforce/sf-embedding-bridge";
2
+ import { JsonRpcClient as f, WindowPostMessageTransport as h } from "@salesforce/jsonrpc";
3
+ class l extends Error {
4
4
  constructor() {
5
5
  super(
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."
6
+ "MCP Apps surfaces require a completed SEP-1865 handshake, but it has not succeeded. This usually means an MCP Apps surface override 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
- const l = 500, m = "2026-01-26";
11
- class s extends p {
10
+ const m = 500, w = "2026-01-26";
11
+ class s extends f {
12
12
  static initPromise = null;
13
13
  hostCtx = {};
14
14
  _hostInfo;
@@ -28,7 +28,7 @@ class s extends p {
28
28
  if (!s.initPromise) {
29
29
  const n = t?.targetOrigin ?? "*";
30
30
  s.initPromise = (async () => {
31
- const i = new s(new f(n));
31
+ const i = new s(new h(n));
32
32
  return await i.handshake(t), i;
33
33
  })();
34
34
  }
@@ -52,17 +52,17 @@ class s extends p {
52
52
  * gracefully for hosts that do not support SEP-1865.
53
53
  */
54
54
  async handshake(t) {
55
- const n = t?.handshakeTimeoutMs ?? l, i = t?.appInfo ?? { name: "mcp-app", version: "1.0.0" };
55
+ const n = t?.handshakeTimeoutMs ?? m, i = t?.appInfo ?? { name: "mcp-app", version: "1.0.0" };
56
56
  try {
57
- const u = /* @__PURE__ */ Symbol("timeout"), o = await Promise.race([
57
+ const d = /* @__PURE__ */ Symbol("timeout"), o = await Promise.race([
58
58
  this.request("ui/initialize", {
59
- protocolVersion: m,
59
+ protocolVersion: w,
60
60
  appInfo: i,
61
61
  appCapabilities: {}
62
62
  }),
63
- new Promise((c) => setTimeout(() => c(u), n))
63
+ new Promise((c) => setTimeout(() => c(d), n))
64
64
  ]);
65
- o !== u && (this.hostCtx = o.hostContext ?? {}, this._hostInfo = o.hostInfo, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (c) => {
65
+ o !== d && (this.hostCtx = o.hostContext ?? {}, this._hostInfo = o.hostInfo, this._handshakeSucceeded = !0, this.registerNotificationHandler("ui/notifications/host-context-changed", (c) => {
66
66
  this.hostCtx = {
67
67
  ...this.hostCtx,
68
68
  ...c
@@ -96,38 +96,29 @@ class s extends p {
96
96
  super.registerNotificationHandler(t, n);
97
97
  }
98
98
  }
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;
101
- let r = null, a;
99
+ var g = /* @__PURE__ */ ((e) => (e.WebApp = "WebApp", e.MicroFrontend = "Micro-Frontend", e.OpenAI = "OpenAI", e.MCPApps = "MCP-Apps", e.Mosaic = "Mosaic", e))(g || {});
100
+ let a = null, u, r;
102
101
  function A(e, t) {
103
102
  const n = e ?? {}, i = t ?? {};
104
103
  return n.targetOrigin === i.targetOrigin && n.handshakeTimeoutMs === i.handshakeTimeoutMs && n.appInfo?.name === i.appInfo?.name && n.appInfo?.version === i.appInfo?.version;
105
104
  }
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";
105
+ async function I() {
106
+ return typeof window > "u" ? "Mosaic" : window.openai ? "OpenAI" : y() ? P() ? "Micro-Frontend" : (await s.getInstance(r)).handshakeSucceeded ? "MCP-Apps" : "WebApp" : "WebApp";
120
107
  }
121
- async function I(e) {
122
- if (!r)
123
- a = e?.mcpApps, r = C();
124
- else if (e?.mcpApps && !A(e.mcpApps, a))
125
- throw new Error(
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)."
127
- );
128
- return r;
108
+ async function M(e) {
109
+ if (a) {
110
+ if (e?.mcpApps && !A(e.mcpApps, r))
111
+ throw new Error(
112
+ "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)."
113
+ );
114
+ } else {
115
+ r = e?.mcpApps;
116
+ const t = I().then((n) => (a === t && (u = n), n));
117
+ a = t;
118
+ }
119
+ return a;
129
120
  }
130
- function M() {
121
+ function y() {
131
122
  if (typeof window > "u") return !1;
132
123
  try {
133
124
  return window.parent !== window;
@@ -135,7 +126,7 @@ function M() {
135
126
  return !0;
136
127
  }
137
128
  }
138
- function y() {
129
+ function P() {
139
130
  if (typeof window > "u") return !1;
140
131
  try {
141
132
  if (window.parent === window) return !1;
@@ -143,25 +134,29 @@ function y() {
143
134
  return !1;
144
135
  }
145
136
  const e = window.location?.search;
146
- return typeof e != "string" ? !1 : d(e) !== null;
137
+ return typeof e != "string" ? !1 : p(e) !== null;
147
138
  }
148
139
  async function k(e) {
149
- const t = await I();
140
+ const t = await M();
150
141
  if (e == null)
151
142
  return t;
152
- if ((e === "MCP-Apps" || e === "Claude") && !(await s.getInstance(a)).handshakeSucceeded)
153
- throw new h();
143
+ if (e === "MCP-Apps" && !(await s.getInstance(r)).handshakeSucceeded)
144
+ throw new l();
154
145
  return e;
155
146
  }
156
147
  function b() {
157
- r = null, a = void 0, s.resetInstance();
148
+ a = null, u = void 0, r = void 0, s.resetInstance();
149
+ }
150
+ function x() {
151
+ return u;
158
152
  }
159
153
  export {
160
- h as M,
161
- w as S,
154
+ l as M,
155
+ g as S,
162
156
  s as a,
163
- y as b,
157
+ P as b,
158
+ x as c,
164
159
  k as g,
165
- I as i,
160
+ M as i,
166
161
  b as r
167
162
  };
@@ -1,5 +1,5 @@
1
1
  import { bootstrapSession as t } from "@salesforce/sf-embedding-bridge";
2
- import { b as i } from "../surface-Cg3eyRpj.js";
2
+ import { b as i } from "../surface-DyglgPiz.js";
3
3
  let r;
4
4
  if (i()) {
5
5
  const n = t();
@@ -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,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
+ {"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,WAAW,EACX,cAAc,EACd,aAAa,EACb,UAAU,EACV,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
- import { g as m, S as a, a as w } from "../surface-Cg3eyRpj.js";
1
+ import { g as m, S as a, a as w } from "../surface-DyglgPiz.js";
2
2
  import { w as p } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as b } from "../ui-embedding/session.js";
4
4
  function g(i) {
@@ -343,7 +343,6 @@ function S(i) {
343
343
  return {};
344
344
  case a.MicroFrontend:
345
345
  return await u.create();
346
- case a.Claude:
347
346
  case a.MCPApps: {
348
347
  const s = await w.getInstance();
349
348
  return new v(s);
@@ -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, Claude, MCPApps) there is no cache — see
17
- > [Uncached surfaces](#uncached-surfaces-mosaic-openai-claude-mcpapps) below and
16
+ > uncached surfaces (Mosaic, OpenAI, MCPApps) there is no cache — see
17
+ > [Uncached surfaces](#uncached-surfaces-mosaic-openai-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, Claude, MCPApps)
172
+ ## Uncached surfaces (Mosaic, OpenAI, 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 / Claude / MCPApps the handle exists but `subscribe` only emits in response to `refresh()` — there
81
+ On Mosaic / OpenAI / 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-claude-mcpapps) and
83
+ [Uncached surfaces](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai-mcpapps) and
84
84
  [04-surfaces-and-guards.md](./04-surfaces-and-guards.md).
@@ -5,7 +5,6 @@ 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
8
  MCPAppsDataSDKOptions: dist/data/index.d.ts
10
9
  NodeOfConnection: dist/data/index.d.ts
11
10
  -->
@@ -45,7 +44,7 @@ support and deployed validation are separate work.
45
44
  ## `apiVersion` — the resolved adapter version
46
45
 
47
46
  `sdk.apiVersion` is the optional, read-only Salesforce API version selected by the resolved surface
48
- adapter. WebApp, Mosaic, Claude, and MCPApps expose it and derive their data request paths from that same value;
47
+ adapter. WebApp, Mosaic, and MCP Apps expose it and derive their data request paths from that same value;
49
48
  `apiVersion: "63.0"`, for example, produces paths under `/services/data/v63.0`. Tool-backed OpenAI
50
49
  and degraded surfaces do not expose a comparable org request version, so the property is absent.
51
50
 
@@ -94,7 +93,7 @@ What it carries, per surface:
94
93
  rather than assuming it.
95
94
  - **OpenAI** — no `.fetch`. That surface exposes only `.graphql` via an MCP tool, so guard for
96
95
  `.fetch`'s absence rather than assuming it.
97
- - **Claude / MCPApps** — no `.fetch`. Only `.graphql` is exposed through H360 dispatch tools.
96
+ - **MCPApps** — no `.fetch`. Only `.graphql` is exposed through H360 dispatch tools.
98
97
  A successful SEP-1865 handshake is required; failed verification or session acquisition degrades
99
98
  to an empty SDK. Feature-detect both members rather than assuming host support.
100
99
  Queries go through the `dispatch_readonly` tool and mutations through `dispatch`. The host must
@@ -171,14 +170,27 @@ declarations own the field lists — this is just the routing:
171
170
  `accessToken` / `apiVersion`. Uncached.
172
171
  - **OpenAI** — no surface options bag; delegates to an MCP tool. Uncached, and it exposes no header
173
172
  channel, so per-request `headers` are ignored there.
174
- - **Claude** — `ClaudeDataSDKOptions` (`options.claude`) and **MCPApps** — `MCPAppsDataSDKOptions`
175
- (`options.mcpApps`): separate bags, each read only on its own surface. Both currently carry
173
+ - **MCPApps** — `MCPAppsDataSDKOptions` (`options.mcpApps`) carries
176
174
  `apiVersion`, defaulting to the SDK's existing `API_VERSION`; an override such as `"66.0"` selects
177
175
  `/services/data/v66.0/graphql` and is exposed as `sdk.apiVersion`. Extension `minApiVersion`
178
176
  checks apply before setup. Session configuration (origin, identity, handshake timeout) belongs to
179
177
  `initialize`, not these option bags.
180
178
 
181
- ### Claude / MCPApps H360 transport
179
+ ## MCP Apps host migration
180
+
181
+ All hosts using the MCP Apps protocol resolve to `Surface.MCPApps`. Consumers that previously
182
+ checked `Surface.Claude` should check for `Surface.MCPApps`, then read the raw host name from
183
+ `sdk.getHostContext?.().hostInfo?.name`.
184
+ The same context exposes `hostInfo.version` and `platform` (`"web"`, `"desktop"`, or `"mobile"`)
185
+ when the host provides them. Host names are not normalized; for example, a host may report
186
+ `"claude-ai"` or `"claude-desktop"`. A missing handshake yields no MCP Apps ChatSDK, and absent identity fields remain
187
+ `undefined`.
188
+
189
+ Move `createDataSDK({ claude: { apiVersion } })` to
190
+ `createDataSDK({ mcpApps: { apiVersion } })`. `ClaudeDataSDKOptions` and the `claude` option bag
191
+ are not part of the public API.
192
+
193
+ ### MCPApps H360 transport
182
194
 
183
195
  Queries call `tools/call` with `dispatch_readonly`, `method: "GET"`, and
184
196
  `queryParams.queryInput` containing JSON `{ query, variables?, operationName? }`. Mutations call
@@ -193,13 +205,13 @@ are valid GraphQL responses. Tool errors, non-2xx statuses, and `error_code` nev
193
205
  Failures surface through `result.errors`: valid GraphQL errors are preserved, while transport and
194
206
  malformed-envelope errors use safe generic messages without dumping URLs, queries, or bodies.
195
207
 
196
- ## Uncached surfaces (Mosaic, OpenAI, Claude, MCPApps)
208
+ ## Uncached surfaces (Mosaic, OpenAI, MCPApps)
197
209
 
198
210
  - No cache exists — every `query()` is a network request, and `cacheControl` is silently ignored.
199
211
  - `subscribe` is real but only emits in response to `refresh()`.
200
212
 
201
213
  The full uncached-surface behaviour and the caching model it contrasts with are in
202
- [02-caching-and-freshness.md](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai-claude-mcpapps) and
214
+ [02-caching-and-freshness.md](./02-caching-and-freshness.md#uncached-surfaces-mosaic-openai-mcpapps) and
203
215
  [03-reactive-handle-lifecycle.md](./03-reactive-handle-lifecycle.md). The `query`/`mutate` shape is
204
216
  identical across surfaces, so the same call site runs everywhere — only caching differs.
205
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "12.18.0",
3
+ "version": "13.0.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -139,16 +139,16 @@
139
139
  "test:coverage": "vitest run --coverage --typecheck"
140
140
  },
141
141
  "dependencies": {
142
- "@conduit-client/command-http-cache-control": "3.19.6",
143
- "@conduit-client/onestore-graphql-parser": "3.19.6",
144
- "@conduit-client/service-cache": "3.19.6",
145
- "@conduit-client/service-cache-control": "3.19.6",
146
- "@conduit-client/service-cache-inclusion-policy": "3.19.6",
147
- "@conduit-client/service-fetch-network": "3.19.6",
148
- "@conduit-client/service-pubsub": "3.19.6",
149
- "@conduit-client/service-retry": "3.19.6",
150
- "@conduit-client/utils": "3.19.6",
151
- "@salesforce/jsonrpc": "^12.18.0",
142
+ "@conduit-client/command-http-cache-control": "^3.19.6",
143
+ "@conduit-client/onestore-graphql-parser": "^3.19.6",
144
+ "@conduit-client/service-cache": "^3.19.6",
145
+ "@conduit-client/service-cache-control": "^3.19.6",
146
+ "@conduit-client/service-cache-inclusion-policy": "^3.19.6",
147
+ "@conduit-client/service-fetch-network": "^3.19.6",
148
+ "@conduit-client/service-pubsub": "^3.19.6",
149
+ "@conduit-client/service-retry": "^3.19.6",
150
+ "@conduit-client/utils": "^3.19.6",
151
+ "@salesforce/jsonrpc": "^13.0.0",
152
152
  "@salesforce/sf-embedding-bridge": "2.3.0-rc.3"
153
153
  },
154
154
  "peerDependencies": {
@@ -156,6 +156,7 @@
156
156
  "o11y_schema": ">=264.109.0"
157
157
  },
158
158
  "devDependencies": {
159
+ "o11y_schema": "264.124.0",
159
160
  "ts-morph": "^27.0.2",
160
161
  "tsx": "^4.21.0",
161
162
  "vite": "^7.3.5",