@accurix/centrinfo-widget 5.1.2 → 5.2.1

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,139 +1,9 @@
1
- import { C as StringsProvider, D as AnalyticsExplanationInput, E as AnalyticsAIExplanationTransport, O as AnalyticsGroupComparisonPoint, S as Transport, T as ResultLabels, _ as DemoSlotsResult, a as MessageAttachment, b as PublicChatAction, c as Visitor, f as WidgetThemeTokens, g as DemoBooking, h as AnalyticsVisualization, i as FeaturedLink, k as AnalyticsPeriodComparison, 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-BuoTcoZu.cjs";
2
- import * as preact3 from "preact";
1
+ import { A as ResultColumn, C as Transport, D as AnalyticsComboModel, E as ResultLabels, F as AnalyticsGroupComparisonPoint, I as AnalyticsPeriodComparison, M as ResultFormatContext, N as AnalyticsAIExplanationTransport, O as AnalyticsVisualization$1, 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 ResultTableClassNames, k as AnalyticsVisualizationColumn, 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-DAYxNBhI.cjs";
2
+ import * as preact2 from "preact";
3
3
  import { JSX } from "preact";
4
4
 
5
- //#region ../centrinfo-results/src/analytics-chart-catalog.d.ts
6
- type AnalyticsChartCatalogType = 'kpi' | 'table' | 'line' | 'bar' | 'pie' | 'scatter' | 'effectScatter' | 'map' | 'candlestick' | 'boxplot' | 'graph' | 'lines' | 'tree' | 'treemap' | 'sunburst' | 'parallel' | 'sankey' | 'funnel' | 'heatmap' | 'radar' | 'gauge' | 'pictorialBar' | 'themeRiver' | 'matrix' | 'chord' | 'custom' | 'dataset' | 'dataZoom' | 'graphic' | 'richText' | 'globe' | 'bar3D' | 'scatter3D' | 'surface' | 'map3D' | 'lines3D' | 'line3D' | 'scatterGL' | 'linesGL' | 'flowGL' | 'graphGL' | 'polygons3D';
7
- //#endregion
8
- //#region ../centrinfo-results/src/format.d.ts
9
- /**
10
- * The one place numbers, currency, percentages and dates are formatted, so the
11
- * chart axis, tooltip, table and KPI show the same value the same way.
12
- *
13
- * Rules:
14
- * - Currency comes from column metadata (`currencyCode`) or the result's fixed
15
- * currency. With no known code the amount is shown as a plain number.
16
- * - A `percent` column is read as percentage points (0.5 is "0.5%") unless its
17
- * `formatPattern` contains `%` (Excel style), which marks a fraction (0.5 is
18
- * "50%"). Magnitude is never used to guess.
19
- * - Date-only values (`2024-03-05`) are calendar dates: they are formatted in
20
- * UTC so they never shift a day. Instants are formatted in the result
21
- * timezone. Granularity follows column metadata, the result's comparison
22
- * grain, or the shape of the values — a daily series is never "Mar 2024".
23
- */
24
- type ResultGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
25
- interface ResultFormatContext {
26
- locale?: string;
27
- /** IANA zone of the result; used for instants, never for date-only values. */
28
- timezone?: string;
29
- grain?: ResultGrain;
30
- /** Result-level fixed currency, used when the column has none. */
31
- currencyCode?: string;
32
- yes?: string;
33
- no?: string;
34
- }
35
- //#endregion
36
- //#region ../centrinfo-results/src/types.d.ts
37
- interface AnalyticsVisualizationColumn {
38
- key: string;
39
- label: string;
40
- dataType: 'text' | 'number' | 'currency' | 'percent' | 'boolean' | 'date' | 'datetime';
41
- semanticRole: 'identifier' | 'dimension' | 'measure' | 'date' | 'geography' | 'boolean';
42
- aggregation?: 'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max';
43
- allowedAggregations?: Array<'none' | 'sum' | 'avg' | 'count' | 'count_distinct' | 'min' | 'max'>;
44
- formatPattern?: string;
45
- currencyCode?: string;
46
- /** Time granularity of a date column; drives how its values are labelled. */
47
- grain?: ResultGrain;
48
- description?: string;
49
- priority?: 'primary' | 'secondary' | 'detail';
50
- sortable?: boolean;
51
- filterable?: boolean;
52
- groupable?: boolean;
53
- }
54
- interface AnalyticsVisualizationRecommendation {
55
- type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
56
- mode: string;
57
- categoryField?: string;
58
- latitudeField?: string;
59
- longitudeField?: string;
60
- geometryField?: string;
61
- valueFields?: string[];
62
- seriesField?: string;
63
- reason?: string;
64
- confidence?: number;
65
- }
66
- interface AnalyticsVisualization$1 {
67
- /** The latest time bucket is still in progress (drawn dashed). */
68
- lastPeriodInProgress?: boolean;
69
- /** Like-for-like comparison basis (reader-safe). */
70
- periodComparison?: AnalyticsPeriodComparison;
71
- version?: number;
72
- presentation?: 'kpi' | 'chart' | 'table';
73
- type: AnalyticsChartCatalogType | 'area' | 'stacked_bar';
74
- title?: string;
75
- label?: string;
76
- value?: string;
77
- latitudeField?: string;
78
- longitudeField?: string;
79
- geometryField?: string;
80
- valueFields?: string[];
81
- series?: string;
82
- seriesField?: string;
83
- columns?: string[];
84
- rows?: Array<Record<string, unknown>>;
85
- rowCount?: number;
86
- timezone?: string;
87
- freshness?: {
88
- status?: string;
89
- answeredAt?: string;
90
- };
91
- reportingPeriod?: {
92
- label?: string;
93
- start?: string;
94
- end?: string;
95
- timezone?: string;
96
- };
97
- appliedFilters?: Array<{
98
- field: string;
99
- operator: string;
100
- value: unknown;
101
- }>;
102
- explanation?: {
103
- checkedAt?: string;
104
- timezone?: string;
105
- dataFreshness?: {
106
- status?: string;
107
- };
108
- };
109
- expandable?: boolean;
110
- tableAvailable?: boolean;
111
- downloadAvailable?: boolean;
112
- columnMetadata?: AnalyticsVisualizationColumn[];
113
- currency?: {
114
- code?: string;
115
- field?: string;
116
- source?: 'fixed_metadata' | 'source_field';
117
- isMixed: boolean;
118
- };
119
- chartRecommendation?: AnalyticsVisualizationRecommendation;
120
- }
121
- interface ResultColumn {
122
- key: string;
123
- label?: string;
124
- dataType?: AnalyticsVisualizationColumn['dataType'];
125
- currencyCode?: string;
126
- formatPattern?: string;
127
- grain?: ResultGrain;
128
- semanticRole?: AnalyticsVisualizationColumn['semanticRole'];
129
- }
130
- interface ResultTableClassNames {
131
- wrap?: string;
132
- table?: string;
133
- note?: string;
134
- }
135
- //#endregion
136
5
  //#region ../centrinfo-results/src/chart.d.ts
6
+
137
7
  type WidgetAnalyticsSeries = {
138
8
  field: string;
139
9
  name: string;
@@ -142,8 +12,9 @@ type WidgetAnalyticsSeries = {
142
12
  /** Like-for-like breakdown: per-point comparison (tooltip detail). */
143
13
  points?: Array<AnalyticsGroupComparisonPoint | undefined>;
144
14
  };
145
- type WidgetAnalyticsChartType = 'line' | 'bar' | 'stacked_bar';
15
+ type WidgetAnalyticsChartType = 'line' | 'area' | 'bar' | 'stacked_bar' | 'combo';
146
16
  type WidgetAnalyticsChartModel = {
17
+ combo?: AnalyticsComboModel;
147
18
  type: WidgetAnalyticsChartType;
148
19
  title: string;
149
20
  xAxisTitle: string;
@@ -163,6 +34,7 @@ type WidgetAnalyticsChartModel = {
163
34
  labels: ResultLabels;
164
35
  };
165
36
  type WidgetAnalyticsChartOptions = {
37
+ maxSeries?: number;
166
38
  locale?: string;
167
39
  labels?: Partial<ResultLabels>;
168
40
  };
@@ -176,7 +48,7 @@ declare const WidgetAnalyticsChart: ({
176
48
  expanded?: boolean;
177
49
  /** Class prefix of the surface (`cf` widget, `ca` chat app). */
178
50
  classPrefix?: string;
179
- }) => preact3.JSX.Element;
51
+ }) => preact2.JSX.Element;
180
52
  //#endregion
181
53
  //#region ../centrinfo-results/src/result.d.ts
182
54
  declare const formatResultCell: (value: unknown, locale?: string, column?: ResultColumn, context?: ResultFormatContext) => string;
@@ -203,7 +75,7 @@ declare const ResultTable: ({
203
75
  expanded,
204
76
  classNames,
205
77
  emptyLabel
206
- }: ResultTableProps) => preact3.JSX.Element;
78
+ }: ResultTableProps) => preact2.JSX.Element;
207
79
  //#endregion
