@salesforce/platform-sdk 12.8.0 → 12.9.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
@@ -4,108 +4,137 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * A extension: a named namespace factory bound to a base SDK instance at attach
8
- * time. SDK-agnostic — `Sdk` is the base type this extension's `setup` requires.
9
- *
10
- * The contract does not depend on any concrete SDK. Enforcement of a specific
11
- * SDK happens at attach time via {@link ExtensionsFor}: a extension is attachable to
12
- * a base `B` only where `B` is assignable to `Sdk`. So authoring
13
- * `setup(sdk: DataSDK)` type-checks the extension against DataSDK when it is
14
- * attached through `createDataSDK`, even though `Extension` itself never imports
15
- * DataSDK.
16
- *
17
- * Reserved — `Deps` (inert in WI-1): the trailing type parameter is the seam
18
- * for WI-3 extension dependencies. It defaults to `[]` and is referenced only
19
- * through `setup`'s parameter, as `Sdk & Accumulate<Deps>`. With the default
20
- * empty tuple `Accumulate<[]>` is `unknown`, and `Sdk & unknown` reduces to
21
- * `Sdk`, so `setup` sees exactly the base SDK — a three-argument
22
- * `Extension<Sdk, Name, Api>` (see {@link AnyExtension}, {@link ExtensionsFor}) is
23
- * unchanged and no WI-1 extension's type shifts. There is no `deps` field yet, so
24
- * `attach` has no dependency to honor or silently drop.
25
- *
26
- * Threading it through `setup` (rather than leaving it dangling) is deliberate:
27
- * an unreferenced reserved type parameter is not free — it trips
28
- * `noUnusedLocals`. This makes the slot load-bearing while behaviorally a
29
- * no-op. WI-3's add-back is then a pure superset: add a `deps?: Deps` field and
30
- * populate the tuple, and the already-wired `setup` view lights up. The spike
31
- * notes the superset holds with or without this slot, so it is kept as an
32
- * explicit intent marker, not a forward-compat necessity.
7
+ * An extension: a named namespace factory bound to a base SDK instance at
8
+ * attach time.
9
+ *
10
+ * @remarks
11
+ * This type is SDK-agnostic: `Sdk` is the base type that this extension's
12
+ * `setup` requires.
13
+ *
14
+ * The contract does not depend on any concrete SDK. Enforcement of a
15
+ * specific SDK happens at attach time, through {@link ExtensionsFor}: an
16
+ * extension is attachable to a base `B` only when `B` is assignable to
17
+ * `Sdk`. So authoring `setup(sdk: DataSDK)` type-checks the extension
18
+ * against `DataSDK` when it attaches through `createDataSDK`, even though
19
+ * `Extension` itself never imports `DataSDK`.
20
+ *
21
+ * Reserved — `Deps`, inert in WI-1: the trailing type parameter is the
22
+ * seam for WI-3 extension dependencies. It defaults to `[]` and appears
23
+ * only through `setup`'s parameter, as `Sdk & Accumulate<Deps>`. With the
24
+ * default empty tuple, `Accumulate<[]>` is `unknown`, and `Sdk & unknown`
25
+ * reduces to `Sdk`. So `setup` sees exactly the base SDK. A three-argument
26
+ * `Extension<Sdk, Name, Api>` (see {@link AnyExtension} and
27
+ * {@link ExtensionsFor}) stays unchanged, and no WI-1 extension's type
28
+ * shifts. There is no `deps` field yet, so `attach` has no dependency to
29
+ * honor or silently drop.
30
+ *
31
+ * Threading `Deps` through `setup`, rather than leaving it dangling, is
32
+ * deliberate: an unreferenced reserved type parameter is not free,
33
+ * because it trips `noUnusedLocals`. This makes the slot load-bearing
34
+ * while behaviorally a no-op. WI-3's add-back is then a pure superset:
35
+ * add a `deps?: Deps` field, populate the tuple, and the already-wired
36
+ * `setup` view lights up. The spike notes that the superset holds with
37
+ * or without this slot, so the project keeps it as an explicit intent
38
+ * marker, not a forward-compatibility necessity.
33
39
  */
