@salesforce/platform-sdk 12.12.1 → 12.14.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 (59) 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 +49 -4
  20. package/dist/data/index.d.ts.map +1 -1
  21. package/dist/data/index.js +435 -366
  22. package/dist/data/mcpapps/index.d.ts +9 -0
  23. package/dist/data/mcpapps/index.d.ts.map +1 -0
  24. package/dist/data/mosaic/fetch.d.ts +13 -33
  25. package/dist/data/mosaic/fetch.d.ts.map +1 -1
  26. package/dist/data/mosaic/index.d.ts +0 -14
  27. package/dist/data/mosaic/index.d.ts.map +1 -1
  28. package/dist/data/shared/graphql/parse-response.d.ts +4 -36
  29. package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
  30. package/dist/data/webapp/csrf/token-manager.d.ts +14 -1
  31. package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +3 -3
  35. package/dist/lightning/index.d.ts.map +1 -1
  36. package/dist/lightning/index.js +5 -4
  37. package/dist/observability/vendor/index.d.ts +17 -0
  38. package/dist/observability/vendor/index.d.ts.map +1 -0
  39. package/dist/observability/vendor/names.d.ts +11 -0
  40. package/dist/observability/vendor/names.d.ts.map +1 -0
  41. package/dist/observability/vendor/protocol.d.ts +25 -0
  42. package/dist/observability/vendor/protocol.d.ts.map +1 -0
  43. package/dist/observability/vendor/queue.d.ts +16 -0
  44. package/dist/observability/vendor/queue.d.ts.map +1 -0
  45. package/dist/observability/vendor/verbs.d.ts +19 -0
  46. package/dist/observability/vendor/verbs.d.ts.map +1 -0
  47. package/dist/{surface-DWDgqdpN.js → surface-Cg3eyRpj.js} +44 -26
  48. package/dist/ui-embedding/session.js +1 -1
  49. package/dist/view/embedding.d.ts +18 -1
  50. package/dist/view/embedding.d.ts.map +1 -1
  51. package/dist/view/index.d.ts +1 -1
  52. package/dist/view/index.d.ts.map +1 -1
  53. package/dist/view/index.js +79 -35
  54. package/dist/view/utils.d.ts +5 -0
  55. package/dist/view/utils.d.ts.map +1 -1
  56. package/docs/data/02-caching-and-freshness.md +3 -3
  57. package/docs/data/03-reactive-handle-lifecycle.md +2 -2
  58. package/docs/data/04-surfaces-and-guards.md +60 -6
  59. 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"}