208
80
  //#region ../centrinfo-results/src/result-details.d.ts
209
81
  interface AnalyticsResultDetail {
@@ -212,8 +84,9 @@ interface AnalyticsResultDetail {
212
84
  }
213
85
  //#endregion
214
86
  //#region src/config.d.ts
215
- 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'>> {
87
+ 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'>> {
216
88
  accentColor?: string;
89
+ composer?: WidgetConfig['composer'];
217
90
  agentName?: string;
218
91
  agentAvatarUrl?: string;
219
92
  launcherIcon?: string;
@@ -229,6 +102,7 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
229
102
  user?: WidgetConfig['user'];
230
103
  /** Short-lived signed context for governed customer analytics. */
231
104
  analyticsContextToken?: WidgetConfig['analyticsContextToken'];
105
+ analyticsModelId?: string;
232
106
  identityToken?: WidgetConfig['identityToken'];
233
107
  getIdentityToken?: WidgetConfig['getIdentityToken'];
234
108
  customLauncherSelector?: string;
@@ -244,7 +118,7 @@ interface ResolvedConfig extends Required<Omit<WidgetConfig, 'accentColor' | 'ag
244
118
  onAction?: WidgetConfig['onAction'];
245
119
  onHandoff?: WidgetConfig['onHandoff'];
246
120
  }