34
40
  export interface Extension<Sdk, Name extends string, Api, Deps extends readonly AnyExtension[] = []> {
35
- /** The single namespace key this extension mounts under (e.g. "labels"). */
41
+ /** The single namespace key this extension mounts under, for example `"labels"`. */
36
42
  name: Name;
37
43
  /**
38
- * Build the extension API. Runs at attach time with the fully-resolved,
39
- * instance-bound base SDK. May be synchronous or async — return the API
40
- * directly, or a promise of it (e.g. to `await` a dynamic import or a
41
- * capability handshake). The resolved `Api` is what mounts under `name`.
44
+ * Builds the extension API.
42
45
  *
43
- * `sdk` is `Sdk & Accumulate<Deps>`; with the reserved `Deps = []` this is
44
- * just `Sdk` today (see the `Deps` note above). WI-3 populates `Deps` so a
45
- * extension's declared dependencies' namespaces appear here.
46
+ * @remarks
47
+ * Runs at attach time with the fully-resolved, instance-bound base
48
+ * SDK. This function may be synchronous or asynchronous: return the
49
+ * API directly, or return a promise of it, for example to `await` a
50
+ * dynamic import or a capability handshake. The resolved `Api` is what
51
+ * mounts under `name`.
52
+ *
53
+ * `sdk` is `Sdk & Accumulate<Deps>`. With the reserved `Deps = []`,
54
+ * this is just `Sdk` today (see the `Deps` note above). WI-3 populates
55
+ * `Deps`, so an extension's declared dependencies' namespaces appear
56
+ * here.
46
57
  */
47
58
  setup: (sdk: Sdk & Accumulate<Deps>) => Api | PromiseLike<Api>;
48
59
  }
49
60
  /**
50
- * An extension entry after attachment has resolved its bare-or-aliased shape.
51
- * SDK-specific preflights and the attachment loop consume this same resolved
52
- * representation so entry discrimination and validation happen only once.
61
+ * An extension entry after attachment has resolved its shape, whether
62
+ * bare or aliased.
63
+ *
64
+ * @remarks
65
+ * SDK-specific preflights and the attachment loop consume this same
66
+ * resolved representation, so entry discrimination and validation happen
67
+ * only once.
53
68
  */
54
69
  export interface ResolvedExtensionEntry<Base> {
55
70
  readonly extension: Extension<Base, string, unknown>;
56
71
  readonly mountName: string;
57
72
  readonly label: string;
58
73
  }
59
- /** True iff `T` is a union of two or more members. */
74
+ /** True only when `T` is a union of two or more members. */
60
75
  type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
61
76
  /**
62
- * Reject a `name` that is not a single string literal. A concrete literal
63
- * (`"labels"`) passes through unchanged; anything else collapses to `never`, so
64
- * the authoring helpers error at definition time rather than silently losing key
65
- * accumulation. Surface-specific authoring definers such as
66
- * `defineDataExtension` apply this guard at definition time.
67
- *
68
- * Two shapes are rejected, both of which would otherwise mount phantom keys:
69
- * - a widened `string` (`string extends Name`) — no literal key to accumulate;
70
- * - a union literal (`"a" | "b"`, e.g. from `name: cond ? "a" : "b"`) — this
71
- * survives the `string extends Name` check, but {@link Accumulate}
72
- * distributes over the union and types *both* `a` and `b` as present,
73
- * non-optional members while `attach` mounts only one, leaving the other
74
- * typed-present yet `undefined` at runtime. Requiring a single literal is
75
- * what keeps the accumulated key set sound.
77
+ * Rejects a `name` that is not a single string literal.
78
+ *
79
+ * @remarks
80
+ * A concrete literal, for example `"labels"`, passes through unchanged.
81
+ * Anything else collapses to `never`, so the authoring helpers error at
82
+ * definition time instead of silently losing key accumulation.
83
+ * Surface-specific authoring definers, such as `defineDataExtension`,
84
+ * apply this guard at definition time.
85
+ *
86
+ * This type rejects two shapes, because both would otherwise mount
87
+ * phantom keys:
88
+ * - a widened `string` (`string extends Name`) — there is no literal key to accumulate
89
+ * - a union literal, for example `"a" | "b"` from `name: cond ? "a" : "b"` —
90
+ * this survives the `string extends Name` check, but {@link Accumulate}
91
+ * distributes over the union and types both `a` and `b` as present,
92
+ * non-optional members. `attach` mounts only one, so the other stays
93
+ * typed as present, yet is `undefined` at runtime.
94
+ *
95
+ * Requiring a single literal is what keeps the accumulated key set sound.
76
96
  */
