@salesforce/platform-sdk 11.8.4 → 11.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAI3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAa5B,iBAAiB;CAgB/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAc3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;YAa5B,iBAAiB;CAc/B"}
@@ -6,6 +6,11 @@ import { DataSDK, DataSDKGraphQL } from '../../core';
6
6
  export declare class OpenAIDataSDK implements DataSDK {
7
7
  readonly graphql: DataSDKGraphQL;
8
8
  constructor();
9
+ /**
10
+ * The `headers` request option is intentionally not forwarded: this surface
11
+ * delegates to the `graphqlQuery` MCP tool over the ChatGPT bridge, which
12
+ * issues the HTTP request host-side and exposes no header channel.
13
+ */
9
14
  private executeRawGraphQL;
10
15
  }
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAK3F;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;;YAMnB,iBAAiB;CAa/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAK3F;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;;IAMjC;;;;OAIG;YACW,iBAAiB;CAa/B"}
@@ -5,12 +5,21 @@ import { CacheControlStrategyConfig, NamedCacheControllerService } from '@condui
5
5
  import { FetchService, NamedFetchService } from '@conduit-client/service-fetch-network/v1';
6
6
  import { NamedPubSubService } from '@conduit-client/service-pubsub/v1';
7
7
  import { Result, SyncOrAsync } from '@conduit-client/utils';
8
- import { CacheControl } from '../../../../core/data';
8
+ import { CacheControl, GraphQLRequestHeaders } from '../../../../core/data';
9
9
  export interface GraphQLResourceRequestParams {
10
10
  query: string;
11
11
  variables?: Record<string, unknown>;
12
12
  operationName?: string;
13
13
  cacheControl?: CacheControl;
14
+ /**
15
+ * Extra HTTP headers merged over the canonical GraphQL header set on the
16
+ * outgoing request. Included in {@link
17
+ * HttpGraphQLResourceCacheControlCommand.buildKey} (normalized) because they
18
+ * can scope the response — e.g. two identical queries carrying different
19
+ * `Authorization` must not share a cache entry, or a later caller could read
20
+ * an earlier caller's data without the server re-authorizing.
21
+ */
22
+ headers?: GraphQLRequestHeaders;
14
23
  }
15
24
  type Services = NamedCacheControllerService & Partial<NamedPubSubService> & NamedFetchService;
