@salesforce/platform-sdk 12.8.0 → 12.10.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 (116) hide show
  1. package/dist/analytics/analytics.d.ts +19 -15
  2. package/dist/analytics/analytics.d.ts.map +1 -1
  3. package/dist/analytics/error-listener.d.ts +3 -3
  4. package/dist/analytics/index.d.ts.map +1 -1
  5. package/dist/analytics/index.js +1 -1
  6. package/dist/analytics/method-configs.d.ts +8 -4
  7. package/dist/analytics/method-configs.d.ts.map +1 -1
  8. package/dist/analytics/pft.d.ts +22 -16
  9. package/dist/analytics/pft.d.ts.map +1 -1
  10. package/dist/analytics/proxy.d.ts +10 -8
  11. package/dist/analytics/proxy.d.ts.map +1 -1
  12. package/dist/analytics/types.d.ts +57 -43
  13. package/dist/analytics/types.d.ts.map +1 -1
  14. package/dist/{analytics-Dpz22kda.js → analytics-wESbWdca.js} +1 -1
  15. package/dist/app/index.d.ts +18 -13
  16. package/dist/app/index.d.ts.map +1 -1
  17. package/dist/app/index.js +5 -3
  18. package/dist/app/webapp.d.ts +5 -2
  19. package/dist/app/webapp.d.ts.map +1 -1
  20. package/dist/{capabilities-CKe8z6kZ.js → capabilities-B0mU0_G0.js} +1 -1
  21. package/dist/chat/index.js +1 -1
  22. package/dist/core/app.d.ts +31 -22
  23. package/dist/core/app.d.ts.map +1 -1
  24. package/dist/core/capabilities.d.ts +26 -17
  25. package/dist/core/capabilities.d.ts.map +1 -1
  26. package/dist/core/chat.d.ts +155 -125
  27. package/dist/core/chat.d.ts.map +1 -1
  28. package/dist/core/data.d.ts +146 -107
  29. package/dist/core/data.d.ts.map +1 -1
  30. package/dist/core/extension-attach.d.ts +65 -51
  31. package/dist/core/extension-attach.d.ts.map +1 -1
  32. package/dist/core/extension-types.d.ts +214 -153
  33. package/dist/core/extension-types.d.ts.map +1 -1
  34. package/dist/core/index.d.ts.map +1 -1
  35. package/dist/core/index.js +2 -2
  36. package/dist/core/lightning.d.ts +11 -19
  37. package/dist/core/lightning.d.ts.map +1 -1
  38. package/dist/core/mcpapps-session.d.ts +63 -52
  39. package/dist/core/mcpapps-session.d.ts.map +1 -1
  40. package/dist/core/options.d.ts +6 -4
  41. package/dist/core/options.d.ts.map +1 -1
  42. package/dist/core/platforms.d.ts +29 -29
  43. package/dist/core/sdk-promise.d.ts +7 -4
  44. package/dist/core/sdk-promise.d.ts.map +1 -1
  45. package/dist/core/surface.d.ts +89 -67
  46. package/dist/core/surface.d.ts.map +1 -1
  47. package/dist/core/view.d.ts +164 -113
  48. package/dist/core/view.d.ts.map +1 -1
  49. package/dist/data/extensions/index.d.ts +5 -2
  50. package/dist/data/extensions/index.d.ts.map +1 -1
  51. package/dist/data/extensions/labels/index.d.ts +72 -49
  52. package/dist/data/extensions/labels/index.d.ts.map +1 -1
  53. package/dist/data/extensions/labels/query.d.ts +38 -29
  54. package/dist/data/extensions/labels/query.d.ts.map +1 -1
  55. package/dist/data/gql.d.ts +8 -4
  56. package/dist/data/gql.d.ts.map +1 -1
  57. package/dist/data/index.d.ts +67 -48
  58. package/dist/data/index.d.ts.map +1 -1
  59. package/dist/data/index.js +265 -242
  60. package/dist/data/mosaic/fetch.d.ts +24 -15
  61. package/dist/data/mosaic/fetch.d.ts.map +1 -1
  62. package/dist/data/mosaic/index.d.ts +13 -9
  63. package/dist/data/mosaic/index.d.ts.map +1 -1
  64. package/dist/data/openai/index.d.ts +11 -5
  65. package/dist/data/openai/index.d.ts.map +1 -1
  66. package/dist/data/shared/graphql/cache/command.d.ts +60 -46
  67. package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
  68. package/dist/data/shared/graphql/cache/invoker.d.ts.map +1 -1
  69. package/dist/data/shared/graphql/cache/services.d.ts +21 -11
  70. package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
  71. package/dist/data/shared/graphql/cached-graphql.d.ts +9 -4
  72. package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
  73. package/dist/data/shared/graphql/graphql-parse.d.ts +6 -3
  74. package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
  75. package/dist/data/shared/graphql/headers.d.ts +34 -27
  76. package/dist/data/shared/graphql/headers.d.ts.map +1 -1
  77. package/dist/data/shared/graphql/parse-response.d.ts +31 -23
  78. package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
  79. package/dist/data/shared/graphql/uncached-graphql.d.ts +10 -6
  80. package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
  81. package/dist/data/shared/url-utils.d.ts +1 -1
  82. package/dist/data/shared/url-utils.d.ts.map +1 -1
  83. package/dist/data/webapp/accept-language.interceptor.d.ts +26 -9
  84. package/dist/data/webapp/accept-language.interceptor.d.ts.map +1 -1
  85. package/dist/data/webapp/client-headers.interceptor.d.ts +4 -3
  86. package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -1
  87. package/dist/data/webapp/csrf/header.interceptor.d.ts +4 -4
  88. package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -1
  89. package/dist/data/webapp/csrf/retry.policy.d.ts +12 -11
  90. package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -1
  91. package/dist/data/webapp/csrf/token-manager.d.ts +18 -12
  92. package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
  93. package/dist/data/webapp/fetch.d.ts +12 -8
  94. package/dist/data/webapp/fetch.d.ts.map +1 -1
  95. package/dist/data/webapp/index.d.ts +12 -7
  96. package/dist/data/webapp/index.d.ts.map +1 -1
  97. package/dist/i18n/locale-format.d.ts +23 -21
  98. package/dist/i18n/locale-format.d.ts.map +1 -1
  99. package/dist/i18n/salesforce-backend.d.ts +19 -11
  100. package/dist/i18n/salesforce-backend.d.ts.map +1 -1
  101. package/dist/i18n/salesforce-detector.d.ts +22 -14
  102. package/dist/i18n/salesforce-detector.d.ts.map +1 -1
  103. package/dist/index.js +3 -3
  104. package/dist/lightning/embedding.d.ts.map +1 -1
  105. package/dist/lightning/index.d.ts +4 -4
  106. package/dist/lightning/index.d.ts.map +1 -1
  107. package/dist/lightning/index.js +2 -2
  108. package/dist/{surface-Dd2tqrPi.js → surface-DWDgqdpN.js} +18 -13
  109. package/dist/telemetry/tool-adapter.d.ts.map +1 -1
  110. package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -1
  111. package/dist/ui-embedding/index.d.ts.map +1 -1
  112. package/dist/ui-embedding/session.d.ts +7 -2
  113. package/dist/ui-embedding/session.d.ts.map +1 -1
  114. package/dist/ui-embedding/session.js +1 -1
  115. package/dist/view/index.js +1 -1
  116. package/package.json +2 -2