77
97
  export type LiteralName<Name extends string> = string extends Name ? never : IsUnion<Name> extends true ? never : Name;
78
98
  /**
79
- * Any extension, for use in constraints. `never` in the (contravariant) `Sdk`
80
- * slot makes every concrete `Extension<...>` assignable to this — it is the top
81
- * type over the SDK parameter.
99
+ * Any extension, for use in constraints.
100
+ *
101
+ * @remarks
102
+ * `never` in the contravariant `Sdk` slot makes every concrete
103
+ * `Extension<...>` assignable to this type. It is the top type over the
104
+ * SDK parameter.
82
105
  */
83
106
  export type AnyExtension = Extension<never, string, unknown>;
84
107
  /**
85
- * Rebind a extension's mount point: attach `extension` under `as` instead of its own
86
- * `name`. This is the consumer's recourse for a collision they didn't cause —
87
- * two uneditable third-party extensions that both mount `sdk.ext.labels` can each be
88
- * aliased to a distinct key. Aliasing rebinds the mount *key* only, never the
89
- * extension's identity, which is what keeps identity-based dependency resolution
90
- * (a later WI) robust to it.
91
- *
92
- * `As` is intentionally the raw alias literal, NOT `LiteralName<As>`: pinning
93
- * `LiteralName` here would collapse the constraint form `AliasedExtension<_,
94
- * string>` (used in {@link ExtensionsFor}) to `as: never` and reject every alias.
95
- * The widened/union-`as` guard is instead applied at the call boundary by
96
- * {@link ValidMountNames}, exactly as {@link UniqueExtensionNames} guards mount
97
- * uniqueness there — the entry type stays permissive; the boundary validates.
98
- *
99
- * `name?: never; setup?: never` reject the mixed shape structurally, mirroring
100
- * the runtime discriminator. An object carrying a bare extension's defining
101
- * members *and* `{ extension, as }` satisfies both arms of {@link ExtensionEntry};
102
- * without these guards {@link MountName} (which tests the aliased arm first)
103
- * would key it under `as`, while `attach` — discriminating on `"setup" in
104
- * entry` — mounts the bare extension under `name`. The `never` fields fail the
105
- * aliased arm for such an object, so it matches only {@link Extension} and both
106
- * sides agree on `name`. Unlike the `LiteralName` case above, these are fixed
107
- * optional-never fields independent of `P`/`As`, so a real `{ extension, as }`
108
- * entry (which omits them) leaves the `ExtensionsFor` constraint form intact.
108
+ * Rebinds an extension's mount point: attaches `extension` under `as`
109
+ * instead of its own `name`.
110
+ *
111
+ * @remarks
112
+ * This is the consumer's recourse for a collision they did not cause. Two
113
+ * uneditable third-party extensions that both mount `sdk.ext.labels` can
114
+ * each alias to a distinct key. Aliasing rebinds only the mount key,
115
+ * never the extension's identity. This is what keeps identity-based
116
+ * dependency resolution, a later WI, robust to aliasing.
117
+ *
118
+ * `As` is intentionally the raw alias literal, not `LiteralName<As>`.
119
+ * Pinning `LiteralName` here would collapse the constraint form
120
+ * `AliasedExtension<_, string>`, used in {@link ExtensionsFor}, to
121
+ * `as: never` and reject every alias. Instead, {@link ValidMountNames}
122
+ * applies the widened-or-union `as` guard at the call boundary, exactly
123
+ * as {@link UniqueExtensionNames} guards mount uniqueness there. The
124
+ * entry type stays permissive; the boundary validates it.
125
+ *
126
+ * The fields `name?: never` and `setup?: never` reject the mixed shape
127
+ * structurally, mirroring the runtime discriminator. An object that
128
+ * carries a bare extension's defining members and `{ extension, as }`
129
+ * satisfies both arms of {@link ExtensionEntry}. Without these guards,
130
+ * {@link MountName}, which tests the aliased arm first, would key it
131
+ * under `as`, while `attach` — which discriminates on `"setup" in entry`
132
+ * — mounts the bare extension under `name`. The `never` fields
133
+ * fail the aliased arm for such an object, so it matches only
134
+ * {@link Extension}, and both sides agree on `name`. Unlike the
135
+ * `LiteralName` case above, these are fixed, optional-never fields
136
+ * independent of `P` and `As`. So a real `{ extension, as }` entry, which
137
+ * omits them, leaves the `ExtensionsFor` constraint form intact.
109
138
  */