@@ -1,41 +1,21 @@
1
1
  import { FetchService, RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
2
2
  /**
3
- * Returns `true` when a request must pivot to the lightning domain.
3
+ * Creates a request interceptor that prepends a base URL to relative string URLs.
4
4
  *
5
- * @remarks
6
- * A request pivots only when the widget is trusted (`isInternal`), a
7
- * `lightningDomain` is configured, and the request carries the first-party
8
- * header. When the result is `true`, the call site narrows `lightningDomain`
9
- * to `string`.
5
+ * @param baseUrl - The base URL to prepend (e.g. "https://myorg.salesforce.com")
10
6
  */
11
- export declare function shouldPivotToLightning(init: RequestInit | undefined, isInternal: boolean, lightningDomain: string | undefined): lightningDomain is string;
12
- /** The configuration for the Mosaic fetch transport. */
13
- interface MosaicFetchConfig {
14
- /**
15
- * The my-domain base URL for resolving relative paths, for example
16
- * "https://myorg.salesforce.com".
17
- */
18
- baseUrl?: string;
19
- /** The access token, sent as a Bearer header or as the sid cookie on a lightning pivot. */
20
- accessToken?: string;
21
- /** The lightning-domain base URL for UITier (first-party) requests. */
22
- lightningDomain?: string;
23
- /** True when this widget is trusted to pivot first-party requests to the lightning domain. */
24
- isInternal?: boolean;
25
- }
7
+ export declare function createBaseUrlInterceptor(baseUrl: string): RequestInterceptor;
26
8
  /**
27
- * The single request interceptor for the Mosaic transport.
9
+ * Creates a request interceptor that adds an Authorization Bearer header.
28
10
  *
29
- * @remarks
30
- * The interceptor resolves routing and authentication together, so they cannot
31
- * diverge: it routes a first-party request from a trusted widget to the lightning
32
- * domain with sid-cookie authentication, and sends everything else to my-domain
33
- * with Bearer authentication. The pivot fires only for a relative URL that the
34
- * interceptor rewrites against `baseUrl`, so the sid cookie can never attach
35
- * unless the request is bound for the lightning domain.
11
+ * @param accessToken - The access token to use for authentication
36
12
  */
37
- export declare function createMosaicInterceptor({ baseUrl, accessToken, lightningDomain, isInternal, }: MosaicFetchConfig): RequestInterceptor;
38
- /** Creates a fetch service configured with the Mosaic request interceptor. */
39
- export declare function createMosaicFetchService(config: MosaicFetchConfig): FetchService;
40
- export {};
13
+ export declare function createAuthInterceptor(accessToken: string): RequestInterceptor;
14
+ /**
15
+ * Creates a fetch service configured with optional base URL and auth interceptors.
16
+ *
17
+ * @param baseUrl - Optional base URL for resolving relative paths
18
+ * @param accessToken - Optional access token for Bearer authentication
19
+ */
20
+ export declare function createMosaicFetchService(baseUrl?: string, accessToken?: string): FetchService;
41
21
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAelD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,UAAU,EAAE,OAAO,EACnB,eAAe,EAAE,MAAM,GAAG,SAAS,GACjC,eAAe,IAAI,MAAM,CAG3B;AAiBD,wDAAwD;AACxD,UAAU,iBAAiB;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,eAAe,EACf,UAAkB,GAClB,EAAE,iBAAiB,GAAG,kBAAkB,CAmBxC;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY,CAKhF"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAS5E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAI7E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAY7F"}
@@ -23,17 +23,6 @@ export interface MosaicDataSDKOptions {
23
23
  * @example "64.0"
24
24
  */
25
25
  apiVersion?: string;
26
- /**
27
- * The lightning-domain base URL for UITier (first-party) requests when this
28
- * widget is trusted as internal.
29
- * @example "https://my-domain.lightning.force.com"
30
- */
31
- lightningDomain?: string;
32
- /**
33
- * Marks this widget as internal and trusted, which enables the
34
- * lightning-domain pivot for first-party (UITier) requests. Defaults to `false`.
35
- */
36
- isInternal?: boolean;
37
26
  }
38
27
  /**
39
28
  * The data SDK implementation for the Mosaic surface (Node.js, server-side).
@@ -46,9 +35,6 @@ export interface MosaicDataSDKOptions {
46
35
  export declare class MosaicDataSDK implements DataSDK {
47
36
  private readonly clientFetch;
48
37
  private readonly pathData;
49
- private readonly baseUrl;
50
- private readonly lightningDomain;
51
- private readonly isInternal;
52
38
  readonly apiVersion: string;
53
39
  readonly graphql: DataSDKGraphQL;
54
40
  constructor(options?: MosaicDataSDKOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAkB3F;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IACrD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YA0B5B,iBAAiB;CA4D/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAkB3F;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAc5B,iBAAiB;CAe/B"}
@@ -1,16 +1,7 @@
1
1
  import { GraphQLResponse } from '../../../core';
2
2
  /**
3
- * The error thrown when a GraphQL transport response body cannot be parsed
4
- * as JSON.
5
- *
6
- * @remarks
7
- * A raw `JSON.parse` failure, for example "Unexpected end of JSON input" or
8
- * "Unexpected token < in JSON at position 0", is a bare engine message with
9
- * no transport context. A caller who surfaces that message — with
10
- * `toErrors` in `../graphql-parse`, into `result.errors` — has nothing to
11
- * act on. This error keeps the surface, request URL, HTTP status, and a
12
- * bounded body snippet on the message, and keeps the original parse failure
13
- * as `cause`. So the failure is diagnosable from the error text alone.
3
+ * Thrown when a transport body isn't a JSON GraphQL object. Raw `JSON.parse` errors carry no
4
+ * context, so this adds surface, URL, status, and a body snippet; keeps the original as `cause`.
14
5
  */
