@accurix/centrinfo-widget 5.1.2 → 5.2.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,9 +1,11 @@
1
- import { A as buildWidgetAnalyticsChartModel, C as StringsProvider, D as formatResultCell, E as ResultTable, M as AnalyticsAIExplanationTransport, N as AnalyticsExplanationInput, O as serializeResultCsv, S as Transport, T as AnalyticsResultDetail, _ as DemoSlotsResult, a as MessageAttachment, b as PublicChatAction, c as Visitor, f as WidgetThemeTokens, g as DemoBooking, h as AnalyticsVisualization, i as FeaturedLink, j as ResultLabels, k as WidgetAnalyticsChart, l as WidgetActionTranslation, m as ActionResult, n as ChatArtifact, o as SchedulerInfo, p as WidgetUser, r as ChatMessage, s as Source, t as BootstrapInfo, u as WidgetConfig, v as ExplanationFeedbackInput, w as WidgetStrings, x as PublicChatActionField, y as GifResult } from "./types-3zpBBhPI.mjs";
1
+ import { A as WidgetAnalyticsChart, C as Transport, D as ResultTable, E as AnalyticsResultDetail, M as ResultLabels, N as AnalyticsAIExplanationTransport, O as formatResultCell, P as AnalyticsExplanationInput, S as PublicChatActionField, T as WidgetStrings, _ as DemoBooking, a as MessageAttachment, b as GifResult, c as Visitor, f as WidgetThemeTokens, g as AnalyticsVisualization, h as AnalyticsModelOption, i as FeaturedLink, j as buildWidgetAnalyticsChartModel, k as serializeResultCsv, l as WidgetActionTranslation, m as ActionResult, n as ChatArtifact, o as SchedulerInfo, p as WidgetUser, r as ChatMessage, s as Source, t as BootstrapInfo, u as WidgetConfig, v as DemoSlotsResult, w as StringsProvider, x as PublicChatAction, y as ExplanationFeedbackInput } from "./types-CmLbqY23.mjs";
2
+ import * as preact1 from "preact";
2
3
  import { JSX } from "preact";
3
4
 
4
5
  //#region src/config.d.ts
5
- interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'locale' | 'dir' | 'translations' | 'user' | 'analyticsContextToken' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onOpenAnalyticsSource' | 'onAction' | 'onHandoff'>> {
6
+ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'branding' | 'composer' | 'agentName' | 'agentAvatarUrl' | 'launcherIcon' | 'themeTokens' | 'gifApiKey' | 'labels' | 'locale' | 'dir' | 'translations' | 'user' | 'analyticsContextToken' | 'analyticsModelId' | 'identityToken' | 'getIdentityToken' | 'customLauncherSelector' | 'proactiveMessage' | 'proactiveOnPaths' | 'onOpen' | 'onClose' | 'onShow' | 'onHide' | 'onUnreadChange' | 'onMessage' | 'onOpenAnalyticsSource' | 'onAction' | 'onHandoff'>> {
6
7
  accentColor?: string;
8
+ composer?: WidgetConfig['composer'];
7
9
  agentName?: string;
8
10
  agentAvatarUrl?: string;
9
11
  launcherIcon?: string;
@@ -19,6 +21,7 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
19
21
  user?: WidgetConfig['user'];
20
22
  /** Short-lived signed context for governed customer analytics. */
21
23
  analyticsContextToken?: WidgetConfig['analyticsContextToken'];
24
+ analyticsModelId?: string;
22
25
  identityToken?: WidgetConfig['identityToken'];
23
26
  getIdentityToken?: WidgetConfig['getIdentityToken'];
24
27
  customLauncherSelector?: string;
@@ -34,7 +37,7 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
34
37
  onAction?: WidgetConfig['onAction'];
35
38
  onHandoff?: WidgetConfig['onHandoff'];
36
39
  }
37
- declare const resolveConfig: (cfg: WidgetConfig) => ResolvedConfig;
40
+ declare const resolveConfig: (input: WidgetConfig) => ResolvedConfig;
38
41
  //#endregion
39
42
  //#region src/api/factory.d.ts
40
43
  /**
@@ -46,6 +49,10 @@ declare const createChatTransport: (config: ResolvedConfig) => Transport;
46
49
  //#region src/rich.d.ts
47
50
  declare const renderRich: (text: string) => JSX.Element[];
48
51
  //#endregion
52
+ //#region src/response-content.d.ts
53
+ /** The text and structured values actually displayed with a chat reply. */
54
+ declare const copyableChatResponse: (message: ChatMessage) => string;
55
+ //#endregion
49
56
  //#region src/result-details.d.ts
50
57
  /** Reader-safe result context shared by the floating widget and chat app. */
51
58
  declare const analyticsResultDetails: (result: AnalyticsVisualization, labels?: Partial<ResultLabels>, locale?: string) => AnalyticsResultDetail[];
@@ -97,6 +104,9 @@ interface OutgoingAttachment {
97
104
  file?: Blob;
98
105
  }