110
139
  export interface AliasedExtension<P extends AnyExtension, As extends string> {
111
140
  extension: P;
@@ -113,52 +142,67 @@ export interface AliasedExtension<P extends AnyExtension, As extends string> {
113
142
  name?: never;
114
143
  setup?: never;
115
144
  }
116
- /** Any aliased entry, for use in unions/constraints (cf. {@link AnyExtension}). */
145
+ /** Any aliased entry, for use in unions and constraints (see {@link AnyExtension}). */
117
146
  type AnyAliasedExtension = AliasedExtension<AnyExtension, string>;
118
147
  /**
119
- * The `extensions: []` array constraint that enforces a concrete base SDK. A bare
120
- * `Extension<Sdk, Name, Api>` — or an {@link AliasedExtension} wrapping one — is a
121
- * member iff a `Base` value is assignable to the (inner) extension's `setup`
122
- * parameter, i.e. the extension asks for no more than `Base` provides (a extension
123
- * that ignores the SDK, `Sdk = unknown`, is universally attachable).
124
- * `createDataSDK` binds `Base = DataSDK`; that is where DataSDK-specific
125
- * enforcement occurs.
148
+ * The `extensions: []` array constraint that enforces a concrete base SDK.
149
+ *
150
+ * @remarks
151
+ * A bare `Extension<Sdk, Name, Api>`, or an {@link AliasedExtension}
152
+ * wrapping one, is a member only when a `Base` value is assignable to the
153
+ * inner extension's `setup` parameter. In other words, the extension asks
154
+ * for no more than `Base` provides. An extension that ignores the SDK,
155
+ * with `Sdk = unknown`, is universally attachable. `createDataSDK` binds
156
+ * `Base = DataSDK`. That is where `DataSDK`-specific enforcement occurs.
126
157
  */
127
158
  export type ExtensionsFor<Base> = readonly (Extension<Base, string, unknown> | AliasedExtension<Extension<Base, string, unknown>, string>)[];
128
159
  /**
129
- * What may appear in the `extensions: []` array: a bare extension, or a bare extension
130
- * wrapped with an `{ as }` alias. Everything downstream ({@link Accumulate},
131
- * {@link DuplicateMountName}, {@link ExtendedSDK}) is written against
132
- * `ExtensionEntry` and routes through {@link ExtensionOf}/{@link MountName}, so the
133
- * bare-vs-aliased distinction is resolved in exactly those two helpers and
134
- * nowhere else.
160
+ * What may appear in the `extensions: []` array: a bare extension, or a
161
+ * bare extension wrapped with an `{ as }` alias.
162
+ *
163
+ * @remarks
164
+ * Everything downstream — {@link Accumulate}, {@link DuplicateMountName},
165
+ * and {@link ExtendedSDK} — is written against `ExtensionEntry` and
166
+ * routes through {@link ExtensionOf} and {@link MountName}. So the
167
+ * bare-versus-aliased distinction resolves in exactly those two helpers,
168
+ * and nowhere else.
135
169
  */
136
170
  export type ExtensionEntry = AnyExtension | AnyAliasedExtension;
137
171
  /** The underlying extension of an entry, whether it was passed bare or aliased. */
138
172
  type ExtensionOf<E extends ExtensionEntry> = E extends AnyAliasedExtension ? E["extension"] : E;
139
173
  /**
140
- * The literal key an entry mounts under: its alias `as` when aliased, else the
141
- * extension's own `name`. This is the single place the effective mount key is
142
- * computed — all mount-name-keyed logic ({@link Accumulate},
143
- * {@link DuplicateMountName}) routes through it, so aliasing is transparent to
144
- * them: `[a, a]` (both mount `"labels"`) collides, but `[{ extension: a, as: "x"
145
- * }, { extension: a, as: "y" }]` resolves to distinct keys and does not.
174
+ * The literal key an entry mounts under: its alias `as` when aliased,
175
+ * otherwise the extension's own `name`.
176
+ *
177
+ * @remarks
178
+ * This is the single place where the effective mount key is computed. All
179
+ * mount-name-keyed logic, such as {@link Accumulate} and
180
+ * {@link DuplicateMountName}, routes through it, so aliasing stays
181
+ * transparent to them. For example, `[a, a]`, which both mount `"labels"`,
182
+ * collides. But `[{ extension: a, as: "x" }, { extension: a, as: "y" }]`
183
+ * resolves to distinct keys and does not collide.
146
184
  */
147
185
  type MountName<E extends ExtensionEntry> = E extends AnyAliasedExtension ? E["as"] : ExtensionOf<E>["name"];
148
186
  /**
149
- * The resolved API an entry's extension `setup` returns. `Awaited` unwraps the
150
- * async case so the mounted namespace is the settled value, never a promise.
187
+ * The resolved API that an entry's extension `setup` returns.
188
+ *
189
+ * @remarks
190
+ * `Awaited` unwraps the asynchronous case, so the mounted namespace is
191
+ * the settled value, never a promise.
151
192
  */
152
193
  type ApiOf<E extends ExtensionEntry> = Awaited<ReturnType<ExtensionOf<E>["setup"]>>;
153
194
  /**
154
- * Walk the extension tuple left→right, intersecting `{ [name]: namespace }` per
155
- * entry. Namespaces are non-optional: presence is a static attach fact.
156
- *
157
- * This intersects unconditionally: a duplicate mount name would collapse to
158
- * `{ labels: A } & { labels: B }` here rather than erroring. Uniqueness is not
159
- * this type's job — it is enforced up front by {@link UniqueExtensionNames} at the
160
- * authoring boundary, with `attach`'s runtime guard as the backstop for tuples
161
- * built dynamically past the static check.
195
+ * Walks the extension tuple left to right, intersecting
196
+ * `{ [name]: namespace }` for each entry.
197
+ *
198
+ * @remarks
199
+ * Namespaces are non-optional, because presence is a static attach fact.
200
+ *
201
+ * This type intersects unconditionally: a duplicate mount name collapses
202
+ * to `{ labels: A } & { labels: B }` here, rather than raising an error.
203
+ * Enforcing uniqueness is not this type's job. {@link UniqueExtensionNames}
204
+ * enforces it up front, at the authoring boundary, and `attach`'s runtime
205
+ * guard backstops tuples that are built dynamically past the static check.
162
206
  */
163
207
  type Accumulate<Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [
164
208
  infer Head extends ExtensionEntry,
@@ -167,27 +211,36 @@ type Accumulate<Extensions extends readonly ExtensionEntry[]> = Extensions exten
167
211
  [K in MountName<Head>]: ApiOf<Head>;
168
212
  } & Accumulate<Tail> : unknown;
169
213
  /**
170
- * The first mount name that repeats in the tuple, or `never` if all are
171
- * distinct. Walks left→right accumulating seen names in `Seen`; the first
172
- * {@link MountName} already in `Seen` is the duplicate. Keyed on
173
- * {@link MountName}, so aliasing a clash apart is a valid recourse (see there).
214
+ * The first mount name that repeats in the tuple, or `never` when all
215
+ * are distinct.
216
+ *
217
+ * @remarks
218
+ * This type walks the tuple left to right, accumulating seen names in
219
+ * `Seen`. The first {@link MountName} already in `Seen` is the
220
+ * duplicate. It keys on {@link MountName}, so aliasing a clash apart is
221
+ * a valid way to resolve it (see {@link AliasedExtension}).
174
222
  */
175
223
  type DuplicateMountName<Extensions extends readonly ExtensionEntry[], Seen = never> = Extensions extends readonly [
176
224
  infer Head extends ExtensionEntry,
177
225
  ...infer Tail extends readonly ExtensionEntry[]
178
226
  ] ? [MountName<Head>] extends [Seen] ? MountName<Head> : DuplicateMountName<Tail, Seen | MountName<Head>> : never;
179
227
  /**
180
- * A constraint intersected into the `extensions` option to reject a tuple whose
181
- * mount names are not unique. Resolves to `unknown` (a no-op intersection) when
182
- * every mount name is distinct; otherwise to an object whose `extensions` field is
183
- * a human-readable error string, which makes the supplied array inassignable
184
- * and surfaces the message in the diagnostic.
185
- *
186
- * This moves the collision from a runtime throw (`attach` fail-loud) to a
187
- * compile error at the call site. The two are complementary, not redundant:
188
- * this catches statically-known tuples early with a clear message, while
189
- * `attach` still guards tuples assembled dynamically (e.g. `[...a, ...b]`)
190
- * whose duplicates a static check cannot see.
228
+ * A constraint intersected into the `extensions` option to reject a
229
+ * tuple whose mount names are not unique.
230
+ *
231
+ * @remarks
232
+ * This type resolves to `unknown`, a no-op intersection, when every
233
+ * mount name is distinct. Otherwise it resolves to an object whose
234
+ * `extensions` field is a human-readable error string, which makes the
235
+ * supplied array inassignable and surfaces the message in the
236
+ * diagnostic.
237
+ *
238
+ * This moves the collision from a runtime throw, an `attach` fail-loud
239
+ * check, to a compile error at the call site. The two checks are
240
+ * complementary, not redundant. This one catches statically-known
241
+ * tuples early with a clear message, while `attach` still guards tuples
242
+ * assembled dynamically, for example `[...a, ...b]`, whose duplicates a
243
+ * static check cannot see.
191
244
  */
192
245
  export type UniqueExtensionNames<Extensions extends readonly ExtensionEntry[]> = [
193
246
  DuplicateMountName<Extensions>
@@ -195,14 +248,17 @@ export type UniqueExtensionNames<Extensions extends readonly ExtensionEntry[]> =
195
248
  extensions: `Two extensions mount under "${DuplicateMountName<Extensions> & string}"; mount names must be unique.`;
196
249
  };
197
250
  /**
198
- * A constraint intersected into the `extensions` option to require every
199
- * effective mount name — a bare extension's `name`, or an alias's `as` — to be
200
- * one concrete string literal. A widened or union mount name would make
201
- * {@link Accumulate} promise keys the runtime may not mount. Applying the guard
202
- * at the attachment interface backstops every authoring form, including objects
203
- * that bypass a surface-specific definer. Resolves to `unknown` or an
204
- * inassignable `{ extensions }` error exactly as {@link UniqueExtensionNames}
205
- * does.
251
+ * A constraint intersected into the `extensions` option to require
252
+ * every effective mount name to be one concrete string literal.
253
+ *
254
+ * @remarks
255
+ * An effective mount name is a bare extension's `name`, or an alias's
256
+ * `as`. A widened or union mount name would make {@link Accumulate}
257
+ * promise keys that the runtime may not mount. Applying the guard at
258
+ * the attachment interface backstops every authoring form, including
259
+ * objects that bypass a surface-specific definer. This type resolves to
260
+ * `unknown`, or to an inassignable `{ extensions }` error, exactly as
261
+ * {@link UniqueExtensionNames} does.
206
262
  */
207
263
  export type ValidMountNames<Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [
208
264
  infer Head extends ExtensionEntry,
@@ -212,31 +268,36 @@ export type ValidMountNames<Extensions extends readonly ExtensionEntry[]> = Exte
212
268
  } : {
213
269
  extensions: `An extension "name" must be a single string literal, not a widened or union type.`;
214
270
  } : ValidMountNames<Tail> : unknown;
215
- /** Collapse an intersection into a single flat object type for readable hovers. */
271
+ /** Collapses an intersection into a single flat object type for readable hovers. */
216
272
  type Flatten<T> = {
217
273
  [K in keyof T]: T[K];
218
274
  } & {};
219
275
  /**
220
- * The base SDK plus an `ext` namespace carrying every attached extension's API.
221
- *
222
- * Extensions are compartmentalized under `ext` (e.g. `sdk.ext.labels`) rather than
223
- * spliced onto the SDK root, mirroring where {@link attachExtensions} mounts them.
224
- * This is what lets the SDK add members over time without a name-reservation
225
- * registry: a extension *key* can never collide with a current or future root
226
- * member because it lives one level down. The single exception is `ext` itself —
227
- * that one root key is now SDK-owned as the extension container, exactly as
228
- * `graphql`/`fetch` are SDK-owned. A base SDK surface must therefore not declare
229
- * its own `ext` member. Extension-vs-extension uniqueness within `ext` is still
230
- * enforced — statically by {@link UniqueExtensionNames}, at runtime by `attach`.
231
- *
232
- * Only a tuple *known* to be non-empty introduces `ext`, whose value is the
233
- * left→right {@link Accumulate}d namespace map. Both other cases resolve to
234
- * exactly `Base` (no `ext` key): the empty tuple `[]`, and — deliberately — a
235
- * widened, non-tuple extension array (e.g. `DataSDKExtension[]`) whose length TypeScript
236
- * cannot see. The runtime returns the base untouched whenever the array is empty,
237
- * so keying presence off "provably non-empty" (rather than "provably empty")
238
- * keeps the type from promising an `ext` the runtime may not create for a widened
239
- * array that happens to be empty.
276
+ * The base SDK plus an `ext` namespace carrying every attached
277
+ * extension's API.
278
+ *
279
+ * @remarks
280
+ * Extensions are compartmentalized under `ext`, for example
281
+ * `sdk.ext.labels`, rather than spliced onto the SDK root. This mirrors
282
+ * where {@link attachExtensions} mounts them. It also lets the SDK add
283
+ * members over time without a name-reservation registry: an extension
284
+ * *key* can never collide with a current or future root member,
285
+ * because it lives one level down. The single exception is `ext`
286
+ * itself. That one root key is now SDK-owned as the extension
287
+ * container, the same way `graphql` and `fetch` are SDK-owned. A base
288
+ * SDK surface must therefore not declare its own `ext` member.
289
+ * Extension-versus-extension uniqueness within `ext` is still enforced,
290
+ * statically by {@link UniqueExtensionNames} and at runtime by `attach`.
291
+ *
292
+ * Only a tuple known to be non-empty introduces `ext`, whose value is
293
+ * the left-to-right {@link Accumulate}d namespace map. Both other cases
294
+ * resolve to exactly `Base`, with no `ext` key: the empty tuple `[]`,
295
+ * and, deliberately, a widened, non-tuple extension array, for example
296
+ * `DataSDKExtension[]`, whose length TypeScript cannot see. The runtime
297
+ * returns the base untouched whenever the array is empty. So keying
298
+ * presence off "provably non-empty," rather than "provably empty,"
299
+ * keeps the type from promising an `ext` that the runtime may not
300
+ * create for a widened array that happens to be empty.
240
301
  */
241
302
  export type ExtendedSDK<Base, Extensions extends readonly ExtensionEntry[]> = Extensions extends readonly [ExtensionEntry, ...ExtensionEntry[]] ? Flatten<Base & {
242
303
  ext: Flatten<Accumulate<Extensions>>;
@@ -1 +1 @@
1
- {"version":3,"file":"extension-types.d.ts","sourceRoot":"","sources":["../../src/core/extension-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,SAAS,CACzB,GAAG,EACH,IAAI,SAAS,MAAM,EACnB,GAAG,EACH,IAAI,SAAS,SAAS,YAAY,EAAE,GAAG,EAAE;IAEzC,4EAA4E;IAC5E,IAAI,EAAE,IAAI,CAAC;IACX;;;;;;;;;OASG;IACH,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;CAC/D;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,IAAI;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,sDAAsD;AACtD,KAAK,OAAO,CAAC,CAAC,EAAE,CAA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AAE,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,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,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"}
@@ -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-Dd2tqrPi.js";
2
- import { g as c } from "../capabilities-CKe8z6kZ.js";
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-DWDgqdpN.js";
2
+ import { g as c } from "../capabilities-B0mU0_G0.js";
3
3
  import { w as g } from "../sdk-promise-D0sy7OW1.js";
4
4
  export {
5
5
  r as McpAppsNotAvailableError,
@@ -3,39 +3,31 @@
3
3
  * All rights reserved.
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
- /**
7
- * Lightning Message Service message payload
8
- */
6
+ /** The message payload for the Lightning Message Service. */
9
7
  export type LMSMessage = Record<string, unknown>;
10
- /**
11
- * Lightning Message Service subscription
12
- */
8
+ /** A Lightning Message Service subscription. */
13
9
  export interface LMSSubscription {
14
10
  unsubscribe: () => void;
15
11
  }
16
- /**
17
- * Lightning Message Service channel configuration
18
- */
12
+ /** The configuration for a Lightning Message Service channel. */
19
13
  export interface MessageChannel {
20
14
  channelName: string;
21
15
  }
22
- /**
23
- * Lightning SDK interface for Lightning Web Component runtime integration
24
- */
16
+ /** The Lightning SDK for Lightning Web Component runtime integration. */
25
17
  export interface LightningSDK {
26
18
  /**
27
- * Publish a message to a Lightning Message Service channel
19
+ * Publishes a message to a Lightning Message Service channel.
28
20
  *
29
- * @param channel - Message channel configuration
30
- * @param message - Message payload to publish
21
+ * @param channel - The channel configuration.
22
+ * @param message - The message payload to publish.
31
23
  */
32
24
  publishLmsMessage?: <M extends LMSMessage>(channel: MessageChannel, message: M) => void;
33
25
  /**
34
- * Subscribe to a Lightning Message Service channel
26
+ * Subscribes to a Lightning Message Service channel.
35
27
  *
36
- * @param channel - Message channel configuration
37
- * @param callback - Callback function to handle received messages
38
- * @returns Subscription object with unsubscribe method
28
+ * @param channel - The channel configuration.
29
+ * @param callback - The function that handles a received message.
30
+ * @returns The subscription, with an `unsubscribe` method.
39
31
  */
40
32
  subscribeToLmsChannel?: <M extends LMSMessage>(channel: MessageChannel, callback: (message: M) => void) => LMSSubscription;
41
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lightning.d.ts","sourceRoot":"","sources":["../../src/core/lightning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,WAAW,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAExF;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,CAAC,CAAC,SAAS,UAAU,EAC5C,OAAO,EAAE,cAAc,EACv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