@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.
- package/dist/analytics/index.js +1 -1
- package/dist/{analytics-wESbWdca.js → analytics-TRyVm9Ub.js} +1 -1
- package/dist/app/index.js +1 -1
- package/dist/{capabilities-B0mU0_G0.js → capabilities-B3Raifjg.js} +2 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +11 -10
- package/dist/core/capabilities.d.ts +2 -2
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/data.d.ts +5 -5
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/mcpapps-session.d.ts +19 -8
- package/dist/core/mcpapps-session.d.ts.map +1 -1
- package/dist/core/surface.d.ts +12 -10
- package/dist/core/surface.d.ts.map +1 -1
- package/dist/core/view.d.ts +118 -4
- package/dist/core/view.d.ts.map +1 -1
- package/dist/data/index.d.ts +49 -4
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +435 -366
- package/dist/data/mcpapps/index.d.ts +9 -0
- package/dist/data/mcpapps/index.d.ts.map +1 -0
- package/dist/data/mosaic/fetch.d.ts +13 -33
- package/dist/data/mosaic/fetch.d.ts.map +1 -1
- package/dist/data/mosaic/index.d.ts +0 -14
- package/dist/data/mosaic/index.d.ts.map +1 -1
- package/dist/data/shared/graphql/parse-response.d.ts +4 -36
- package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
- package/dist/data/webapp/csrf/token-manager.d.ts +14 -1
- package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lightning/index.d.ts.map +1 -1
- package/dist/lightning/index.js +5 -4
- package/dist/observability/vendor/index.d.ts +17 -0
- package/dist/observability/vendor/index.d.ts.map +1 -0
- package/dist/observability/vendor/names.d.ts +11 -0
- package/dist/observability/vendor/names.d.ts.map +1 -0
- package/dist/observability/vendor/protocol.d.ts +25 -0
- package/dist/observability/vendor/protocol.d.ts.map +1 -0
- package/dist/observability/vendor/queue.d.ts +16 -0
- package/dist/observability/vendor/queue.d.ts.map +1 -0
- package/dist/observability/vendor/verbs.d.ts +19 -0
- package/dist/observability/vendor/verbs.d.ts.map +1 -0
- package/dist/{surface-DWDgqdpN.js → surface-Cg3eyRpj.js} +44 -26
- package/dist/ui-embedding/session.js +1 -1
- package/dist/view/embedding.d.ts +18 -1
- package/dist/view/embedding.d.ts.map +1 -1
- package/dist/view/index.d.ts +1 -1
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/index.js +79 -35
- package/dist/view/utils.d.ts +5 -0
- package/dist/view/utils.d.ts.map +1 -1
- package/docs/data/02-caching-and-freshness.md +3 -3
- package/docs/data/03-reactive-handle-lifecycle.md +2 -2
- package/docs/data/04-surfaces-and-guards.md +60 -6
- package/package.json +3 -3
package/dist/analytics/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { registerInstrumentedApp as S } from "o11y/client";
|
|
2
|
-
import { g as E, S as T } from "./surface-
|
|
2
|
+
import { g as E, S as T } from "./surface-Cg3eyRpj.js";
|
|
3
3
|
import { w as A } from "./sdk-promise-D0sy7OW1.js";
|
|
4
4
|
import { getChatSDK as v } from "./chat/index.js";
|
|
5
5
|
import { r as x } from "./TelemetryUploader-DKkdppe9.js";
|
package/dist/app/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as e } from "./surface-
|
|
1
|
+
import { S as e } from "./surface-Cg3eyRpj.js";
|
|
2
2
|
const s = {
|
|
3
3
|
callTool: !0,
|
|
4
4
|
sendMessageToHost: !0,
|
|
@@ -69,6 +69,7 @@ const s = {
|
|
|
69
69
|
};
|
|
70
70
|
function r(t) {
|
|
71
71
|
switch (t) {
|
|
72
|
+
case e.Claude:
|
|
72
73
|
case e.MCPApps:
|
|
73
74
|
return { ...s };
|
|
74
75
|
case e.OpenAI:
|
package/dist/chat/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,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,WAAW,EACX,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,UAAU,EACV,QAAQ,EACR,SAAS,GACT,MAAM,SAAS,CAAC"}
|
package/dist/chat/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as c, S as
|
|
1
|
+
import { g as c, S as s, a as d } from "../surface-Cg3eyRpj.js";
|
|
2
2
|
import { w as p } from "../sdk-promise-D0sy7OW1.js";
|
|
3
3
|
import { requireSharedSession as h } from "../ui-embedding/session.js";
|
|
4
4
|
class a {
|
|
@@ -229,8 +229,8 @@ class g {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
let i = null, r = null;
|
|
232
|
-
function y(
|
|
233
|
-
return i || (i = b(
|
|
232
|
+
function y(n) {
|
|
233
|
+
return i || (i = b(n).then((t) => (r = t, t))), i;
|
|
234
234
|
}
|
|
235
235
|
function C() {
|
|
236
236
|
return r;
|
|
@@ -238,19 +238,20 @@ function C() {
|
|
|
238
238
|
function v() {
|
|
239
239
|
i = null, r = null;
|
|
240
240
|
}
|
|
241
|
-
function b(
|
|
241
|
+
function b(n) {
|
|
242
242
|
return p(
|
|
243
243
|
(async () => {
|
|
244
244
|
try {
|
|
245
|
-
switch (await c(
|
|
246
|
-
case
|
|
245
|
+
switch (await c(n?.surface)) {
|
|
246
|
+
case s.OpenAI:
|
|
247
247
|
return new g();
|
|
248
|
-
case
|
|
249
|
-
case
|
|
248
|
+
case s.WebApp:
|
|
249
|
+
case s.Mosaic:
|
|
250
250
|
return {};
|
|
251
|
-
case
|
|
251
|
+
case s.MicroFrontend:
|
|
252
252
|
return await a.create();
|
|
253
|
-
case
|
|
253
|
+
case s.Claude:
|
|
254
|
+
case s.MCPApps: {
|
|
254
255
|
const e = await d.getInstance();
|
|
255
256
|
return new f(e);
|
|
256
257
|
}
|
|
@@ -45,8 +45,8 @@ export interface SurfaceCapabilities {
|
|
|
45
45
|
subscribe: boolean;
|
|
46
46
|
/**
|
|
47
47
|
* True when the surface implements `getToolResultGeneration`. Only
|
|
48
|
-
* surfaces that stream distinct tool results into one instance (
|
|
49
|
-
* implement it.
|
|
48
|
+
* surfaces that stream distinct tool results into one instance (the MCP
|
|
49
|
+
* Apps hosts, MCPApps and Claude) implement it.
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
52
|
* This field is optional so that adding it does not break existing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/core/capabilities.ts"],"names":[],"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,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;;;;OASG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB;;;;;;;;;OASG;IACH,0BAA0B,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAG/B,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,MAAM,EAAE,OAAO,CAAC;CAChB;AA6ED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAa5E"}
|
package/dist/core/data.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export type QuerySubscriber<T> = (snapshot: QuerySnapshot<T>) => void;
|
|
|
120
120
|
* later snapshots. `refresh` re-issues the underlying request, bypasses
|
|
121
121
|
* the cache where one exists, and propagates the result to subscribers.
|
|
122
122
|
*
|
|
123
|
-
* On uncached surfaces (Mosaic, OpenAI), `subscribe` emits only in
|
|
123
|
+
* On uncached surfaces (Mosaic, OpenAI, Claude, MCPApps), `subscribe` emits only in
|
|
124
124
|
* response to `refresh()`, because there is no cache to push background
|
|
125
125
|
* updates.
|
|
126
126
|
*
|
|
@@ -134,7 +134,7 @@ export interface QueryResult<T> extends QuerySnapshot<T> {
|
|
|
134
134
|
*
|
|
135
135
|
* @remarks
|
|
136
136
|
* This method never rejects. A failed re-fetch does not throw on the
|
|
137
|
-
* awaited `refresh()` call. On uncached surfaces (Mosaic, OpenAI), the
|
|
137
|
+
* awaited `refresh()` call. On uncached surfaces (Mosaic, OpenAI, Claude, MCPApps), the
|
|
138
138
|
* method delivers the failure to `subscribe()` callbacks as a
|
|
139
139
|
* {@link QuerySnapshot} with a populated `errors` array. On cached
|
|
140
140
|
* surfaces (WebApp), a failed re-fetch is not observable on the
|
|
@@ -274,7 +274,7 @@ export interface DataSDKGraphQL {
|
|
|
274
274
|
* `refresh` re-issues the request, bypasses the cache where one
|
|
275
275
|
* exists, and propagates the result to subscribers.
|
|
276
276
|
*
|
|
277
|
-
* On uncached surfaces (Mosaic, OpenAI), `subscribe` is real, but it
|
|
277
|
+
* On uncached surfaces (Mosaic, OpenAI, Claude, MCPApps), `subscribe` is real, but it
|
|
278
278
|
* emits only in response to `refresh()`. There is no cache to push
|
|
279
279
|
* background updates, so `refresh()` is the sole source of new
|
|
280
280
|
* snapshots, and each call costs one network request.
|
|
@@ -364,8 +364,8 @@ export interface DataSDK {
|
|
|
364
364
|
*
|
|
365
365
|
* @remarks
|
|
366
366
|
* This field is present on URL-backed adapters whose request paths
|
|
367
|
-
* derive from a concrete version
|
|
368
|
-
* may omit it.
|
|
367
|
+
* derive from a concrete version, including Claude/MCPApps dispatch paths.
|
|
368
|
+
* OpenAI and degraded surfaces may omit it.
|
|
369
369
|
*/
|
|
370
370
|
readonly apiVersion?: string;
|
|
371
371
|
/** The GraphQL namespace. Present when the surface supports data operations. */
|
package/dist/core/index.d.ts
CHANGED
|
@@ -8,12 +8,12 @@ export type { InitializeOptions } from './surface';
|
|
|
8
8
|
export type { SDKOptions } from './options';
|
|
9
9
|
export type { AppIdentity, CurrentApp } from './app';
|
|
10
10
|
export type { HostContext, HostStyles, ChatMessage, ChatSDK, ContentBlock, DeviceCapabilities, DisplayMode, ResourceRequest, SafeAreaInsets, SetWidgetStateOptions, ToolCall, ToolState, } from './chat';
|
|
11
|
-
export type { AlertOptions, MessageLevel, ModalOptions, ToastOptions, Theme, ThemeMode, UiState, UiStyles, ViewSDK, } from './view';
|
|
11
|
+
export type { AlertOptions, MessageLevel, ModalOptions, ModalResult, PageAttributes, PageReference, ToastOptions, Theme, ThemeMode, UiState, UiStyles, ViewSDK, } from './view';
|
|
12
12
|
export type { CacheControl, DataSDK, DataSDKGraphQL, GraphQLError, GraphQLRawDocument, GraphQLRequest, GraphQLRequestHeaders, GraphQLResponse, MutateOptions, MutationResult, QueryOptions, QueryResult, QuerySubscriber, Unsubscribe, } from './data';
|
|
13
13
|
export type { LightningSDK, LMSMessage, LMSSubscription, MessageChannel } from './lightning';
|
|
14
14
|
export type { OpenAISDK } from './platforms';
|
|
15
15
|
export { McpAppsNotAvailableError, McpAppsSession } from './mcpapps-session';
|
|
16
|
-
export type { McpAppsHostContext, McpAppsSessionOptions } from './mcpapps-session';
|
|
16
|
+
export type { McpAppsHostContext, McpAppsHostInfo, McpAppsSessionOptions } from './mcpapps-session';
|
|
17
17
|
export { getSurfaceCapabilities } from './capabilities';
|
|
18
18
|
export type { SurfaceCapabilities } from './capabilities';
|
|
19
19
|
export { wrapSDKPromise } from './sdk-promise';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACN,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,YAAY,GACZ,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGrD,YAAY,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,QAAQ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W,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,GACP,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACX,YAAY,EACZ,OAAO,EACP,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,GACX,MAAM,QAAQ,CAAC;AAGhB,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7F,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAS/C,YAAY,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,eAAe,GACf,MAAM,mBAAmB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-
|
|
2
|
-
import { g as c } from "../capabilities-
|
|
1
|
+
import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-Cg3eyRpj.js";
|
|
2
|
+
import { g as c } from "../capabilities-B3Raifjg.js";
|
|
3
3
|
import { w as g } from "../sdk-promise-D0sy7OW1.js";
|
|
4
4
|
export {
|
|
5
5
|
r as McpAppsNotAvailableError,
|
|
@@ -56,6 +56,13 @@ export interface McpAppsHostContext {
|
|
|
56
56
|
/** The styles that the host provides for theming and font loading. */
|
|
57
57
|
styles?: HostStyles;
|
|
58
58
|
}
|
|
59
|
+
/** The host identity that the `ui/initialize` handshake returns. */
|
|
60
|
+
export interface McpAppsHostInfo {
|
|
61
|
+
/** The host application name, for example `"Claude"`. */
|
|
62
|
+
name: string;
|
|
63
|
+
/** The host application version. */
|
|
64
|
+
version?: string;
|
|
65
|
+
}
|
|
59
66
|
/** The options for `McpAppsSession` initialization. */
|
|
60
67
|
export interface McpAppsSessionOptions {
|
|
61
68
|
/**
|
|
@@ -77,17 +84,18 @@ export interface McpAppsSessionOptions {
|
|
|
77
84
|
handshakeTimeoutMs?: number;
|
|
78
85
|
}
|
|
79
86
|
/**
|
|
80
|
-
* The error that the SDK throws when
|
|
81
|
-
* the SEP-1865 `ui/initialize` handshake has not
|
|
87
|
+
* The error that the SDK throws when an MCP Apps surface, MCPApps or
|
|
88
|
+
* Claude, is required, but the SEP-1865 `ui/initialize` handshake has not
|
|
89
|
+
* succeeded.
|
|
82
90
|
*
|
|
83
91
|
* @remarks
|
|
84
92
|
* In practice, this error surfaces only on the `options.surface` override
|
|
85
|
-
* path. A caller that forces `{ surface: Surface.MCPApps }`
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* surface.
|
|
93
|
+
* path. A caller that forces `{ surface: Surface.MCPApps }` or
|
|
94
|
+
* `{ surface: Surface.Claude }` bypasses detection, so the handshake may
|
|
95
|
+
* run, and time out, for the first time during verification. Detection
|
|
96
|
+
* never yields MCPApps or Claude without a live handshake, so the
|
|
97
|
+
* no-override path cannot raise this error. This mirrors
|
|
98
|
+
* {@link SfEmbeddingNotAvailableError} for the MicroFrontend surface.
|
|
91
99
|
*/
|
|
92
100
|
export declare class McpAppsNotAvailableError extends Error {
|
|
93
101
|
constructor();
|
|
@@ -108,6 +116,7 @@ export declare class McpAppsNotAvailableError extends Error {
|
|
|
108
116
|
export declare class McpAppsSession extends JsonRpcClient {
|
|
109
117
|
private static initPromise;
|
|
110
118
|
private hostCtx;
|
|
119
|
+
private _hostInfo;
|
|
111
120
|
private _handshakeSucceeded;
|
|
112
121
|
/**
|
|
113
122
|
* Gets or creates the shared session singleton.
|
|
@@ -134,6 +143,8 @@ export declare class McpAppsSession extends JsonRpcClient {
|
|
|
134
143
|
private handshake;
|
|
135
144
|
/** Returns the current host context, from the handshake and later notification updates. */
|
|
136
145
|
getHostContext(): McpAppsHostContext;
|
|
146
|
+
/** Returns the host identity from the handshake, or `undefined` when the host sent none. */
|
|
147
|
+
getHostInfo(): McpAppsHostInfo | undefined;
|
|
137
148
|
/** True when the `ui/initialize` handshake completed successfully, without timing out. */
|
|
138
149
|
get handshakeSucceeded(): boolean;
|
|
139
150
|
request<TParams = unknown, TResult = unknown>(method: string, params: TParams): Promise<TResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpapps-session.d.ts","sourceRoot":"","sources":["../../src/core/mcpapps-session.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAA8B,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAClC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gCAAgC;IAChC,mBAAmB,CAAC,EAAE;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,2CAA2C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CAA0B;IACzC,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,mBAAmB,CAAS;IAEpC;;;;;;;;;;OAUG;WACU,WAAW,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC;IAoBlF;;;;;;;;;OASG;YACW,SAAS;IAwCvB,2FAA2F;IAC3F,cAAc,IAAI,kBAAkB;IAIpC,4FAA4F;IAC5F,WAAW,IAAI,eAAe,GAAG,SAAS;IAI1C,0FAA0F;IAC1F,IAAI,kBAAkB,IAAI,OAAO,CAEhC;IAMe,OAAO,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAC3D,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GACb,OAAO,CAAC,OAAO,CAAC;IAIH,gBAAgB,CAAC,OAAO,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAI3E,2BAA2B,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAChC,IAAI;CAGP"}
|
package/dist/core/surface.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ export declare enum Surface {
|
|
|
7
7
|
MicroFrontend = "Micro-Frontend",
|
|
8
8
|
OpenAI = "OpenAI",
|
|
9
9
|
MCPApps = "MCP-Apps",
|
|
10
|
-
Mosaic = "Mosaic"
|
|
10
|
+
Mosaic = "Mosaic",
|
|
11
|
+
Claude = "Claude"
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* The options for the one-time {@link initialize} lifecycle call.
|
|
@@ -99,14 +100,15 @@ export declare function isSfEmbeddingIframe(): boolean;
|
|
|
99
100
|
* `initialize({ mcpApps })` would not throw. See the W-23083001 review
|
|
100
101
|
* feedback.
|
|
101
102
|
*
|
|
102
|
-
* Only the `override` path adds a verification check, and only for
|
|
103
|
-
* MCPApps. An override bypasses detection's
|
|
104
|
-
* forces {@link Surface.MCPApps}
|
|
105
|
-
*
|
|
103
|
+
* Only the `override` path adds a verification check, and only for the
|
|
104
|
+
* MCP Apps hosts, MCPApps and Claude. An override bypasses detection's
|
|
105
|
+
* result, so a caller that forces {@link Surface.MCPApps} or
|
|
106
|
+
* {@link Surface.Claude} may not have a vetted handshake. When the
|
|
107
|
+
* handshake has not succeeded, this function throws
|
|
106
108
|
* {@link McpAppsNotAvailableError}. The detection path needs no extra
|
|
107
|
-
* check, because {@link detectSurface} only yields MCPApps
|
|
108
|
-
* successful handshake. The {@link McpAppsSession.getInstance}
|
|
109
|
-
* memoized and shared with detection, so in a real MCP Apps iframe this
|
|
109
|
+
* check, because {@link detectSurface} only yields MCPApps or Claude
|
|
110
|
+
* after a successful handshake. The {@link McpAppsSession.getInstance}
|
|
111
|
+
* call is memoized and shared with detection, so in a real MCP Apps iframe this
|
|
110
112
|
* reuses the session that detection already built, with no second
|
|
111
113
|
* handshake. This centralizes the liveness check that the SDK factories
|
|
112
114
|
* previously each performed inline. The factories catch the error and
|
|
@@ -116,8 +118,8 @@ export declare function isSfEmbeddingIframe(): boolean;
|
|
|
116
118
|
* @param override - The explicit surface that overrides the detected
|
|
117
119
|
* result. Detection itself still runs once, to claim the lifecycle.
|
|
118
120
|
* @returns The verified surface.
|
|
119
|
-
* @throws {McpAppsNotAvailableError} When MCPApps is required
|
|
120
|
-
* handshake has not succeeded.
|
|
121
|
+
* @throws {McpAppsNotAvailableError} When MCPApps or Claude is required
|
|
122
|
+
* but the handshake has not succeeded.
|
|
121
123
|
*/
|
|
122
124
|
export declare function getVerifiedSurface(override?: Surface): Promise<Surface>;
|
|
123
125
|
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/core/surface.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;GAEG;AACH,oBAAY,OAAO;IAClB,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,MAAM,WAAW;IACjB,OAAO,aAAa;IACpB,MAAM,WAAW;CACjB;
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/core/surface.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;GAEG;AACH,oBAAY,OAAO;IAClB,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,MAAM,WAAW;IACjB,OAAO,aAAa;IACpB,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AASD;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAChC;AA2HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB9E;AAoBD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAU7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAqC7E"}
|
package/dist/core/view.d.ts
CHANGED
|
@@ -105,6 +105,23 @@ export interface ToastOptions {
|
|
|
105
105
|
* `info` when you omit it.
|
|
106
106
|
*/
|
|
107
107
|
level?: MessageLevel;
|
|
108
|
+
/**
|
|
109
|
+
* The title to display above the message.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* Surfaces without toast titles ignore this value.
|
|
113
|
+
*/
|
|
114
|
+
title?: string;
|
|
115
|
+
/**
|
|
116
|
+
* How the toast dismisses.
|
|
117
|
+
*
|
|
118
|
+
* @remarks
|
|
119
|
+
* - `dismissible` — dismisses automatically or when the user closes it.
|
|
120
|
+
* - `sticky` — stays until the user closes it.
|
|
121
|
+
*
|
|
122
|
+
* Surfaces without dismissal modes ignore this value.
|
|
123
|
+
*/
|
|
124
|
+
mode?: "dismissible" | "sticky";
|
|
108
125
|
}
|
|
109
126
|
/**
|
|
110
127
|
* The configuration for displaying a modal dialog.
|
|
@@ -122,8 +139,14 @@ export interface ModalOptions {
|
|
|
122
139
|
* @remarks
|
|
123
140
|
* Include the template file in your application's UI resources.
|
|
124
141
|
*
|
|
142
|
+
* On the embedded MicroFrontend surface, pass the name of a modal
|
|
143
|
+
* component that the host registers instead of a URI. Use `default`
|
|
144
|
+
* for the host's generic modal. The host rejects any other name that
|
|
145
|
+
* it does not register.
|
|
146
|
+
*
|
|
125
147
|
* @example "ui://widget/confirmation.html"
|
|
126
148
|
* @example "ui://widget/settings.html"
|
|
149
|
+
* @example "default"
|
|
127
150
|
*/
|
|
128
151
|
componentReference: string;
|
|
129
152
|
/**
|
|
@@ -133,9 +156,84 @@ export interface ModalOptions {
|
|
|
133
156
|
* The modal can access these parameters through the host's API. For
|
|
134
157
|
* example, on the OpenAI surface, through `window.openai.view.params`.
|
|
135
158
|
*
|
|
159
|
+
* On the embedded MicroFrontend surface, the parameters set the modal
|
|
160
|
+
* component's attributes. The `default` modal reads `heading` and
|
|
161
|
+
* `content`. The values must be structured-cloneable. The host
|
|
162
|
+
* controls the modal's `size`, `label`, `description`, and
|
|
163
|
+
* `disableClose` settings and drops those keys from `params`. Set
|
|
164
|
+
* `size` and `label` through the top-level options instead.
|
|
165
|
+
*
|
|
136
166
|
* @example { userId: "123", mode: "edit" }
|
|
167
|
+
* @example { heading: "Saved", content: "Your changes are saved." }
|
|
137
168
|
*/
|
|
138
169
|
params?: Record<string, unknown>;
|
|
170
|
+
/**
|
|
171
|
+
* The modal size.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Surfaces without modal sizes ignore this value.
|
|
175
|
+
*/
|
|
176
|
+
size?: "small" | "medium" | "large";
|
|
177
|
+
/**
|
|
178
|
+
* The modal's accessible label, shown as its heading.
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* Surfaces without modal labels ignore this value.
|
|
182
|
+
*/
|
|
183
|
+
label?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The value a modal resolves with when the user dismisses it.
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Only surfaces whose modals report a result on dismissal, such as the
|
|
190
|
+
* embedded MicroFrontend surface, resolve with this value. Other
|
|
191
|
+
* surfaces resolve with `undefined`.
|
|
192
|
+
*/
|
|
193
|
+
export interface ModalResult {
|
|
194
|
+
/**
|
|
195
|
+
* The value the modal closed with, or `undefined` when it closed
|
|
196
|
+
* without one.
|
|
197
|
+
*/
|
|
198
|
+
closeResult?: unknown;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The values that identify a page in a {@link PageReference}.
|
|
202
|
+
*
|
|
203
|
+
* @remarks
|
|
204
|
+
* Most values are strings. Some page types take an object, such as the
|
|
205
|
+
* nested page reference in the `pageRef` attribute of `standard__app`.
|
|
206
|
+
* Functions, DOM nodes, and class instances cannot cross the host
|
|
207
|
+
* boundary.
|
|
208
|
+
*
|
|
209
|
+
* @example { objectApiName: "Account", actionName: "home" }
|
|
210
|
+
*/
|
|
211
|
+
export interface PageAttributes {
|
|
212
|
+
[key: string]: string | number | boolean | null | PageReference | PageAttributes | PageAttributes[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A structured navigation target.
|
|
216
|
+
*
|
|
217
|
+
* @remarks
|
|
218
|
+
* This shape mirrors a Lightning `PageReference`: `type` names the page
|
|
219
|
+
* kind, `attributes` identify the page, and `state` carries URL query
|
|
220
|
+
* parameters.
|
|
221
|
+
*
|
|
222
|
+
* @example { type: "standard__objectPage", attributes: { objectApiName: "Account", actionName: "home" } }
|
|
223
|
+
*/
|
|
224
|
+
export interface PageReference {
|
|
225
|
+
/**
|
|
226
|
+
* The page kind, for example `standard__recordPage` or `standard__namedPage`.
|
|
227
|
+
*/
|
|
228
|
+
type: string;
|
|
229
|
+
/**
|
|
230
|
+
* The values that identify the page.
|
|
231
|
+
*/
|
|
232
|
+
attributes?: PageAttributes;
|
|
233
|
+
/**
|
|
234
|
+
* The query parameters for the page.
|
|
235
|
+
*/
|
|
236
|
+
state?: Record<string, string>;
|
|
139
237
|
}
|
|
140
238
|
/**
|
|
141
239
|
* The View SDK API for displaying UI elements and managing view state.
|
|
@@ -231,8 +329,14 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
231
329
|
* loads the template from a UI resource URI, and you can pass
|
|
232
330
|
* parameters to the modal for dynamic content.
|
|
233
331
|
*
|
|
332
|
+
* On the embedded MicroFrontend surface, `componentReference` names a
|
|
333
|
+
* modal component that the host registers. The promise resolves only
|
|
334
|
+
* when the user dismisses the modal, with the modal's
|
|
335
|
+
* {@link ModalResult}. The host rejects an unregistered component.
|
|
336
|
+
*
|
|
234
337
|
* @param options - The modal configuration.
|
|
235
|
-
* @returns Resolves once the host displays the modal
|
|
338
|
+
* @returns Resolves once the host displays the modal, or, on surfaces
|
|
339
|
+
* that report a result, once the user dismisses it.
|
|
236
340
|
*
|
|
237
341
|
* @example
|
|
238
342
|
* ```typescript
|
|
@@ -245,7 +349,7 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
245
349
|
* });
|
|
246
350
|
* ```
|
|
247
351
|
*/
|
|
248
|
-
displayModal?(options: ModalOptions): Promise<void>;
|
|
352
|
+
displayModal?(options: ModalOptions): Promise<ModalResult | void>;
|
|
249
353
|
/**
|
|
250
354
|
* Navigates to a different URL within the application.
|
|
251
355
|
*
|
|
@@ -254,16 +358,26 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
254
358
|
* behavior may vary depending on the surface, through full-page
|
|
255
359
|
* navigation or iframe navigation.
|
|
256
360
|
*
|
|
257
|
-
*
|
|
361
|
+
* On the embedded MicroFrontend surface, the host performs Lightning
|
|
362
|
+
* navigation. Pass a {@link PageReference} to target a Lightning page
|
|
363
|
+
* directly. A URL string navigates as a `standard__webPage`.
|
|
364
|
+
*
|
|
365
|
+
* @param destination - The URL to navigate to, relative or absolute.
|
|
366
|
+
* On the embedded MicroFrontend surface, a structured
|
|
367
|
+
* {@link PageReference} is also accepted.
|
|
258
368
|
* @returns Resolves once the host starts navigation.
|
|
259
369
|
*
|
|
260
370
|
* @example
|
|
261
371
|
* ```typescript
|
|
262
372
|
* await viewSDK.navigateTo?.('/dashboard');
|
|
263
373
|
* await viewSDK.navigateTo?.('https://example.com/page');
|
|
374
|
+
* await viewSDK.navigateTo?.({
|
|
375
|
+
* type: 'standard__objectPage',
|
|
376
|
+
* attributes: { objectApiName: 'Account', actionName: 'home' }
|
|
377
|
+
* });
|
|
264
378
|
* ```
|
|
265
379
|
*/
|
|
266
|
-
navigateTo?(
|
|
380
|
+
navigateTo?(destination: string | PageReference): Promise<void>;
|
|
267
381
|
/**
|
|
268
382
|
* Marks the application state as dirty, meaning it has unsaved
|
|
269
383
|
* changes.
|
package/dist/core/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,QAAQ,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC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AI,CAAC;CAC1B,CAAC"}
|
package/dist/data/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { MosaicDataSDKOptions } from './mosaic';
|
|
|
11
11
|
*/
|
|
12
12
|
export type StatusCallback = () => Promise<unknown> | void;
|
|
13
13
|
/**
|
|
14
|
-
* Options for
|
|
14
|
+
* Options for WebApp and microfrontends with a Salesforce runtime.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
17
|
* Pass these as `DataSDKOptions.webapp`.
|
|
@@ -36,6 +36,38 @@ export interface WebAppDataSDKOptions {
|
|
|
36
36
|
apiVersion?: string;
|
|
37
37
|
}
|
|
38
38
|
export type { MosaicDataSDKOptions };
|
|
39
|
+
/**
|
|
40
|
+
* Options for the Claude surface.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Pass these as `DataSDKOptions.claude`. Session configuration belongs to `initialize`, not this
|
|
44
|
+
* option bag.
|
|
45
|
+
*
|
|
46
|
+
* @see docs/data/04-surfaces-and-guards.md
|
|
47
|
+
*/
|
|
48
|
+
export interface ClaudeDataSDKOptions {
|
|
49
|
+
/**
|
|
50
|
+
* The Salesforce API version used for dispatch.
|
|
51
|
+
* @example "66.0"
|
|
52
|
+
*/
|
|
53
|
+
apiVersion?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Options for the MCP Apps surface.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Pass these as `DataSDKOptions.mcpApps`. Session configuration belongs to `initialize`, not this
|
|
60
|
+
* option bag.
|
|
61
|
+
*
|
|
62
|
+
* @see docs/data/04-surfaces-and-guards.md
|
|
63
|
+
*/
|
|
64
|
+
export interface MCPAppsDataSDKOptions {
|
|
65
|
+
/**
|
|
66
|
+
* The Salesforce API version used for dispatch.
|
|
67
|
+
* @example "66.0"
|
|
68
|
+
*/
|
|
69
|
+
apiVersion?: string;
|
|
70
|
+
}
|
|
39
71
|
/**
|
|
40
72
|
* An extension authored for the DataSDK surface: {@link Extension} with the base SDK
|
|
41
73
|
* pre-applied to `DataSDK`.
|
|
@@ -55,7 +87,7 @@ export interface DataSDKExtension<Name extends string = string, Api = unknown> e
|
|
|
55
87
|
* particular API version introduced.
|
|
56
88
|
*
|
|
57
89
|
* On versioned surfaces, `createDataSDK` compares this value with the resolved
|
|
58
|
-
* {@link DataSDK.apiVersion} before any extension setup runs.
|
|
90
|
+
* {@link DataSDK.apiVersion} before any extension setup runs. OpenAI and degraded
|
|
59
91
|
* surfaces expose no comparable version, so they retain their existing attach behavior.
|
|
60
92
|
*/
|
|
61
93
|
minApiVersion?: string;
|
|
@@ -94,14 +126,14 @@ export type DataSDKWithExtensions<Extensions extends ExtensionsFor<DataSDK>> = E
|
|
|
94
126
|
* Options for creating a DataSDK instance.
|
|
95
127
|
*
|
|
96
128
|
* @remarks
|
|
97
|
-
* These options cover surface selection, the per-surface option bags (`webapp`, `mosaic`), and
|
|
129
|
+
* These options cover surface selection, the per-surface option bags (`webapp`, `mosaic`, `claude`, `mcpApps`), and
|
|
98
130
|
* any `extensions`.
|
|
99
131
|
*
|
|
100
132
|
* @see docs/data/04-surfaces-and-guards.md
|
|
101
133
|
*/
|
|
102
134
|
export interface DataSDKOptions extends SDKOptions {
|
|
103
135
|
/**
|
|
104
|
-
* WebApp-
|
|
136
|
+
* Options for WebApp and microfrontends with a non-null SFDC_ENV object.
|
|
105
137
|
* @example { basePath: "/services/data/v64.0" }
|
|
106
138
|
*/
|
|
107
139
|
webapp?: WebAppDataSDKOptions;
|
|
@@ -110,6 +142,16 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
110
142
|
* @example { instanceUrl: "https://my.salesforce.com", accessToken: "00D..." }
|
|
111
143
|
*/
|
|
112
144
|
mosaic?: MosaicDataSDKOptions;
|
|
145
|
+
/**
|
|
146
|
+
* Claude-surface options.
|
|
147
|
+
* @example { apiVersion: "66.0" }
|
|
148
|
+
*/
|
|
149
|
+
claude?: ClaudeDataSDKOptions;
|
|
150
|
+
/**
|
|
151
|
+
* MCP Apps-surface options.
|
|
152
|
+
* @example { apiVersion: "66.0" }
|
|
153
|
+
*/
|
|
154
|
+
mcpApps?: MCPAppsDataSDKOptions;
|
|
113
155
|
/**
|
|
114
156
|
* The extensions to attach.
|
|
115
157
|
*
|
|
@@ -135,6 +177,9 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
135
177
|
* @remarks
|
|
136
178
|
* Each call creates a new instance. The options apply to every call.
|
|
137
179
|
*
|
|
180
|
+
* Microfrontends reuse WebAppDataSDK when `globalThis.SFDC_ENV` is a non-null object.
|
|
181
|
+
* Otherwise, their base SDK is empty. Data calls do not use the embedding bridge.
|
|
182
|
+
*
|
|
138
183
|
* When `extensions` is supplied, the result type accumulates each extension's namespace under
|
|
139
184
|
* its own key inside the SDK's `ext` container — `sdk.ext.<name>` (see
|
|
140
185
|
* {@link DataSDKWithExtensions}). Otherwise, the result is a plain {@link DataSDK}.
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKpE;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D;;;;;;;GAOG;AACH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