16
25
  /**
@@ -64,6 +73,8 @@ export declare class HttpGraphQLResourceCacheControlCommand<TData extends Record
64
73
  private readonly normalizedOperationName;
65
74
  private readonly cacheControl;
66
75
  private readonly resolvedMaxAge;
76
+ private readonly headers;
77
+ private readonly headersKey;
67
78
  constructor(config: GraphQLResourceRequestParams, services: Services, url: string);
68
79
  protected get fetchParams(): Parameters<FetchService>;
69
80
  buildKey(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/data/shared/graphql/cache/command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EACX,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAON,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAuB1D,MAAM,WAAW,4BAA4B;IAC5C,KAAK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C;CAMxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/cached-graphql.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,eAAe,CAAC;AAE7F,UAAU,yBAAyB;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,kBAAkB,CAAC;CAC/B;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAClC,MAAM,EACN,GAAG,EACH,UAAU,GACV,EAAE,yBAAyB,GAAG,cAAc,CA4C5C"}
1
+ {"version":3,"file":"cached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/cached-graphql.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,eAAe,CAAC;AAE7F,UAAU,yBAAyB;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,kBAAkB,CAAC;CAC/B;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAClC,MAAM,EACN,GAAG,EACH,UAAU,GACV,EAAE,yBAAyB,GAAG,cAAc,CA8C5C"}
@@ -12,5 +12,5 @@ export declare function parseToDocument(op: GraphQLRawDocument): Result<Document
12
12
  export declare function getOperationKind(document: DocumentNode, operationName?: string): "query" | "mutation" | "subscription" | "unknown";
13
13
  export declare function toErrors(reason: unknown): GraphQLError[];
14
14
  export type RawGraphQLExecutor = <T, V = Record<string, unknown>>(request: GraphQLRequest<V>) => Promise<GraphQLResponse<T>>;
15
- export declare function executeMutate<T, V = Record<string, unknown>>(executeRaw: RawGraphQLExecutor, { mutation: op, variables, operationName: explicitName }: MutateOptions<V>): Promise<MutationResult<T>>;
15
+ export declare function executeMutate<T, V = Record<string, unknown>>(executeRaw: RawGraphQLExecutor, { mutation: op, variables, operationName: explicitName, headers }: MutateOptions<V>): Promise<MutationResult<T>>;
16
16
  //# sourceMappingURL=graphql-parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-parse.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/graphql-parse.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGN,KAAK,YAAY,EAEjB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,UAAU,EAAE,WAExB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAEjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,CAM5F;AAED,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,YAAY,EACtB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAanD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,EAAE,CAexD;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,KACtB,OAAO,CAAC,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CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,UAAU,EAAE,kBAAkB,EAC9B,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,GACjF,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CA8B5B"}
@@ -4,10 +4,44 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
  /**
7
- * Builds the canonical request header set for Salesforce GraphQL calls.
8
- * Used by both the WebApp DataSDK transport path and the cache control
9
- * command, so the wire format stays identical regardless of which path
10
- * a consumer's request takes.
7
+ * Merge caller-supplied `overrides` over a `base` header set caller wins on
8
+ * collision and return a plain header record suitable for `RequestInit`.
9
+ *
10
+ * `overrides` accepts any `HeadersInit` form: a plain record, an array of
11
+ * `[name, value]` tuples, or a `Headers` instance. Multi-valued headers are
12
+ * expressible via repeated tuple names (folded here into one comma-separated
13
+ * value) or a pre-built `Headers`.
14
+ *
15
+ * With no overrides the `base` record is returned by value, unchanged. Header
16
+ * names are matched case-insensitively (they are case-insensitive per RFC 7230
17
+ * §3.2), so a caller-supplied `content-type` overrides the canonical
18
+ * `Content-Type` in place rather than emitting a duplicate. The winning name's
19
+ * original casing is preserved — the base key on collision, otherwise the
20
+ * caller's.
11
21
  */