15
6
  export declare class GraphQLTransportError extends Error {
16
7
  readonly status: number;
@@ -24,31 +15,8 @@ export declare class GraphQLTransportError extends Error {
24
15
  });
25
16
  }
26
17
  /**
27
- * Parses a raw GraphQL transport {@link Response} into a {@link
28
- * GraphQLResponse}. Replaces an unguarded `res.json()` call.
29
- *
30
- * @remarks
31
- * A non-2xx response can still carry a valid GraphQL error body (`{ errors:
32
- * [...] }`). So this function does not gate on `res.ok`: it reads and parses
33
- * the body regardless of status, and returns a successfully parsed body
34
- * as-is.
35
- *
36
- * This function throws a {@link GraphQLTransportError} only when the body
37
- * is empty, is not valid JSON, or is valid JSON that is not an object (a
38
- * bare scalar or `null`). Otherwise, one of those cases would surface
39
- * downstream as the contextless "Unexpected end of JSON input" message, or
40
- * escape as a `TypeError` when a caller reads `.data` or `.errors` off a
41
- * non-object value. The thrown error carries the surface, URL, status, and
42
- * a body snippet.
43
- *
44
- * This function reads the body once with `res.text()`, instead of
45
- * `res.json()`, so the raw text is available for the diagnostic snippet if
46
- * parsing fails.
47
- *
48
- * @param res - The fetch response for a GraphQL POST request.
49
- * @param surface - The human-readable transport surface, for example
50
- * `"WebApp"` or `"Mosaic"`.
51
- * @param url - The request URL, for the diagnostic message.
18
+ * Parses a GraphQL {@link Response}. No `res.ok` gate: non-2xx can still carry valid `{ errors }`.
19
+ * Reads via `text()` so the raw body is available for the {@link GraphQLTransportError} snippet.
52
20
  */
53
21
  export declare function parseGraphQLResponse<T>(res: Response, surface: string, url: string): Promise<GraphQLResponse<T>>;
54
22
  //# sourceMappingURL=parse-response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-response.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/parse-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAsCrD;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,IAAI,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,OAAO,CAAC;KACf;CAeD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAC3C,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAyB7B"}