@@ -1,32 +1,36 @@
1
1
  import { Analytics, AnalyticsOptions } from './types';
2
2
  /**
3
- * Creates an Analytics instance with auto-instrumentation active immediately.
3
+ * Creates an Analytics instance and starts auto-instrumentation immediately.
4
4
  *
5
- * Handles all setup internally:
6
- * - Creates a ChatSDK instance via getChatSDK() (unless one is provided)
7
- * - Calls registerInstrumentedApp() with appPayloadProvider pre-wired
8
- * to attach appId and surface (always), plus the customer pftId (when set)
9
- * to every o11y log entry
10
- * - Wraps the ChatSDK in a Proxy for auto-instrumentation
11
- * - Sets up global error listeners (window.onerror, unhandledrejection)
12
- * - Tracks session duration from init to dispose()
5
+ * @remarks
6
+ * This function handles setup internally:
7
+ * - It creates a `ChatSDK` instance with `getChatSDK()`, unless the caller
8
+ * provides one.
9
+ * - It calls `registerInstrumentedApp()` with `appPayloadProvider` wired to
10
+ * attach `appId` and the surface to every o11y log entry, plus the
11
+ * `pftId` when set.
12
+ * - It wraps the `ChatSDK` in a `Proxy` for auto-instrumentation.
13
+ * - It sets up global error listeners (`window.onerror`,
14
+ * `unhandledrejection`).
15
+ * - It tracks session duration from init to `dispose()`.
13
16
  *
14
- * The PFT Id is late-bound via a closure-captured ref read on every payload
15
- * emission, so {@link Analytics.setPftId} updates are reflected in subsequent
16
- * events without re-registering the app.
17
+ * The PFT Id is late-bound through a closure-captured reference that this
18
+ * function reads on every payload emission. As a result,
19
+ * {@link Analytics.setPftId} updates later events without a new app
20
+ * registration.
17
21
  *
18
22
  * @example
19
23
  * ```typescript
20
24
  * import { createAnalytics } from '../analytics';
21
25
  *
22
- * // Static widget — PFT known at init time
26
+ * // Static widget: the PFT Id is known at init time
23
27
  * const analytics = await createAnalytics({
24
28
  * appId: 'my-app',
25
29
  * pftId: 'aJCEE000000FgYP4A0',
26
30
  * });
27
31
  *
28
- * // Multi-customer widget — refresh per tool-call as new tools advertise
29
- * // their PFT Id via _meta["sfdc.pftId"] on CallToolResult
32
+ * // Multi-customer widget: refresh the PFT Id per tool call, because new
33
+ * // tools advertise their PFT Id through _meta["sfdc.pftId"] on CallToolResult
30
34
  * const analytics = await createAnalytics({ appId: 'my-app' });
31
35
  * analytics.setPftId('aJCEE000000FgYP4A0');
32
36
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/analytics/analytics.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAK7E"}
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/analytics/analytics.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAK7E"}
@@ -1,9 +1,9 @@
1
1
  import { Instrumentation } from './types';
2
2
  /**
3
- * Sets up global error auto-capture via window.onerror and
4
- * unhandledrejection, delegating to instrumentation.error().
3
+ * Sets up global error auto-capture through `window.onerror` and
4
+ * `unhandledrejection`, and sends errors to `instrumentation.error()`.
5
5
  *
6
- * Returns a cleanup function that removes both listeners.
6
+ * @returns A cleanup function that removes both listeners.
7
7
  */