12
- export declare function buildGraphQLRequestHeaders(): Record<string, string>;
22
+ export declare function mergeRequestHeaders(base: Record<string, string>, overrides?: HeadersInit): Record<string, string>;
23
+ /**
24
+ * Builds the canonical Salesforce GraphQL request headers for the core/webapp
25
+ * surface, with optional per-request `overrides` merged on top. Used by both
26
+ * the WebApp DataSDK transport path and the cache control command so the wire
27
+ * format stays identical regardless of which path a consumer's request takes.
28
+ */
29
+ export declare function buildGraphQLRequestHeaders(overrides?: HeadersInit): Record<string, string>;
30
+ /**
31
+ * Reduce a per-request `HeadersInit` into a stable, canonical record for use as
32
+ * part of a cache key. Any `HeadersInit` form collapses to the same result:
33
+ * names are lowercased and repeated names folded (via `Headers`), so callers
34
+ * passing equivalent headers in different shapes, casing, or order key
35
+ * identically. Returns `undefined` when there are no headers, so the no-header
36
+ * path keeps a cache key byte-identical to one built with no headers at all.
37
+ *
38
+ * Headers participate in cache identity because they can scope the response —
39
+ * most importantly `Authorization`. Two otherwise-identical queries carrying
40
+ * different auth must resolve to different cache entries; sharing one would let
41
+ * a later caller read an earlier caller's response without the server ever
42
+ * re-authorizing (a silent cross-auth data leak). See {@link
43
+ * mergeRequestHeaders} for the outgoing-request merge, which is separate from
44
+ * this keying concern.
45
+ */
46
+ export declare function normalizeHeadersForKey(headers?: HeadersInit): Record<string, string> | undefined;
13
47
  //# sourceMappingURL=headers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/headers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMnE"}
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/headers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,SAAS,CAAC,EAAE,WAAW,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+BxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAOhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAKd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CAyEnF"}
1
+ {"version":3,"file":"uncached-graphql.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/uncached-graphql.ts"],"names":[],"mappings":"AAMA,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,cAAc,CA4EnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAcrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IA2BpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAc/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAcrD;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyD;IAClF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAErB,OAAO,CAAC,EAAE,oBAAoB;IA2BpC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF;;;;;OAKG;YACW,iBAAiB;IAe/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAa3B"}
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { MCPAppsChatSDK as g, createChatSDK as l, getChatSDK as A, getChatSDKSyn
5
5
  import { MCPAppsViewSDK as C, createViewSDK as E, getViewSDK as d, getViewSDKSync as w, resetViewSDK as M } from "./view/index.js";
6
6
  import { createDataSDK as _, gql as h } from "./data/index.js";
7
7
  import { createLightningSDK as I } from "./lightning/index.js";
8
- import { c as b } from "./transport-CdXFRgRc.js";
8
+ import { c as b } from "./transport-D9QstWle.js";
9
9
  import { T as N, r as v } from "./TelemetryUploader-DKkdppe9.js";
10
10
  import { A as F, I as U, P as Y, c as q, v as z } from "./analytics-CIbrgyL8.js";
11
11
  export {
@@ -1,4 +1,4 @@
1
- import { c as t } from "../transport-CdXFRgRc.js";
1
+ import { c as t } from "../transport-D9QstWle.js";
2
2
  import { T as o, r as l } from "../TelemetryUploader-DKkdppe9.js";
3
3
  export {
4
4
  o as TelemetryUploader,
@@ -2,6 +2,7 @@ import { ChatSDK } from '../core';
2
2
  import { TelemetryBuffer } from './buffer';
3
3
  interface ToolAdapterErrorContext {
4
4
  reason: string;
5
+ droppedCount?: number;
5
6
  error?: unknown;
6
7
  }
7
8
  export interface TelemetryToolAdapterOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"tool-adapter.d.ts","sourceRoot":"","sources":["../../src/telemetry/tool-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,UAAU,uBAAuB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACrD;AAED,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA6C;IACtE,OAAO,CAAC,OAAO,CAA+C;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;gBAEU,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,2BAA2B;IAUvF,KAAK,IAAI,IAAI;IAab,OAAO,IAAI,IAAI;CAcf"}
1
+ {"version":3,"file":"tool-adapter.d.ts","sourceRoot":"","sources":["../../src/telemetry/tool-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiBhD,UAAU,uBAAuB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACrD;AAED,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA6C;IACtE,OAAO,CAAC,OAAO,CAA+C;IAC9D,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;gBAEU,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,2BAA2B;IAUvF,KAAK,IAAI,IAAI;IAab,OAAO,IAAI,IAAI;CAcf"}
@@ -1,10 +1,10 @@
1
- function l(s) {
1
+ function d(r) {
2
2
  let e = "";
3
- for (let t = 0; t < s.length; t += 8192)
4
- e += String.fromCharCode.apply(null, Array.from(s.subarray(t, t + 8192)));
3
+ for (let t = 0; t < r.length; t += 8192)
4
+ e += String.fromCharCode.apply(null, Array.from(r.subarray(t, t + 8192)));
5
5
  return btoa(e);
6
6
  }
7
- class d {
7
+ class u {
8
8
  entries = [];
9
9
  totalBytes = 0;
10
10
  maxBufferSize;
@@ -19,14 +19,14 @@ class d {
19
19
  return this.entries.length === 0;
20
20
  }
21
21
  enqueue(e, i) {
22
- const t = l(e), r = {
22
+ const t = d(e), s = {
23
23
  data: t,
24
24
  traceId: i?.traceId,
25
25
  instanceId: i?.instanceId,
26
26
  componentRef: i?.componentRef,
27
27
  timestamp: Date.now()
28
28
  }, n = t.length;
29
- this.entries.push(r), this.totalBytes += n, this.totalBytes > this.maxBufferSize && this.evict();
29
+ this.entries.push(s), this.totalBytes += n, this.totalBytes > this.maxBufferSize && this.evict();
30
30
  }
31
31
  drain() {
32
32
  const e = this.entries;
@@ -41,8 +41,8 @@ class d {
41
41
  e > 0 && this.onError?.({ reason: "buffer_overflow", droppedCount: e });
42
42
  }
43
43
  }
44
- const u = "telemetry_upload";
45
- class f {
44
+ const f = "telemetry_upload", o = 1048576;
45
+ class c {
46
46
  buffer;
47
47
  sdk;
48
48
  onError;
@@ -60,8 +60,8 @@ class f {
60
60
  flush() {
61
61
  if (this.buffer.isEmpty || !this.sdk.callTool)
62
62
  return;
63
- const i = this.buffer.drain().map(c);
64
- this.sdk.callTool({ toolName: u, params: { inputs: [{ envelopes: i }] } }).catch((t) => {
63
+ const e = this.buffer.drain(), i = p(e.map(m), this.onError);
64
+ this.sdk.callTool({ toolName: f, params: { inputs: [{ envelopes: i }] } }).catch((t) => {
65
65
  this.onError?.({ reason: "tool_call_failed", error: t });
66
66
  });
67
67
  }
@@ -69,27 +69,40 @@ class f {
69
69
  this.disposed || (this.disposed = !0, this.timerId !== null && (clearInterval(this.timerId), this.timerId = null), document.removeEventListener("visibilitychange", this.handleVisibilityChange), window.removeEventListener("pagehide", this.handlePageHide), this.flush());
70
70
  }
71
71
  }
72
- function c(s) {
73
- const e = { base64Env: s.data };
74
- return s.traceId !== void 0 && (e.traceId = s.traceId), e;
72
+ function m(r) {
73
+ const e = { base64Env: r.data };
74
+ return r.traceId !== void 0 && (e.traceId = r.traceId), e;
75
75
  }
76
- const m = 65536, p = 3e4;
77
- function y(s) {
76
+ function p(r, e) {
77
+ let i = 0;
78
+ for (const s of r)
79
+ i += s.base64Env.length;
80
+ if (i <= o)
81
+ return r;
82
+ let t = 0;
83
+ for (; i > o && r.length > 1; ) {
84
+ const s = r.shift();
85
+ i -= s.base64Env.length, t++;
86
+ }
87
+ return t > 0 && e?.({ reason: "payload_too_large", droppedCount: t }), r;
88
+ }
89
+ const E = 65536, y = 3e4;
90
+ function g(r) {
78
91
  const {
79
92
  sdk: e,
80
- maxBufferSize: i = m,
81
- flushInterval: t = p,
82
- onError: r
83
- } = s, n = new d({ maxBufferSize: i, onError: r }), o = new f(n, e, { flushInterval: t, onError: r });
93
+ maxBufferSize: i = E,
94
+ flushInterval: t = y,
95
+ onError: s
96
+ } = r, n = new u({ maxBufferSize: i, onError: s }), a = new c(n, e, { flushInterval: t, onError: s });
84
97
  return {
85
- enqueue(a, h) {
86
- n.enqueue(a, h);
98
+ enqueue(l, h) {
99
+ n.enqueue(l, h);
87
100
  },
88
101
  dispose() {
89
- o.dispose();
102
+ a.dispose();
90
103
  }
91
104
  };
92
105
  }
93
106
  export {
94
- y as c
107
+ g as c
95
108
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.8.4",
3
+ "version": "11.10.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -115,7 +115,7 @@
115
115
  "@conduit-client/service-pubsub": "3.19.6",
116
116
  "@conduit-client/service-retry": "3.19.6",
117
117
  "@conduit-client/utils": "3.19.6",
118
- "@salesforce/jsonrpc": "^11.8.4",
118
+ "@salesforce/jsonrpc": "^11.10.0",
119
119
  "@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
120
120
  },
121
121
  "peerDependencies": {