99
106
  interface ChatApi {
107
+ analyticsModels: AnalyticsModelOption[];
108
+ analyticsModelId: string;
109
+ selectAnalyticsModel: (id: string) => void;
100
110
  persona: BootstrapInfo | null;
101
111
  messages: ChatMessage[];
102
112
  sending: boolean;
@@ -146,6 +156,9 @@ interface ChatApi {
146
156
  retry: (agentId: string, question: string, opts?: Pick<SendOpts, 'forceVoicePlayback'>) => void;
147
157
  /** Record a 👍/👎 on an assistant reply (optional comment on 👎). Optimistic. */
148
158
  rateMessage: (messageId: string, rating: 'up' | 'down', comment?: string) => void;
159
+ /** Verify a specific reply against the sources or data available to the agent. */
160
+ doubleCheckResponse: (messageId: string) => void;
161
+ retryResponse: (messageId: string) => void;
149
162
  /** Record a vote on an analytics explanation. Rejects when it could not be
150
163
  * saved (or the transport has no explanation feedback) so the UI can retry. */
151
164
  rateExplanation: (input: Omit<ExplanationFeedbackInput, 'sessionId' | 'surface'>, surface?: ExplanationFeedbackInput['surface']) => Promise<void>;
@@ -195,8 +208,10 @@ interface ChatApi {
195
208
  viewingSessionId: string | null;
196
209
  /** The read-only transcript of the conversation being viewed. */
197
210
  viewMessages: ChatMessage[];
198
- /** Open a past conversation read-only. */
211
+ /** Resume an open signed-in conversation; otherwise show its read-only transcript. */
199
212
  openConversation: (sessionId: string) => void;
213
+ renameConversation: (sessionId: string, title: string) => Promise<void>;
214
+ deleteConversation: (sessionId: string) => Promise<void>;
200
215
  /** Leave the read-only history view, back to the live conversation. */
201
216
  closeHistoryView: () => void;
202
217
  /** Logout: erase ALL of this visitor's locally-stored data (identity,
@@ -250,6 +265,28 @@ declare const ActionsArea: ({
250
265
  onClose?: () => void;
251
266
  }) => JSX.Element | null;
252
267
  //#endregion
268
+ //#region src/analytics-model-selector.d.ts
269
+ declare const ANALYTICS_MODEL_SELECTOR_STYLES = "\n.ci-analytics-model{display:block;flex:0 1 auto;min-width:0;width:fit-content;max-width:180px;margin:0 4px;--rv-bg:var(--ca-bg,var(--cf-bg,#fff));--rv-text:var(--ca-ink,var(--cf-text,#0f1e2a));--rv-border:var(--ca-line,var(--cf-border,#d3e0e8));--rv-accent:var(--ca-accent,var(--cf-accent,#167d55));--rv-surface:var(--ca-hover-bg,var(--cf-surface,#f4f6f8))}\n.ci-analytics-model summary{min-width:0;max-width:100%;min-height:30px;box-sizing:border-box;padding:5px 9px;font-size:12px;border-radius:8px}\n.ci-analytics-model summary>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.ci-analytics-model summary[aria-disabled=\"true\"]{opacity:.6;cursor:default}\n";
270
+ declare const AnalyticsModelSelector: ({
271
+ models,
272
+ value,
273
+ onChange,
274
+ disabled,
275
+ copy,
276
+ classPrefix
277
+ }: {
278
+ models: AnalyticsModelOption[];
279
+ value: string;
280
+ onChange: (id: string) => void;
281
+ disabled?: boolean;
282
+ copy?: Partial<WidgetStrings>;
283
+ classPrefix?: string;
284
+ }) => preact1.JSX.Element | null;
285
+ //#endregion
286
+ //#region src/customization.d.ts
287
+ /** Translate the simple options once; explicit advanced options take precedence. */
288
+ declare const normalizeChatCustomization: <T extends WidgetConfig>(config: T) => T & WidgetConfig;
289
+ //#endregion
253
290
  //#region src/style-rules.d.ts
254
291
  /**
255
292
  * Picks the rules for some components out of a stylesheet, so another
@@ -325,4 +362,4 @@ declare const stopRecorderWithFlush: (recorder: MediaRecorder | null | undefined
325
362
  */
326
363
  declare const WIDGET_ACTION_STYLES: string;
327
364
  //#endregion
328
- export { type ActionResult, ActionsArea, type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatArtifact, type ChatMessage, type DemoSlotsResult, type HistoryEntry, type MessageAttachment, type PublicChatAction, type PublicChatActionField, type ResolvedConfig, ResultTable, type Source, StringsProvider, type Transport, type VoiceReply, WIDGET_ACTION_STYLES, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, analyticsResultDetails, buildWidgetAnalyticsChartModel, createAdaptiveVoiceActivityDetector, createChatTransport, createPreferredAudioRecorder, createVoiceAudioConstraints, findLiveSupportAction, formatResultCell, looksLikeEcho, reconnectableHandbackId, renderRich, resolveConfig, selectStyleRules, serializeResultCsv, stopRecorderWithFlush, usableTranscript, useChat };
365
+ export { ANALYTICS_MODEL_SELECTOR_STYLES, type ActionResult, ActionsArea, AnalyticsModelSelector, type AnalyticsVisualization, type BootstrapInfo, type ChatApi, type ChatArtifact, type ChatMessage, type DemoSlotsResult, type HistoryEntry, type MessageAttachment, type PublicChatAction, type PublicChatActionField, type ResolvedConfig, ResultTable, type Source, StringsProvider, type Transport, type VoiceReply, WIDGET_ACTION_STYLES, WidgetAnalyticsChart, type WidgetConfig, type WidgetThemeTokens, type WidgetUser, analyticsResultDetails, buildWidgetAnalyticsChartModel, copyableChatResponse, createAdaptiveVoiceActivityDetector, createChatTransport, createPreferredAudioRecorder, createVoiceAudioConstraints, findLiveSupportAction, formatResultCell, looksLikeEcho, normalizeChatCustomization, reconnectableHandbackId, renderRich, resolveConfig, selectStyleRules, serializeResultCsv, stopRecorderWithFlush, usableTranscript, useChat };
package/dist/runtime.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{D as e,G as t,J as n,K as r,W as i,X as a,Y as o,_ as s,a as c,c as l,f as u,g as d,i as f,l as p,n as m,o as h,q as g,r as _,s as v,t as y,z as b}from"./styles-yhqxR2ty.mjs";const x=(e,t)=>{let n=e.replace(/\/\*[\s\S]*?\*\//g,``),r=e=>t.some(t=>e.includes(t)),i=[],a=0;for(;a<n.length;){let e=n.indexOf(`{`,a);if(e<0)break;let o=n.slice(a,e).trim(),s=1,c=e+1;for(;c<n.length&&s>0;)n[c]===`{`?s++:n[c]===`}`&&s--,c++;let l=n.slice(e+1,c-1);if(o.startsWith(`@`))if(/^@(media|supports|container)\b/.test(o)){let e=x(l,t);e&&i.push(`${o} {\n${e}\n}`)}else /^@keyframes\b/.test(o)&&r(o)&&i.push(`${o} {${l}}`);else r(o)&&i.push(`${o} {${l}}`);a=c}return i.join(`
2
- `)},S=(e,t,n)=>i(e,t,n),C=x(y,[`.cf-action`,`.cf-form`,`.cf-booking`]);export{s as ActionsArea,t as ResultTable,b as StringsProvider,C as WIDGET_ACTION_STYLES,n as WidgetAnalyticsChart,S as analyticsResultDetails,o as buildWidgetAnalyticsChartModel,h as createAdaptiveVoiceActivityDetector,a as createChatTransport,v as createPreferredAudioRecorder,l as createVoiceAudioConstraints,_ as findLiveSupportAction,r as formatResultCell,u as looksLikeEcho,f as reconnectableHandbackId,e as renderRich,m as resolveConfig,x as selectStyleRules,g as serializeResultCsv,p as stopRecorderWithFlush,d as usableTranscript,c as useChat};
1
+ import{$ as e,G as t,H as n,J as r,O as i,Q as a,U as o,X as s,Y as c,Z as l,_ as u,a as d,c as f,et as p,i as m,l as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,z as w}from"./styles-BNPs-1he.mjs";const T=(e,t)=>{let n=e.replace(/\/\*[\s\S]*?\*\//g,``),r=e=>t.some(t=>e.includes(t)),i=[],a=0;for(;a<n.length;){let e=n.indexOf(`{`,a);if(e<0)break;let o=n.slice(a,e).trim(),s=1,c=e+1;for(;c<n.length&&s>0;)n[c]===`{`?s++:n[c]===`}`&&s--,c++;let l=n.slice(e+1,c-1);if(o.startsWith(`@`))if(/^@(media|supports|container)\b/.test(o)){let e=T(l,t);e&&i.push(`${o} {\n${e}\n}`)}else /^@keyframes\b/.test(o)&&r(o)&&i.push(`${o} {${l}}`);else r(o)&&i.push(`${o} {${l}}`);a=c}return i.join(`
2
+ `)},E=(e,t,n)=>r(e,t,n),D=T(x,[`.cf-action`,`.cf-form`,`.cf-booking`]);export{n as ANALYTICS_MODEL_SELECTOR_STYLES,C as ActionsArea,o as AnalyticsModelSelector,c as ResultTable,t as StringsProvider,D as WIDGET_ACTION_STYLES,a as WidgetAnalyticsChart,E as analyticsResultDetails,e as buildWidgetAnalyticsChartModel,w as copyableChatResponse,b as createAdaptiveVoiceActivityDetector,p as createChatTransport,f as createPreferredAudioRecorder,h as createVoiceAudioConstraints,m as findLiveSupportAction,s as formatResultCell,v as looksLikeEcho,y as normalizeChatCustomization,d as reconnectableHandbackId,i as renderRich,g as resolveConfig,T as selectStyleRules,l as serializeResultCsv,S as stopRecorderWithFlush,u as usableTranscript,_ as useChat};