1
+ {"version":3,"file":"parse-response.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/parse-response.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBrD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,IAAI,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,OAAO,CAAC;KACf;CAeD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAC3C,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAkB7B"}
@@ -19,7 +19,8 @@ declare class CsrfTokenManager {
19
19
  * Returns the current CSRF token.
20
20
  *
21
21
  * @remarks
22
- * The first call loads the token lazily, either from the cache or with a fetch request.
22
+ * The token loads from the cache or with a fetch request. When the last attempt failed, this
23
+ * call starts a new attempt, so a transient failure does not block later requests.
23
24
  */
24
25
  getToken(): Promise<string>;
25
26
  /**
@@ -30,9 +31,21 @@ declare class CsrfTokenManager {
30
31
  * every caller shares the same in-flight promise.
31
32
  */
32
33
  refreshToken(): Promise<string | undefined>;
34
+ /**
35
+ * Starts a token attempt that is forgotten when it fails.
36
+ *
37
+ * @remarks
38
+ * The manager lives for the page lifetime. If it kept a rejected promise, every later protected
39
+ * request would fail without a network call until the page reloads.
40
+ */
41
+ private startObtainToken;
33
42
  /**
34
43
  * Returns a CSRF token from the cache, or fetches a new one when the cache has none.
35
44
  *
45
+ * @remarks
46
+ * Only a response that contains a token goes into the cache. The cache persists across page
47
+ * loads, so a cached error response would otherwise fail every attempt.
48
+ *
36
49
  * @returns The CSRF token.
37
50
  */
38
51
  private obtainToken;
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/token-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,cAAM,gBAAgB;IAKpB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS,CAAC;IALnB,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,cAAc,CAA8B;gBAG3C,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,YAAA;IAK3B;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC;;;;;;OAMG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmB3C;;;;OAIG;YACW,WAAW;IAuBzB;;;;;OAKG;YACW,SAAS;CASvB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/token-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,cAAM,gBAAgB;IAKpB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS,CAAC;IALnB,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,cAAc,CAA8B;gBAG3C,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,YAAA;IAK3B;;;;;;OAMG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAKjC;;;;;;OAMG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmB3C;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;;;;;OAQG;YACW,WAAW;IA6BzB;;;;;OAKG;YACW,SAAS;CASvB;AAuBD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
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,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,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-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:
@@ -0,0 +1,17 @@
1
+ import { Instrumentation } from './verbs';
2
+ /**
3
+ * Public entry point. Returns a verb surface bound to `name` — the logger/app
4
+ * identity the o11y-client drain dispatches on (getInstrumentation(name)).
5
+ *
6
+ * `name` is validated eagerly: o11y-client's `isValidQueueEvent` silently drops
7
+ * events whose name is empty or longer than {@link MAX_NAME_LENGTH}, so an
8
+ * invalid name would lose ALL telemetry from that logger with zero feedback.
9
+ * We fail fast here instead of emitting silently-discarded events.
10
+ *
11
+ * @throws {TypeError} if `name` is not a non-empty string of at most
12
+ * {@link MAX_NAME_LENGTH} characters.
13
+ */
14
+ export declare function getInstrumentation(name: string): Instrumentation;
15
+ export type { Instrumentation } from './verbs';
16
+ export type { QueueVerb, QueueEventV1 } from './protocol';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/observability/vendor/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAOhE;AAED,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * PLACEHOLDER names (owned by Platform SDK, WI-16 §8). Single source of truth —
8
+ * a later name freeze is a one-line change here.
9
+ */
10
+ export declare const QUEUE_KEY_1P: "__SF_O11Y_QUEUE_1P__";
11
+ //# sourceMappingURL=names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../src/observability/vendor/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAG,sBAA+B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * FROZEN vendored copy of the o11y-client queue protocol contract.
8
+ * SOURCE OF TRUTH: instrumentation/o11y-client
9
+ * packages/o11y/src/queue/types.ts (QueueEventV1, QueueVerb, MAX_* limits)
10
+ * packages/o11y/src/queue/drain.ts (isValidQueueEvent, MAX_SUPPORTED_VERSION)
11
+ * Kept in sync MANUALLY. Do not diverge without a matching change there.
12
+ */
13
+ /** The only verbs the o11y-client drain will replay. Anything else is dropped. */
14
+ export type QueueVerb = "log" | "error" | "incrementCounter" | "trackValue" | "bucketValue";
15
+ /** Wire event, version 1 — exactly these four fields. */
16
+ export interface QueueEventV1 {
17
+ version: 1;
18
+ name: string;
19
+ verb: QueueVerb;
20
+ args: unknown[];
21
+ }
22
+ export declare const PROTOCOL_VERSION: 1;
23
+ export declare const MAX_NAME_LENGTH = 256;
24
+ export declare const MAX_ARGS_LENGTH = 10;
25
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/observability/vendor/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AAEH,kFAAkF;AAClF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,kBAAkB,GAAG,YAAY,GAAG,aAAa,CAAC;AAE5F,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAC3C,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { QueueVerb } from './protocol';
2
+ /**
3
+ * Max events buffered on the 1P global BEFORE o11y-client's orchestrator installs
4
+ * its drain. If the drop-in never loads (not installed, or init throws), this cap
5
+ * bounds memory: the oldest events are dropped first and tallied in `droppedCount`,
6
+ * which o11y-client's drain reads (QueueBufferStub contract) to report the loss.
7
+ */
8
+ export declare const MAX_PENDING_EVENTS = 1000;
9
+ /**
10
+ * Enqueue one event onto the 1P queue global. Correct BOTH before drain (we
11
+ * lazily create a bounded, drop-oldest buffer) and after drain (the global is
12
+ * o11y-client's DirectDispatchProxy, which also exposes `.push`).
13
+ * Fire-and-forget: browser-only, never throws, never emits console output.
14
+ */
15
+ export declare function emit(name: string, verb: QueueVerb, args: unknown[]): void;
16
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/observability/vendor/queue.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAoB,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAoCvC;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAYzE"}
@@ -0,0 +1,19 @@
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 1P producer verb surface — mirrors o11y-client's Instrumentation 1:1 for
8
+ * the five queue-drainable verbs. Each call enqueues a positional-args event.
9
+ */
10
+ export interface Instrumentation {
11
+ log(schemaOrText: unknown, data?: unknown, options?: unknown): void;
12
+ error(error: unknown, schemaOrText?: unknown, data?: unknown, options?: unknown): void;
13
+ incrementCounter(operation: string, increment?: number, hasError?: boolean, tags?: Record<string, unknown>): void;
14
+ trackValue(operation: string, value: number, hasError?: boolean, tags?: Record<string, unknown>): void;
15
+ bucketValue(operation: string, value: number, buckets?: number[], hasError?: boolean, tags?: Record<string, unknown>): void;
16
+ }
17
+ /** Build a verb surface bound to a logger `name`. Arg order matches o11y-client. */
18
+ export declare function createInstrumentation(name: string): Instrumentation;
19
+ //# sourceMappingURL=verbs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verbs.d.ts","sourceRoot":"","sources":["../../../src/observability/vendor/verbs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACpE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvF,gBAAgB,CACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAAC;IACR,UAAU,CACT,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAAC;IACR,WAAW,CACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,QAAQ,CAAC,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,IAAI,CAAC;CACR;AAED,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAkBnE"}
@@ -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,CAAC;AAMhD,oHAAoH;AACpH,MAAM,MAAM,SAAS,GAAG,GAAG,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAY,YAAW,OAAO;IAa/C,OAAO,CAAC,QAAQ,CAAC,OAAO;WAZ/B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAShD,OAAO,CAAC,cAAc,CAAsC;IAC5D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuC;IAExE,OAAO;IAIP;;;;;;;;;;;;;;;;;OAiBG;IACM,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IA0B7C;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO,KAAK;QAC9C,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;KAC3D;IAeK,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,2GAA2G;IACrG,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhE;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;;;;;;OAeG;YACW,oBAAoB;IAyBlC;;;;;;;;OAQG;YACW,kBAAkB;IA2BhC,OAAO,CAAC,QAAQ;CAOhB"}
1
+ {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,SAAS,CAAC;AAMjB,oHAAoH;AACpH,MAAM,MAAM,SAAS,GAAG,GAAG,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAY,YAAW,OAAO;IAa/C,OAAO,CAAC,QAAQ,CAAC,OAAO;WAZ/B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAShD,OAAO,CAAC,cAAc,CAAsC;IAC5D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuC;IAExE,OAAO;IAIP;;;;;;;;;;;;;;;;;OAiBG;IACM,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IA0B7C;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO,KAAK;QAC9C,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;KAC3D;IAeK,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,2GAA2G;IACrG,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhE;;;;OAIG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IASpE;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAW/D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;;;;;;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"}