8
8
  export declare function setupErrorListeners(instrumentation: Instrumentation): () => void;
9
9
  //# sourceMappingURL=error-listener.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAO3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC"}
@@ -1,4 +1,4 @@
1
- import { P as e, c as s, v as c } from "../analytics-Dpz22kda.js";
1
+ import { P as e, c as s, v as c } from "../analytics-wESbWdca.js";
2
2
  export {
3
3
  e as PFT_META_KEY,
4
4
  s as createAnalytics,
@@ -4,11 +4,15 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  export interface MethodConfig {
7
- /** Whether this method returns a Promise and should use activityAsync */
7
+ /** Whether the method returns a Promise and needs `activityAsync`. */
8
8
  isAsync: boolean;
9
- /** Extract per-call dimensional tags from the method arguments. Static tags
10
- * (surface, PFT ids) are merged in by the proxy from its getStaticTags
11
- * provider, so extractTags should return only method-specific keys. */
9
+ /**
10
+ * Extracts per-call dimensional tags from the method arguments.
11
+ *
12
+ * @remarks
13
+ * The proxy merges in static tags, such as surface and PFT ids, from its
14
+ * `getStaticTags` provider. This function returns only method-specific keys.
15
+ */
12
16
  extractTags: (args: unknown[]) => Record<string, string>;
13
17
  }
14
18
  export declare const methodConfigs: Record<string, MethodConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"method-configs.d.ts","sourceRoot":"","sources":["../../src/analytics/method-configs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB;;2EAEuE;IACvE,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzD;AAMD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAoCtD,CAAC"}
1
+ {"version":3,"file":"method-configs.d.ts","sourceRoot":"","sources":["../../src/analytics/method-configs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzD;AAMD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAoCtD,CAAC"}
@@ -4,29 +4,35 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Reserved key on `CallToolResult._meta` used by tool authors to advertise
8
- * the PFT Id their tool should be attributed to. Namespaced to avoid collision
9
- * with other `_meta` consumers.
7
+ * The reserved key on `CallToolResult._meta` that tool authors use to
8
+ * advertise the PFT Id for their tool's attribution.
9
+ *
10
+ * @remarks
11
+ * This key is namespaced to avoid collisions with other `_meta` consumers.
10
12
  */
11
13
  export declare const PFT_META_KEY = "sfdc.pftId";
12
14
  /**
13
15
  * Validates a PFT Id at the SDK boundary.
14
16
  *
15
- * - Returns `true` only for well-formed Salesforce PF Ids matching
16
- * `^aJC[0-9A-Za-z]{12}(?:[0-9A-Za-z]{3})?$` (15- or 18-character).
17
- * - Rejects `null`, `undefined`, non-strings, empty / whitespace-only strings,
18
- * any KeyPrefix other than `aJC` (PFE Ids, account/contact/user/etc.), and
19
- * anything else that isn't a clean PF Id. Whitespace-padded inputs
20
- * (`" aJC... "`) are rejected — callers must pass clean values; the SDK
21
- * does not silently rehabilitate inputs that would otherwise flow into the
22
- * wire payload and break PDP-dashboard aggregation.
17
+ * @remarks
18
+ * - Returns `true` only for a well-formed Salesforce PF Id that matches
19
+ * `^aJC[0-9A-Za-z]{12}(?:[0-9A-Za-z]{3})?$` (15 or 18 characters).
20
+ * - Rejects `null`, `undefined`, non-string values, and empty or
21
+ * whitespace-only strings.
22
+ * - Rejects any KeyPrefix other than `aJC`, for example PFE Ids, or
23
+ * account, contact, and user records.
24
+ * - Rejects whitespace-padded inputs, such as `" aJC... "`. Callers must
25
+ * pass clean values. The SDK does not fix a bad input silently, because
26
+ * that input could otherwise reach the wire payload and break
27
+ * PDP-dashboard aggregation.
23
28
  *
24
- * Rejection is silent (no throw). The first time a given invalid string is
25
- * seen in a session, a debug log is emitted via `console.debug`. Subsequent
26
- * occurrences of the same value are dropped without further logging.
29
+ * Rejection never throws. The function logs a debug message with
30
+ * `console.debug` the first time it sees a given invalid string in a
31
+ * session. It drops later occurrences of the same value without further
32
+ * logging.
27
33
  *
28
- * @param id - The candidate PFT Id (any input shape, including non-strings).
29
- * @returns `true` if the value is a valid PF Id and safe to store.
34
+ * @param id - The candidate PFT Id, in any input shape, including non-strings.
35
+ * @returns `true` when the value is a valid PF Id that is safe to store.
30
36
  *
31
37
  * @example
32
38
  * validatePftId("aJCEE000000FgYP4A0"); // → true
@@ -1 +1 @@
1
- {"version":3,"file":"pft.d.ts","sourceRoot":"","sources":["../../src/analytics/pft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAiBzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAqBvD"}
1
+ {"version":3,"file":"pft.d.ts","sourceRoot":"","sources":["../../src/analytics/pft.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,MAAM,CAuBvD"}
@@ -1,17 +1,19 @@
1
1
  import { ChatSDK } from '../core';
2
2
  import { Instrumentation } from './types';
3
3
  /**
4
- * Creates a Proxy-wrapped ChatSDK that auto-instruments every configured
5
- * method using o11y activities and counters.
4
+ * Creates a Proxy-wrapped `ChatSDK` that auto-instruments every configured
5
+ * method with o11y activities and counters.
6
6
  *
7
- * - Async methods are wrapped entirely inside activityAsync() for full
8
- * round-trip timing. incrementCounter() records call counts and error rates.
9
- * - Sync methods use incrementCounter() only.
7
+ * @remarks
8
+ * - `activityAsync()` fully wraps async methods for full round-trip timing.
9
+ * `incrementCounter()` records call counts and error rates.
10
+ * - Sync methods use only `incrementCounter()`.
10
11
  * - Unconfigured methods pass through unchanged.
11
12
  *
12
- * getStaticTags is re-read on every invocation and merged into the counter
13
- * tag map so late-bound values (PFT ids, internal-session gate) reach the
14
- * metric channel without proxy re-creation (W-23257158).
13
+ * The proxy re-reads `getStaticTags` on every invocation and merges the
14
+ * result into the counter tag map. Re-reading lets late-bound values, such
15
+ * as PFT ids and the internal-session gate, reach the metric channel
16
+ * without a proxy re-creation (W-23257158).
15
17
  */
16
18
  export declare function createInstrumentedProxy(sdk: ChatSDK, instrumentation: Instrumentation, getStaticTags: () => Record<string, string>): ChatSDK;
17
19
  //# sourceMappingURL=proxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/analytics/proxy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,OAAO,CAkCT"}
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/analytics/proxy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,OAAO,EACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,OAAO,CAmCT"}
@@ -1,7 +1,7 @@
1
1
  import { ChatSDK } from '../core';
2
2
  import { TelemetryTransport } from '../telemetry';
3
3
  /**
4
- * o11y Schema interface. Matches the Schema type from o11y.
4
+ * The o11y schema interface. Matches the `Schema` type from the o11y package.
5
5
  */
6
6
  export interface Schema {
7
7
  namespace: string;
@@ -9,14 +9,16 @@ export interface Schema {
9
9
  pbjsSchema: Record<string, unknown>;
10
10
  }
11
11
  /**
12
- * o11y SchematizedPayload — returned by PayloadProvider.getPayload().
12
+ * The o11y `SchematizedPayload` interface. `PayloadProvider.getPayload()`
13
+ * returns this shape.
13
14
  */
14
15
  export interface SchematizedPayload {
15
16
  schema: Schema;
16
17
  payload: Record<string, unknown>;
17
18
  }
18
19
  /**
19
- * o11y PayloadProviderArgs — passed to PayloadProvider.getPayload().
20
+ * The o11y `PayloadProviderArgs` interface. `PayloadProvider.getPayload()`
21
+ * receives this shape as its argument.
20
22
  */
21
23
  export interface PayloadProviderArgs {
22
24
  schema?: Schema;
@@ -24,15 +26,18 @@ export interface PayloadProviderArgs {
24
26
  logMeta?: Record<string, unknown>;
25
27
  }
26
28
  /**
27
- * o11y PayloadProvider interface.
28
- * Called on every log/error/activity/metric emission.
29
+ * The o11y `PayloadProvider` interface.
30
+ *
31
+ * @remarks
32
+ * The SDK calls this provider on every log, error, activity, or metric
33
+ * emission.
29
34
  */
30
35
  export interface PayloadProvider {
31
36
  getPayload(args?: PayloadProviderArgs): SchematizedPayload | undefined;
32
37
  }
33
38
  /**
34
- * o11y Instrumentation interface.
35
- * Defines the methods analytics uses for logging and metrics.
39
+ * The o11y `Instrumentation` interface. Defines the methods that analytics
40
+ * uses for logging and metrics.
36
41
  */
37
42
  export interface Instrumentation {
38
43
  log(schema: Schema | string, data?: Record<string, unknown>): void;
@@ -42,9 +47,9 @@ export interface Instrumentation {
42
47
  incrementCounter(name: string, increment?: number, hasError?: boolean, tags?: Record<string, string>): void;
43
48
  }
44
49
  /**
45
- * o11y InstrumentedApp interface.
46
- * Returned by registerInstrumentedApp(). Extends Instrumentation with
47
- * app-level lifecycle methods.
50
+ * The o11y `InstrumentedApp` interface. `registerInstrumentedApp()` returns
51
+ * this interface, which extends `Instrumentation` with app-level lifecycle
52
+ * methods.
48
53
  */
49
54
  export interface InstrumentedApp extends Instrumentation {
50
55
  registerLogCollector(collector: unknown): void;
@@ -54,64 +59,73 @@ export interface InstrumentedApp extends Instrumentation {
54
59
  getClientSessionId(): string;
55
60
  }
56
61
  /**
57
- * Options for createAnalytics().
62
+ * The options for `createAnalytics()`.
58
63
  *
59
- * Only `appId` is required. ChatSDK and o11y registration are handled internally.
64
+ * @remarks
65
+ * Only `appId` is required. `createAnalytics()` handles `ChatSDK` creation
66
+ * and o11y registration internally.
60
67
  */
61
68
  export interface AnalyticsOptions {
62
- /** Developer-supplied MCP App identifier */
69
+ /** The developer-supplied MCP App identifier. */
63
70
  appId: string;
64
- /** Optional ChatSDK override. If omitted, created automatically via getChatSDK(). */
71
+ /** A `ChatSDK` override. If omitted, `getChatSDK()` creates one automatically. */
65
72
  sdk?: ChatSDK;
66
- /** Optional o11y client session ID override */
73
+ /** An o11y client session ID override. */
67
74
  clientSessionId?: string;
68
- /** Optional telemetry transport. When provided, an o11y-uploader is auto-wired to route envelopes to transport.enqueue(). */
75
+ /** A telemetry transport. When set, the SDK auto-wires an o11y uploader to route envelopes to `transport.enqueue()`. */
69
76
  transport?: TelemetryTransport;
70
77
  /**
71
- * Optional Product Feature Taxonomy (PFT) Id to attribute all analytics
72
- * events to at init time. Convenient for static widgets (e.g. AccountIQ)
73
- * where the Id is known up front; multi-customer widgets (e.g. mosaic-widget)
74
- * should leave this unset and use the runtime `setPftId()` API so the value
75
- * can refresh per render or per tool-call.
78
+ * The Product Feature Taxonomy (PFT) Id to attribute all analytics
79
+ * events to at init time.
80
+ *
81
+ * @remarks
82
+ * This option is convenient for static widgets, for example AccountIQ,
83
+ * where the Id is known up front. Multi-customer widgets, for example
84
+ * mosaic-widget, should leave this field unset and use the runtime
85
+ * `setPftId()` API instead, so the value can refresh per render or per
86
+ * tool call.
76
87
  *
77
- * Validated at the boundary: only PF Ids (KeyPrefix `aJC`) are accepted;
78
- * PFE Ids (`aJD`) and malformed values are silently dropped (the instance
79
- * starts with no PFT attribution). PFT Id is advisory — used for usage-
80
- * analytics dashboards only.
88
+ * The SDK validates the Id at the boundary. It accepts only PF Ids
89
+ * (KeyPrefix `aJC`). It silently drops PFE Ids (`aJD`) and malformed
90
+ * values, and the instance starts with no PFT attribution. The PFT Id
91
+ * is advisory. The SDK uses it only for usage-analytics dashboards.
81
92
  */
82
93
  pftId?: string;
83
94
  }
84
95
  /**
85
- * Analytics instance returned by createAnalytics().
96
+ * The Analytics instance that `createAnalytics()` returns.
86
97
  */
87
98
  export interface Analytics {
88
- /** Proxy-wrapped SDK — pass to telemetry / widget host */
99
+ /** The Proxy-wrapped SDK. Pass this to the telemetry system or widget host. */
89
100
  instrumentedSDK: ChatSDK;
90
- /** The o11y InstrumentedApp — exposed for advanced use (click tracking, log collectors, etc.) */
101
+ /** The o11y `InstrumentedApp`, exposed for advanced use, such as click tracking or log collectors. */
91
102
  app: InstrumentedApp;
92
- /** Log a custom business event */
103
+ /** Logs a custom business event. */
93
104
  trackEvent: (eventName: string, properties?: Record<string, unknown>) => void;
94
- /** Log a user interaction with a UI element */
105
+ /** Logs a user interaction with a UI element. */
95
106
  trackInteraction: (elementId: string, properties?: Record<string, unknown>) => void;
96
- /** Log an error explicitly */
107
+ /** Logs an error explicitly. */
97
108
  trackError: (error: Error | string, properties?: Record<string, unknown>) => void;
98
- /** Log a component load / page view */
109
+ /** Logs a component load or page view. */
99
110
  trackPageView: (componentRef: string) => void;
100
111
  /**
101
- * Set the Product Feature Taxonomy (PFT) Id for attribution of subsequent
102
- * analytics events. The value is late-bound — every emission reads the
103
- * current value, so callers can refresh it per render or per tool-call
104
- * (multi-customer widgets like mosaic-widget rely on this).
112
+ * Sets the Product Feature Taxonomy (PFT) Id for attribution of later
113
+ * analytics events.
114
+ *
115
+ * @remarks
116
+ * The value is late-bound. Every emission reads the current value, so
117
+ * callers can refresh it per render or per tool call. Multi-customer
118
+ * widgets, such as mosaic-widget, rely on this behavior.
105
119
  *
106
- * Validation matches the constructor option: only PF Ids (`aJC` prefix) are
107
- * accepted; PFE Ids and malformed values are **silently ignored**, and any
108
- * prior value remains in place. This protects long-lived widgets from
109
- * losing attribution due to a single transient bad input — e.g., a tool
110
- * that occasionally emits a malformed `_meta["sfdc.pftId"]` will not blank
111
- * the Id set by earlier well-formed responses.
120
+ * Validation matches the constructor option. The SDK accepts only PF
121
+ * Ids (the `aJC` prefix). It silently ignores PFE Ids and malformed
122
+ * values, and keeps any prior value in place. This protects long-lived
123
+ * widgets from losing attribution from a single bad input. For example,
124
+ * a tool that occasionally sends a malformed `_meta["sfdc.pftId"]` does
125
+ * not blank the Id that an earlier, well-formed response set.
112
126
  */
113
127
  setPftId: (id: string) => void;
114
- /** Cleanup — removes listeners, logs session duration, flushes events */
128
+ /** Removes listeners, logs the session duration, and flushes events. */
115
129
  dispose: () => void;
116
130
  }
117
131
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/analytics/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,UAAU,CAAC,IAAI,CAAC,EAAE,mBAAmB,GAAG,kBAAkB,GAAG,SAAS,CAAC;CACvE;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnE,KAAK,CAAC,K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C/B,kBAAkB,IAAI,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAChC,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wHAAwH;IACxH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,+EAA+E;IAC/E,eAAe,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,GAAG,EAAE,eAAe,CAAC;IACrB,oCAAoC;IACpC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC9E,iDAAiD;IACjD,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,gCAAgC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAClF,0CAA0C;IAC1C,aAAa,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,wEAAwE;IACxE,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB"}
@@ -1,5 +1,5 @@
1
1
  import { registerInstrumentedApp as S } from "o11y/client";
2
- import { g as E, S as T } from "./surface-Dd2tqrPi.js";
2
+ import { g as E, S as T } from "./surface-DWDgqdpN.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";
@@ -1,24 +1,29 @@
1
1
  import { CurrentApp, SDKOptions } from '../core';
2
2
  /**
3
- * Options for querying the current app.
3
+ * Options for getting the current app.
4
4
  */
5
5
  export interface CurrentAppOptions extends SDKOptions {
6
6
  }
7
7
  /**
8
- * Get the current (running) app based on the detected surface.
8
+ * Gets the current, running app for the detected surface.
9
9
  *
10
- * There is exactly one running app, so this queries the ambient one rather than
11
- * constructing a client. Its identity is backed by `SFDC_ENV`, which the runtime
12
- * injects on the {@link Surface.WebApp} surface and — via the same core-server
13
- * page-serving pipeline — on an internally-hosted {@link Surface.MicroFrontend}
14
- * too, since the MFE host's iframe is ultimately redirected to the UIBundle's own
15
- * served page. On every other surface — and when the surface is unusable, or
16
- * `SFDC_ENV` is present without an `appName` (the host hasn't wired injection for
17
- * this embed) — the returned {@link CurrentApp} has `identity` `undefined`,
18
- * mirroring how the Data/Chat SDKs degrade rather than failing the host.
10
+ * @remarks
11
+ * There is exactly one running app, so this function queries the ambient app
12
+ * instead of constructing a client. The runtime backs its identity with
13
+ * `SFDC_ENV`. The runtime injects `SFDC_ENV` on the {@link Surface.WebApp}
14
+ * surface. It also injects `SFDC_ENV` on an internally-hosted
15
+ * {@link Surface.MicroFrontend} surface, through the same core-server
16
+ * page-serving pipeline. This happens because the MFE host's iframe
17
+ * ultimately redirects to the UIBundle's own served page.
19
18
  *
20
- * @param options - Optional configuration including surface override
21
- * @returns Promise resolving to the current app
19
+ * On every other surface, the returned {@link CurrentApp} has `identity`
20
+ * set to `undefined`. The same applies when the surface is unusable, or
21
+ * when `SFDC_ENV` is present without an `appName` (the host has not wired
22
+ * injection for this embed). This mirrors how the Data and Chat SDKs degrade
23
+ * instead of failing the host.
24
+ *
25
+ * @param options - Configuration for the query, including a surface override.
26
+ * @returns The current app.
22
27
  */
23
28
  export declare function getCurrentApp(options?: CurrentAppOptions): Promise<CurrentApp>;
24
29
  export { WebAppCurrentApp } from './webapp';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD;;GAEG;AAEH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;CAAG;AAExD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB9E;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD;;GAEG;AAEH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;CAAG;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB9E;AAED,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
package/dist/app/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { g as c, S as n } from "../surface-Dd2tqrPi.js";
1
+ import { g as c, S as n } from "../surface-DWDgqdpN.js";
2
2
  import { w as s } from "../sdk-promise-D0sy7OW1.js";
3
3
  const p = "c";
4
4
  class u {
@@ -11,9 +11,11 @@ class u {
11
11
  this.identity = {
12
12
  namespace: a,
13
13
  appName: r,
14
- // Namespace first, "__" separator — the UIBundle record's qualified name.
14
+ // This value places the namespace first, with a "__" separator. It is
15
+ // the UIBundle record's qualified name.
15
16
  qualifiedName: `${a}__${r}`,
16
- // Authoritative record Id from the server injector; absent in local-dev.
17
+ // This Id is the authoritative record Id from the server injector. It
18
+ // is absent in local dev.
17
19
  bundleId: e?.bundleId
18
20
  };
19
21
  }
@@ -1,7 +1,10 @@
1
1
  import { AppIdentity, CurrentApp } from '../core';
2
2
  /**
3
- * Current-app implementation for web apps: reads the identity the runtime
4
- * injected into `globalThis.SFDC_ENV` and composes the qualified name.
3
+ * The current-app implementation for web apps.
4
+ *
5
+ * @remarks
6
+ * This class reads the identity that the runtime injects into
7
+ * `globalThis.SFDC_ENV`, then builds the qualified name from it.
5
8
  */
6
9
  export declare class WebAppCurrentApp implements CurrentApp {
7
10
  readonly identity?: AppIdentity;
@@ -1 +1 @@
1
- {"version":3,"file":"webapp.d.ts","sourceRoot":"","sources":["../../src/app/webapp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKvD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;;CAuBhC"}
1
+ {"version":3,"file":"webapp.d.ts","sourceRoot":"","sources":["../../src/app/webapp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKvD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;;CA2BhC"}
@@ -1,4 +1,4 @@
1
- import { S as e } from "./surface-Dd2tqrPi.js";
1
+ import { S as e } from "./surface-DWDgqdpN.js";
2
2
  const s = {
3
3
  callTool: !0,
4
4
  sendMessageToHost: !0,
@@ -1,4 +1,4 @@
1
- import { g as c, S as n, a as d } from "../surface-Dd2tqrPi.js";
1
+ import { g as c, S as n, a as d } from "../surface-DWDgqdpN.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 {
@@ -4,47 +4,56 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Identity of the running UIBundle (web app), derived from the values the
8
- * runtime injects into `globalThis.SFDC_ENV`.
7
+ * The identity of the running UIBundle (web app).
8
+ *
9
+ * @remarks
10
+ * The runtime derives this value from the fields it injects into
11
+ * `globalThis.SFDC_ENV`.
9
12
  *
10
13
  * The {@link qualifiedName} — `namespace__appName` — is the platform-addressable
11
- * name of the UIBundle record (namespace first, `__` separator, namespace kept
12
- * in its original mixed case). It is composed at runtime from the two stored
13
- * fields; it is **not** the auto-assigned 18-char record Id. Consumers such as
14
- * CMS search that key off the UIBundle identity use this value.
14
+ * name of the UIBundle record. The namespace comes first, followed by a `__`
15
+ * separator, and it keeps its original mixed case. The runtime composes this
16
+ * value from the two stored fields. It is **not** the auto-assigned
17
+ * 18-character record ID. Consumers, such as CMS search, use this value to
18
+ * key off the UIBundle identity.
15
19
  */
16
20
  export interface AppIdentity {
17
21
  /**
18
- * Namespace prefix in its original mixed case (e.g., "MyNs"). Falls back to
19
- * "c" when the org has no registered namespace.
22
+ * The namespace prefix in its original mixed case, for example `MyNs`.
23
+ * Falls back to `c` when the org has no registered namespace.
20
24
  */
21
25
  namespace: string;
22
- /** Developer (app) name of the UIBundle (e.g., "MyBundle"). */
26
+ /** The developer (app) name of the UIBundle, for example `MyBundle`. */
23
27
  appName: string;
24
28
  /**
25
- * Platform-addressable qualified name `namespace__appName`
26
- * (e.g., "MyNs__MyBundle", or "c__MyBundle" with no registered namespace).
29
+ * The platform-addressable qualified name `namespace__appName`, for
30
+ * example `MyNs__MyBundle`, or `c__MyBundle` when there is no registered
31
+ * namespace.
27
32
  */
28
33
  qualifiedName: string;
29
34
  /**
30
- * Authoritative UIBundle **record Id**, injected by the core server (owned
31
- * by App Fabric) into `SFDC_ENV`. Explicitly **not** {@link qualifiedName}
32
- * and **not** {@link appName}. `undefined` when the runtime does not inject
33
- * it — local development, and every non-WebApp surface.
35
+ * The authoritative UIBundle record ID. The core server, owned by App
36
+ * Fabric, injects this value into `SFDC_ENV`. It is explicitly **not**
37
+ * {@link qualifiedName} and **not** {@link appName}. The value is
38
+ * `undefined` when the runtime does not inject it, for example during
39
+ * local development and on every non-WebApp surface.
34
40
  */
35
41
  bundleId?: string;
36
42
  }
37
43
  /**
38
- * The current (running) app: the single, ambient app the code is executing
39
- * inside. There is exactly one, so it is queried — not constructed.
44
+ * The current (running) app: the single, ambient app the code runs inside.
45
+ *
46
+ * @remarks
47
+ * Exactly one current app exists, so callers query it instead of
48
+ * constructing it.
40
49
  *
41
- * Its {@link identity} is only meaningful on surfaces where the runtime injects
42
- * `SFDC_ENV` (the {@link Surface.WebApp} surface today). On every other surface
43
- * {@link identity} is absent, mirroring how the other SDKs degrade when a surface
44
- * cannot back their capability.
50
+ * The {@link identity} field is meaningful only on surfaces where the
51
+ * runtime injects `SFDC_ENV` — today, the {@link Surface.WebApp} surface.
52
+ * On every other surface, {@link identity} is absent. This mirrors how the
53
+ * other SDKs degrade when a surface cannot back their capability.
45
54
  */
46
55
  export interface CurrentApp {
47
- /** The running app's identity, or `undefined` on surfaces without `SFDC_ENV`. */
56
+ /** The running app's identity. `undefined` on surfaces without `SFDC_ENV`. */
48
57
  readonly identity?: AppIdentity;
49
58
  }
50
59
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;CAChC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;CAChC"}