@salesforce/agentforce-conversation-client 11.67.1 → 11.68.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.
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import type { RenderingModeValue } from "./constants.js";
7
+ export type StyleTokens = Record<string, string>;
8
+ export interface TypewriterConfig {
9
+ charsPerFrame?: number;
10
+ charsPerFrameMarkdown?: number;
11
+ queueThresholdMedium?: number;
12
+ queueThresholdHigh?: number;
13
+ queueThresholdCritical?: number;
14
+ frameDelayMs?: number;
15
+ idleCursorTimeoutMs?: number;
16
+ rushToEndMs?: number;
17
+ }
18
+ export interface AgentforceClientConfig {
19
+ styleTokens?: StyleTokens;
20
+ agentId?: string;
21
+ agentLabel?: string;
22
+ renderingConfig?: {
23
+ mode?: RenderingModeValue;
24
+ width?: string | number;
25
+ height?: string | number;
26
+ headerEnabled?: boolean;
27
+ showHeaderIcon?: boolean;
28
+ showAvatar?: boolean;
29
+ agentAvatarUrl?: string;
30
+ agentAvatarAltText?: string;
31
+ headerIconName?: string;
32
+ headerIconSize?: string;
33
+ headerImageUrl?: string;
34
+ headerImageAlt?: string;
35
+ };
36
+ channel?: string;
37
+ messageInputPlaceholderText?: string;
38
+ isHistoryIntroNeeded?: boolean;
39
+ isFileBased?: boolean;
40
+ typewriterConfig?: TypewriterConfig;
41
+ floatingButtonLabel?: string;
42
+ floatingButtonIcon?: string;
43
+ floatingButtonImage?: string;
44
+ floatingButtonImageAlt?: string;
45
+ iconPosition?: "left" | "right";
46
+ }
47
+ export interface AgentforceLoErrorEvent {
48
+ type: "lo.application.error" | "lo.iframe.error" | "lo.session.error";
49
+ detail: unknown;
50
+ }
51
+ export type AgentforceErrorHandler = (error: AgentforceLoErrorEvent) => void;
52
+ export type AgentforceReadyHandler = (detail: unknown) => void;
53
+ /** Why ACC stopped keepalive and needs the host to mint a frontdoor URL. */
54
+ export interface AgentforceSessionRecoveryRequest {
55
+ reason: "expired" | "refresh-failed" | "expiry-unavailable";
56
+ /** Seconds remaining, when known. Absent if the TTL query itself failed. */
57
+ ttlSeconds?: number;
58
+ /** The underlying Lightning Out error, when one triggered the request. */
59
+ error?: unknown;
60
+ }
61
+ /**
62
+ * Optional keepalive tuning for frontdoor-URL-only embeds. Keepalive
63
+ * (`sessionRefresh`) is on by default in that mode; use this to override
64
+ * thresholds or handle frontdoor regeneration.
65
+ */
66
+ export interface AgentforceSessionManagementConfig {
67
+ /**
68
+ * Optional convenience callback with the same payload as
69
+ * `agentforce:frontdoorurlrequired`. Prefer listening for the event on the
70
+ * container. May be async; rejections are logged and forwarded to `onError`.
71
+ */
72
+ onFrontdoorUrlRequired?: (request: AgentforceSessionRecoveryRequest) => void | Promise<void>;
73
+ /** How often to inspect the session TTL. Defaults to 60 seconds for now. */
74
+ checkIntervalMs?: number;
75
+ /** Do nothing while the TTL is above this value. Defaults to 10 minutes. */
76
+ skipThresholdSeconds?: number;
77
+ /**
78
+ * Below this TTL (and above zero), ACC calls `sessionRefresh()`. At or below
79
+ * this value ACC asks the host for a new frontdoor URL. Defaults to 5 minutes.
80
+ */
81
+ refreshThresholdSeconds?: number;
82
+ }
83
+ export interface EmbedAgentforceClientOptions {
84
+ container: string | HTMLElement;
85
+ salesforceOrigin?: string;
86
+ appId?: string;
87
+ frontdoorUrl?: string;
88
+ sitePrefix?: string;
89
+ agentforceClientConfig?: AgentforceClientConfig;
90
+ /**
91
+ * Optional keepalive overrides / regeneration hook. Keepalive runs by default
92
+ * in frontdoor-URL-only mode; omit this unless you need to tune or handle recovery.
93
+ */
94
+ sessionManagement?: AgentforceSessionManagementConfig;
95
+ onError?: AgentforceErrorHandler;
96
+ onReady?: AgentforceReadyHandler;
97
+ }
98
+ /**
99
+ * Lightning Out application element with the session primitives LO already owns.
100
+ * In frontdoor-URL-only mode ACC calls `sessionRefresh()` for keepalive by default;
101
+ * the host still owns minting a new frontdoor URL when the session is dead.
102
+ */
103
+ export interface AgentforceLightningOutApplication extends HTMLElement {
104
+ sessionExpiry(): Promise<number>;
105
+ sessionRefresh(): Promise<void>;
106
+ frontdoorUrl: string;
107
+ }
108
+ export interface EmbedAgentforceClientResult {
109
+ loApp: AgentforceLightningOutApplication;
110
+ chatClientComponent: HTMLElement;
111
+ /**
112
+ * Hands a freshly minted frontdoor URL to Lightning Out. Only the hidden auth
113
+ * iframe reloads, so the conversation stays mounted. Rejects empty URLs and
114
+ * org-url mode; ignores writes after logout.
115
+ */
116
+ setFrontdoorUrl: (frontdoorUrl: string) => void;
117
+ }
118
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE;QACjB,IAAI,CAAC,EAAE,kBAAkB,CAAC;QAC1B,KAAK,CAAC,EA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
2
  "name": "@salesforce/agentforce-conversation-client",
3
3
  "description": "Agentforce Conversation Client SDK for embedding via Lightning Out 2.0",
4
- "version": "11.67.1",
4
+ "version": "11.68.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",