247
- declare const resolveConfig: (cfg: WidgetConfig) => ResolvedConfig;
121
+ declare const resolveConfig: (input: WidgetConfig) => ResolvedConfig;
248
122
  //#endregion
249
123
  //#region src/api/factory.d.ts
250
124
  /**
@@ -256,6 +130,10 @@ declare const createChatTransport: (config: ResolvedConfig) => Transport;
256
130
  //#region src/rich.d.ts
257
131
  declare const renderRich: (text: string) => JSX.Element[];
258
132
  //#endregion
133
+ //#region src/response-content.d.ts
134
+ /** The text and structured values actually displayed with a chat reply. */
135
+ declare const copyableChatResponse: (message: ChatMessage) => string;
136
+ //#endregion
259
137
  //#region src/result-details.d.ts
260
138
  /** Reader-safe result context shared by the floating widget and chat app. */
261
139
  declare const analyticsResultDetails: (result: AnalyticsVisualization, labels?: Partial<ResultLabels>, locale?: string) => AnalyticsResultDetail[];
@@ -307,6 +185,9 @@ interface OutgoingAttachment {
307
185
  file?: Blob;
308
186
  }
309
187
  interface ChatApi {
188
+ analyticsModels: AnalyticsModelOption[];
189
+ analyticsModelId: string;
190
+ selectAnalyticsModel: (id: string) => void;
310
191
  persona: BootstrapInfo | null;
311
192
  messages: ChatMessage[];
312
193
  sending: boolean;
@@ -356,6 +237,9 @@ interface ChatApi {
356
237
  retry: (agentId: string, question: string, opts?: Pick<SendOpts, 'forceVoicePlayback'>) => void;
357
238
  /** Record a 👍/👎 on an assistant reply (optional comment on 👎). Optimistic. */
358
239
  rateMessage: (messageId: string, rating: 'up' | 'down', comment?: string) => void;
240
+ /** Verify a specific reply against the sources or data available to the agent. */
241
+ doubleCheckResponse: (messageId: string) => void;
242
+ retryResponse: (messageId: string) => void;
359
243
  /** Record a vote on an analytics explanation. Rejects when it could not be
360
244
  * saved (or the transport has no explanation feedback) so the UI can retry. */
361
245
  rateExplanation: (input: Omit<ExplanationFeedbackInput, 'sessionId' | 'surface'>, surface?: ExplanationFeedbackInput['surface']) => Promise<void>;
@@ -405,8 +289,10 @@ interface ChatApi {
405
289
  viewingSessionId: string | null;
406
290
  /** The read-only transcript of the conversation being viewed. */
407
291
  viewMessages: ChatMessage[];
408
- /** Open a past conversation read-only. */
292
+ /** Resume an open signed-in conversation; otherwise show its read-only transcript. */
409
293
  openConversation: (sessionId: string) => void;
294
+ renameConversation: (sessionId: string, title: string) => Promise<void>;
295
+ deleteConversation: (sessionId: string) => Promise<void>;
410
296
  /** Leave the read-only history view, back to the live conversation. */
411
297
  closeHistoryView: () => void;
412
298
  /** Logout: erase ALL of this visitor's locally-stored data (identity,
@@ -460,6 +346,28 @@ declare const ActionsArea: ({
460
346
  onClose?: () => void;
461
347
  }) => JSX.Element | null;
462
348
  //#endregion
349
+ //#region src/analytics-model-selector.d.ts
350
+ 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";
351
+ declare const AnalyticsModelSelector: ({
352
+ models,
353
+ value,
354
+ onChange,
355
+ disabled,
356
+ copy,
357
+ classPrefix
358
+ }: {
359
+ models: AnalyticsModelOption[];
360
+ value: string;
361
+ onChange: (id: string) => void;
362
+ disabled?: boolean;
363
+ copy?: Partial<WidgetStrings>;
364
+ classPrefix?: string;
365
+ }) => preact2.JSX.Element | null;
366
+ //#endregion
367
+ //#region src/customization.d.ts
368
+ /** Translate the simple options once; explicit advanced options take precedence. */
369
+ declare const normalizeChatCustomization: <T extends WidgetConfig>(config: T) => T & WidgetConfig;
370
+ //#endregion
463
371
  //#region src/style-rules.d.ts
464
372
  /**
465
373
  * Picks the rules for some components out of a stylesheet, so another
@@ -535,4 +443,4 @@ declare const stopRecorderWithFlush: (recorder: MediaRecorder | null | undefined
535
443
  */
536
444
  declare const WIDGET_ACTION_STYLES: string;
537
445
  //#endregion
538
- 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 };
446
+ 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 };
@@ -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-95uGbSpk.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-CiqV_OsG.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};