@unisphere/genie-types 1.24.2 → 1.25.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.
- package/index.esm.js +95 -119
- package/package.json +1 -1
- package/src/lib/chat-customizations-types.d.ts +3 -1
- package/src/lib/chat-runtime/runtime-player-plugin-types.d.ts +6 -19
- package/src/lib/chat-runtime/runtime-types.d.ts +30 -17
- package/src/lib/chat-runtime/shared-settings.d.ts +1 -0
- package/src/lib/chat-runtime/visuals-types.d.ts +41 -46
package/index.esm.js
CHANGED
|
@@ -1238,17 +1238,29 @@ const getSourceUrlSchema = {
|
|
|
1238
1238
|
type: 'function',
|
|
1239
1239
|
optional: true
|
|
1240
1240
|
};
|
|
1241
|
+
const schemaVersionSchema = {
|
|
1242
|
+
type: 'literal',
|
|
1243
|
+
value: '1',
|
|
1244
|
+
optional: true
|
|
1245
|
+
};
|
|
1241
1246
|
|
|
1242
1247
|
/** Runtime name constant for chat experiences */
|
|
1243
1248
|
const ChatRuntimeName = 'chat';
|
|
1249
|
+
const agentModeSchema = {
|
|
1250
|
+
type: 'primitive',
|
|
1251
|
+
value: 'boolean',
|
|
1252
|
+
optional: true
|
|
1253
|
+
};
|
|
1254
|
+
const avatarContainerModeSchema = {
|
|
1255
|
+
type: 'enum',
|
|
1256
|
+
values: ['dialog', 'contained'],
|
|
1257
|
+
optional: true,
|
|
1258
|
+
deprecationMessage: 'This field is no longer required and will be ignored if provided'
|
|
1259
|
+
};
|
|
1244
1260
|
const chatRuntimeSettingsSchema = {
|
|
1245
1261
|
type: 'object',
|
|
1246
1262
|
properties: {
|
|
1247
|
-
schemaVersion:
|
|
1248
|
-
type: 'literal',
|
|
1249
|
-
value: '1',
|
|
1250
|
-
optional: true
|
|
1251
|
-
},
|
|
1263
|
+
schemaVersion: schemaVersionSchema,
|
|
1252
1264
|
genieServerUrl: {
|
|
1253
1265
|
type: 'primitive',
|
|
1254
1266
|
value: 'string',
|
|
@@ -1363,16 +1375,36 @@ const chatRuntimeSettingsSchema = {
|
|
|
1363
1375
|
optional: true,
|
|
1364
1376
|
deprecationMessage: 'Use context instead: { type: "entry", id: "your-entry-id" }'
|
|
1365
1377
|
},
|
|
1366
|
-
agentMode:
|
|
1367
|
-
type: 'primitive',
|
|
1368
|
-
value: 'boolean',
|
|
1369
|
-
optional: true
|
|
1370
|
-
},
|
|
1378
|
+
agentMode: agentModeSchema,
|
|
1371
1379
|
// @deprecated - no longer supported
|
|
1372
|
-
avatarContainerMode:
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
optional: true
|
|
1380
|
+
avatarContainerMode: avatarContainerModeSchema,
|
|
1381
|
+
initialThread: {
|
|
1382
|
+
type: 'orByType',
|
|
1383
|
+
optional: true,
|
|
1384
|
+
schemas: {
|
|
1385
|
+
threadId: {
|
|
1386
|
+
type: 'object',
|
|
1387
|
+
properties: {
|
|
1388
|
+
type: {
|
|
1389
|
+
type: 'literal',
|
|
1390
|
+
value: 'threadId'
|
|
1391
|
+
},
|
|
1392
|
+
threadId: {
|
|
1393
|
+
type: 'primitive',
|
|
1394
|
+
value: 'string'
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
},
|
|
1398
|
+
lastThreadByContext: {
|
|
1399
|
+
type: 'object',
|
|
1400
|
+
properties: {
|
|
1401
|
+
type: {
|
|
1402
|
+
type: 'literal',
|
|
1403
|
+
value: 'lastThreadByContext'
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1376
1408
|
}
|
|
1377
1409
|
}
|
|
1378
1410
|
};
|
|
@@ -1385,11 +1417,7 @@ const chatRuntimePlayerPluginSettingsSchema = {
|
|
|
1385
1417
|
value: 'string',
|
|
1386
1418
|
optional: true
|
|
1387
1419
|
},
|
|
1388
|
-
schemaVersion:
|
|
1389
|
-
type: 'literal',
|
|
1390
|
-
value: '1',
|
|
1391
|
-
optional: true
|
|
1392
|
-
},
|
|
1420
|
+
schemaVersion: schemaVersionSchema,
|
|
1393
1421
|
kalturaServerURI: {
|
|
1394
1422
|
type: 'primitive',
|
|
1395
1423
|
value: 'string',
|
|
@@ -1411,16 +1439,8 @@ const chatRuntimePlayerPluginSettingsSchema = {
|
|
|
1411
1439
|
},
|
|
1412
1440
|
integrations: integrationsSchema,
|
|
1413
1441
|
shareUrl: shareUrlSchema,
|
|
1414
|
-
agentMode:
|
|
1415
|
-
|
|
1416
|
-
value: 'boolean',
|
|
1417
|
-
optional: true
|
|
1418
|
-
},
|
|
1419
|
-
avatarContainerMode: {
|
|
1420
|
-
type: 'enum',
|
|
1421
|
-
values: ['dialog', 'contained'],
|
|
1422
|
-
optional: true
|
|
1423
|
-
}
|
|
1442
|
+
agentMode: agentModeSchema,
|
|
1443
|
+
avatarContainerMode: avatarContainerModeSchema
|
|
1424
1444
|
}
|
|
1425
1445
|
};
|
|
1426
1446
|
|
|
@@ -1550,7 +1570,7 @@ const chatCustomizationSchema = {
|
|
|
1550
1570
|
properties: {
|
|
1551
1571
|
type: {
|
|
1552
1572
|
type: 'enum',
|
|
1553
|
-
values: ['default', 'banner'],
|
|
1573
|
+
values: ['default', 'banner', 'chatThread'],
|
|
1554
1574
|
optional: true
|
|
1555
1575
|
},
|
|
1556
1576
|
title: {
|
|
@@ -1589,25 +1609,49 @@ const chatCustomizationSchema = {
|
|
|
1589
1609
|
value: 'string'
|
|
1590
1610
|
}
|
|
1591
1611
|
}
|
|
1612
|
+
},
|
|
1613
|
+
openingSystemMessage: {
|
|
1614
|
+
type: 'primitive',
|
|
1615
|
+
value: 'string',
|
|
1616
|
+
optional: true
|
|
1592
1617
|
}
|
|
1593
1618
|
}
|
|
1594
1619
|
}
|
|
1595
1620
|
}
|
|
1596
1621
|
};
|
|
1597
1622
|
|
|
1598
|
-
|
|
1623
|
+
// ---------- Schema constants ----------
|
|
1624
|
+
const scrollSchema = {
|
|
1625
|
+
type: 'enum',
|
|
1626
|
+
values: ['body', 'container', 'modal'],
|
|
1627
|
+
optional: true
|
|
1628
|
+
};
|
|
1629
|
+
const modeSchema = {
|
|
1630
|
+
type: 'enum',
|
|
1631
|
+
values: ['chat', 'everywhere'],
|
|
1632
|
+
optional: true
|
|
1633
|
+
};
|
|
1634
|
+
const initialQuestionSchema = {
|
|
1599
1635
|
type: 'object',
|
|
1636
|
+
optional: true,
|
|
1600
1637
|
properties: {
|
|
1601
|
-
|
|
1602
|
-
type: '
|
|
1603
|
-
value: '
|
|
1604
|
-
optional: true
|
|
1638
|
+
question: {
|
|
1639
|
+
type: 'primitive',
|
|
1640
|
+
value: 'string'
|
|
1605
1641
|
},
|
|
1606
|
-
|
|
1642
|
+
answerType: {
|
|
1607
1643
|
type: 'enum',
|
|
1608
|
-
values:
|
|
1644
|
+
values: Object.values(AnswerTypeEnum),
|
|
1609
1645
|
optional: true
|
|
1610
|
-
}
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
};
|
|
1649
|
+
// ---------- Schemas ----------
|
|
1650
|
+
const floaterVisualSettingsSchema = {
|
|
1651
|
+
type: 'object',
|
|
1652
|
+
properties: {
|
|
1653
|
+
schemaVersion: schemaVersionSchema,
|
|
1654
|
+
mode: modeSchema,
|
|
1611
1655
|
context: chatContextSchema,
|
|
1612
1656
|
customization: chatCustomizationSchema
|
|
1613
1657
|
}
|
|
@@ -1615,21 +1659,13 @@ const floaterVisualSettingsSchema = {
|
|
|
1615
1659
|
const floaterCTAVisualSettingsSchema = {
|
|
1616
1660
|
type: 'object',
|
|
1617
1661
|
properties: {
|
|
1618
|
-
schemaVersion:
|
|
1619
|
-
type: 'literal',
|
|
1620
|
-
value: '1',
|
|
1621
|
-
optional: true
|
|
1622
|
-
},
|
|
1662
|
+
schemaVersion: schemaVersionSchema,
|
|
1623
1663
|
position: {
|
|
1624
1664
|
type: 'enum',
|
|
1625
1665
|
values: ['bottom-right', 'bottom-center', 'bottom-left'],
|
|
1626
1666
|
optional: true
|
|
1627
1667
|
},
|
|
1628
|
-
mode:
|
|
1629
|
-
type: 'enum',
|
|
1630
|
-
values: ['chat', 'everywhere'],
|
|
1631
|
-
optional: true
|
|
1632
|
-
},
|
|
1668
|
+
mode: modeSchema,
|
|
1633
1669
|
openByDefault: {
|
|
1634
1670
|
type: 'primitive',
|
|
1635
1671
|
value: 'boolean',
|
|
@@ -1657,16 +1693,8 @@ const floaterCTAVisualSettingsSchema = {
|
|
|
1657
1693
|
const containedVisualSettingsSchema = {
|
|
1658
1694
|
type: 'object',
|
|
1659
1695
|
properties: {
|
|
1660
|
-
schemaVersion:
|
|
1661
|
-
|
|
1662
|
-
value: '1',
|
|
1663
|
-
optional: true
|
|
1664
|
-
},
|
|
1665
|
-
mode: {
|
|
1666
|
-
type: 'enum',
|
|
1667
|
-
values: ['chat', 'everywhere'],
|
|
1668
|
-
optional: true
|
|
1669
|
-
},
|
|
1696
|
+
schemaVersion: schemaVersionSchema,
|
|
1697
|
+
mode: modeSchema,
|
|
1670
1698
|
customization: chatCustomizationSchema,
|
|
1671
1699
|
onRequestClose: {
|
|
1672
1700
|
type: 'function',
|
|
@@ -1681,11 +1709,7 @@ const containedVisualSettingsSchema = {
|
|
|
1681
1709
|
value: 'boolean',
|
|
1682
1710
|
optional: true
|
|
1683
1711
|
},
|
|
1684
|
-
scroll:
|
|
1685
|
-
type: 'enum',
|
|
1686
|
-
values: ['body', 'container', 'modal'],
|
|
1687
|
-
optional: true
|
|
1688
|
-
},
|
|
1712
|
+
scroll: scrollSchema,
|
|
1689
1713
|
context: chatContextSchema,
|
|
1690
1714
|
closeButtonType: {
|
|
1691
1715
|
type: 'enum',
|
|
@@ -1742,43 +1766,17 @@ const pageContextSchema = {
|
|
|
1742
1766
|
const pageVisualSettingsSchema = {
|
|
1743
1767
|
type: 'object',
|
|
1744
1768
|
properties: {
|
|
1745
|
-
schemaVersion:
|
|
1746
|
-
|
|
1747
|
-
value: '1',
|
|
1748
|
-
optional: true
|
|
1749
|
-
},
|
|
1750
|
-
scroll: {
|
|
1751
|
-
type: 'enum',
|
|
1752
|
-
values: ['body', 'container', 'modal'],
|
|
1753
|
-
optional: true
|
|
1754
|
-
},
|
|
1769
|
+
schemaVersion: schemaVersionSchema,
|
|
1770
|
+
scroll: scrollSchema,
|
|
1755
1771
|
customization: chatCustomizationSchema,
|
|
1756
1772
|
context: pageContextSchema,
|
|
1757
|
-
initialQuestion:
|
|
1758
|
-
type: 'object',
|
|
1759
|
-
optional: true,
|
|
1760
|
-
properties: {
|
|
1761
|
-
question: {
|
|
1762
|
-
type: 'primitive',
|
|
1763
|
-
value: 'string'
|
|
1764
|
-
},
|
|
1765
|
-
answerType: {
|
|
1766
|
-
type: 'enum',
|
|
1767
|
-
values: Object.values(AnswerTypeEnum),
|
|
1768
|
-
optional: true
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1773
|
+
initialQuestion: initialQuestionSchema
|
|
1772
1774
|
}
|
|
1773
1775
|
};
|
|
1774
1776
|
const bannerVisualSettingsSchema = {
|
|
1775
1777
|
type: 'object',
|
|
1776
1778
|
properties: {
|
|
1777
|
-
schemaVersion:
|
|
1778
|
-
type: 'literal',
|
|
1779
|
-
value: '1',
|
|
1780
|
-
optional: true
|
|
1781
|
-
},
|
|
1779
|
+
schemaVersion: schemaVersionSchema,
|
|
1782
1780
|
title: {
|
|
1783
1781
|
type: 'primitive',
|
|
1784
1782
|
value: 'string',
|
|
@@ -1825,32 +1823,10 @@ const bannerVisualSettingsSchema = {
|
|
|
1825
1823
|
const popupVisualSettingsSchema = {
|
|
1826
1824
|
type: 'object',
|
|
1827
1825
|
properties: {
|
|
1828
|
-
schemaVersion:
|
|
1829
|
-
|
|
1830
|
-
value: '1',
|
|
1831
|
-
optional: true
|
|
1832
|
-
},
|
|
1833
|
-
scroll: {
|
|
1834
|
-
type: 'enum',
|
|
1835
|
-
values: ['body', 'container', 'modal'],
|
|
1836
|
-
optional: true
|
|
1837
|
-
},
|
|
1826
|
+
schemaVersion: schemaVersionSchema,
|
|
1827
|
+
scroll: scrollSchema,
|
|
1838
1828
|
customization: chatCustomizationSchema,
|
|
1839
|
-
initialQuestion:
|
|
1840
|
-
type: 'object',
|
|
1841
|
-
optional: true,
|
|
1842
|
-
properties: {
|
|
1843
|
-
question: {
|
|
1844
|
-
type: 'primitive',
|
|
1845
|
-
value: 'string'
|
|
1846
|
-
},
|
|
1847
|
-
answerType: {
|
|
1848
|
-
type: 'enum',
|
|
1849
|
-
values: Object.values(AnswerTypeEnum),
|
|
1850
|
-
optional: true
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1829
|
+
initialQuestion: initialQuestionSchema
|
|
1854
1830
|
}
|
|
1855
1831
|
};
|
|
1856
1832
|
|
|
@@ -3212,4 +3188,4 @@ const blockVisualContextSchema = {
|
|
|
3212
3188
|
}
|
|
3213
3189
|
};
|
|
3214
3190
|
|
|
3215
|
-
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, shareUrlSchema, widgetName };
|
|
3191
|
+
export { AVATAR_DEFAULT_CAPABILITIES, AnswerModelEnum, AnswerTypeEnum, AvatarConnectionStatus, AvatarRuntimeName, CHAT_CONTEXT_TYPE, CHAT_CONTEXT_TYPE_GLOBAL, CHAT_DEFAULT_CAPABILITIES, ChatRuntimeName, DeviceType, DisconnectReasons, SUPPORTED_LAYOUT_TYPES, agentModeSchema, avatarContainerModeSchema, avatarRuntimeChatVisualSettingsSchema, avatarRuntimeContainedVisualSettingsSchema, avatarRuntimeFloaterVisualSettingsSchema, avatarRuntimeSettingsSchema, bannerVisualSettingsSchema, blockVisualContextSchema, chatContextSchema, chatCustomizationSchema, chatRuntimePlayerPluginSettingsSchema, chatRuntimeSettingsSchema, containedVisualSettingsSchema, floaterCTAVisualSettingsSchema, floaterVisualSettingsSchema, getAvatarDefaultCapabilities, getChatDefaultCapabilities, getResolvedRuntimeName, getResolvedWidgetName, getSourceUrlSchema, integrationsSchema, isAvatarConnectionProxyInternalType, pageVisualSettingsSchema, popupVisualSettingsSchema, schemaVersionSchema, shareUrlSchema, widgetName };
|
package/package.json
CHANGED
|
@@ -59,13 +59,15 @@ export interface ChatCustomization {
|
|
|
59
59
|
/** Initial landing page configuration */
|
|
60
60
|
initialPage?: {
|
|
61
61
|
/** Page layout type: 'default' for standard, 'banner' for hero-style */
|
|
62
|
-
type?: 'default' | 'banner';
|
|
62
|
+
type?: 'default' | 'banner' | 'chatThread';
|
|
63
63
|
/** Page title text */
|
|
64
64
|
title?: string;
|
|
65
65
|
/** Suggested questions to display on landing page */
|
|
66
66
|
initialQuestions?: InitialQuestion[];
|
|
67
67
|
/** Background image configuration */
|
|
68
68
|
background?: Background;
|
|
69
|
+
/** Opening system message that will appear in the beginning of all threads */
|
|
70
|
+
openingSystemMessage?: string;
|
|
69
71
|
};
|
|
70
72
|
/** Layout options for the chat interface */
|
|
71
73
|
layouts?: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { UnisphereRuntimeBaseType } from '@unisphere/runtime';
|
|
2
2
|
import { ValidatorSchema } from '@unisphere/core';
|
|
3
3
|
import { widgetName } from '../widget-types';
|
|
4
|
-
import { ChatRuntimeName } from './runtime-types';
|
|
5
|
-
import { GlobalChatSettings } from './shared-settings';
|
|
4
|
+
import { ChatRuntimeName, BaseChatRuntimeSettings } from './runtime-types';
|
|
6
5
|
/**
|
|
7
6
|
* Chat runtime interface for player plugin integration.
|
|
8
7
|
*
|
|
@@ -42,22 +41,10 @@ export interface ChatRuntimePlayerPlugin extends UnisphereRuntimeBaseType<ChatRu
|
|
|
42
41
|
* };
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
|
-
export interface ChatRuntimePlayerPluginSettings {
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
/** Kaltura partner ID */
|
|
51
|
-
partnerId?: string;
|
|
52
|
-
/** Settings schema version */
|
|
53
|
-
schemaVersion?: '1';
|
|
54
|
-
/** External service integrations */
|
|
55
|
-
integrations?: GlobalChatSettings['integrations'];
|
|
56
|
-
/** Configuration for conversation sharing */
|
|
57
|
-
shareUrl?: GlobalChatSettings['shareUrl'];
|
|
58
|
-
/** Enable agent mode for advanced AI capabilities */
|
|
59
|
-
agentMode?: boolean;
|
|
60
|
-
/** @deprecated Use customization.avatar.stage instead */
|
|
61
|
-
avatarContainerMode?: 'dialog' | 'contained';
|
|
44
|
+
export interface ChatRuntimePlayerPluginSettings extends BaseChatRuntimeSettings {
|
|
45
|
+
/** @deprecated This field is no longer required and will be ignored if provided */
|
|
46
|
+
kalturaServerURI?: string;
|
|
47
|
+
/** @deprecated Use context instead: { type: "entry", id: "your-entry-id" } */
|
|
48
|
+
entryId?: string;
|
|
62
49
|
}
|
|
63
50
|
export declare const chatRuntimePlayerPluginSettingsSchema: ValidatorSchema;
|
|
@@ -15,6 +15,32 @@ export interface ChatRuntime extends UnisphereRuntimeBaseType<ChatRuntimeSetting
|
|
|
15
15
|
readonly runtimeName: typeof ChatRuntimeName;
|
|
16
16
|
readonly flavor: '';
|
|
17
17
|
}
|
|
18
|
+
/** Shared settings fields between ChatRuntimeSettings and ChatRuntimePlayerPluginSettings. */
|
|
19
|
+
export interface BaseChatRuntimeSettings {
|
|
20
|
+
/** Kaltura session token for authentication */
|
|
21
|
+
ks?: string;
|
|
22
|
+
/** Kaltura partner ID */
|
|
23
|
+
partnerId?: string;
|
|
24
|
+
/** Settings schema version, defaults to '1' */
|
|
25
|
+
schemaVersion?: '1';
|
|
26
|
+
/** Context for the chat session */
|
|
27
|
+
context?: ChatContext;
|
|
28
|
+
/** Enable agent mode for advanced AI features */
|
|
29
|
+
agentMode?: boolean;
|
|
30
|
+
/** @deprecated Use customization.avatar.stage instead */
|
|
31
|
+
avatarContainerMode?: 'dialog' | 'contained';
|
|
32
|
+
/** External service integrations (Kaltura player, avatar) */
|
|
33
|
+
integrations?: GlobalChatSettings['integrations'];
|
|
34
|
+
/** Configuration for conversation sharing functionality */
|
|
35
|
+
shareUrl?: GlobalChatSettings['shareUrl'];
|
|
36
|
+
}
|
|
37
|
+
/** Initial thread configuration */
|
|
38
|
+
export type InitialThread = {
|
|
39
|
+
type: 'threadId';
|
|
40
|
+
threadId: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'lastThreadByContext';
|
|
43
|
+
};
|
|
18
44
|
/**
|
|
19
45
|
* Configuration settings for the chat runtime.
|
|
20
46
|
*
|
|
@@ -51,36 +77,20 @@ export interface ChatRuntime extends UnisphereRuntimeBaseType<ChatRuntimeSetting
|
|
|
51
77
|
* };
|
|
52
78
|
* ```
|
|
53
79
|
*/
|
|
54
|
-
export interface ChatRuntimeSettings {
|
|
55
|
-
/** Kaltura session token for authentication */
|
|
56
|
-
ks?: string;
|
|
80
|
+
export interface ChatRuntimeSettings extends BaseChatRuntimeSettings {
|
|
57
81
|
/** Optional initial question to display when chat starts */
|
|
58
82
|
initialQuestion?: string;
|
|
59
|
-
/** Settings schema version, defaults to '1' */
|
|
60
|
-
schemaVersion?: '1';
|
|
61
83
|
/** Genie server URL for API requests */
|
|
62
84
|
genieServerUrl?: string;
|
|
63
85
|
/** Agentic server URL for appInit */
|
|
64
86
|
agenticServerUrl?: string;
|
|
65
|
-
/** Kaltura partner ID */
|
|
66
|
-
partnerId?: string;
|
|
67
|
-
/** Context for the chat session */
|
|
68
|
-
context?: ChatContext;
|
|
69
|
-
/** Enable agent mode for advanced AI features */
|
|
70
|
-
agentMode?: boolean;
|
|
71
87
|
/** Callback function to generate source URLs with entry ID and optional start time */
|
|
72
88
|
getSourceUrl?: GlobalChatSettings['getSourceUrl'];
|
|
73
|
-
/** Configuration for conversation sharing functionality */
|
|
74
|
-
shareUrl?: GlobalChatSettings['shareUrl'];
|
|
75
89
|
/** @deprecated Use visual settings or customization settings instead */
|
|
76
90
|
branding?: {
|
|
77
91
|
/** Display Kaltura logo in the chat interface */
|
|
78
92
|
kalturaLogo?: boolean;
|
|
79
93
|
};
|
|
80
|
-
/** External service integrations (Kaltura player, avatar) */
|
|
81
|
-
integrations?: GlobalChatSettings['integrations'];
|
|
82
|
-
/** @deprecated Use customization.avatar.stage instead */
|
|
83
|
-
avatarContainerMode?: 'dialog' | 'contained';
|
|
84
94
|
/** UI customization options */
|
|
85
95
|
customization?: {
|
|
86
96
|
/** Breadcrumb navigation configuration */
|
|
@@ -94,5 +104,8 @@ export interface ChatRuntimeSettings {
|
|
|
94
104
|
};
|
|
95
105
|
};
|
|
96
106
|
};
|
|
107
|
+
initialThread?: InitialThread;
|
|
97
108
|
}
|
|
109
|
+
export declare const agentModeSchema: ValidatorSchema;
|
|
110
|
+
export declare const avatarContainerModeSchema: ValidatorSchema;
|
|
98
111
|
export declare const chatRuntimeSettingsSchema: ValidatorSchema;
|
|
@@ -165,3 +165,4 @@ export declare const chatContextSchema: ValidatorSchema;
|
|
|
165
165
|
export declare const integrationsSchema: ValidatorSchema;
|
|
166
166
|
export declare const shareUrlSchema: ValidatorSchema;
|
|
167
167
|
export declare const getSourceUrlSchema: ValidatorSchema;
|
|
168
|
+
export declare const schemaVersionSchema: ValidatorSchema;
|
|
@@ -2,6 +2,39 @@ import { ValidatorSchema } from '@unisphere/core';
|
|
|
2
2
|
import { ChatCustomization } from '../chat-customizations-types';
|
|
3
3
|
import { ChatContext } from './shared-settings';
|
|
4
4
|
import { AnswerTypeEnum } from '../types';
|
|
5
|
+
interface BaseVisualSettings {
|
|
6
|
+
/** Settings schema version */
|
|
7
|
+
schemaVersion?: '1';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Visual settings with scroll and customization support.
|
|
11
|
+
* Base for page, popup, and contained layouts.
|
|
12
|
+
*/
|
|
13
|
+
interface ScrollableVisualSettings extends BaseVisualSettings {
|
|
14
|
+
/** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
|
|
15
|
+
scroll?: 'body' | 'container' | 'modal';
|
|
16
|
+
/** Custom UI styling and behavior options */
|
|
17
|
+
customization?: ChatCustomization;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Visual settings with mode and context support.
|
|
21
|
+
* Base for floater, floaterCTA, and contained layouts.
|
|
22
|
+
*/
|
|
23
|
+
interface ModeContextVisualSettings extends BaseVisualSettings {
|
|
24
|
+
/** Chat mode: 'chat' for chat-only, 'everywhere' for all pages */
|
|
25
|
+
mode?: 'chat' | 'everywhere';
|
|
26
|
+
/** Context for the chat session */
|
|
27
|
+
context?: ChatContext;
|
|
28
|
+
/** Custom UI styling and behavior options */
|
|
29
|
+
customization?: ChatCustomization;
|
|
30
|
+
}
|
|
31
|
+
/** Initial question shape shared between popup and page visual settings. */
|
|
32
|
+
type InitialQuestion = {
|
|
33
|
+
/** Question text */
|
|
34
|
+
question: string;
|
|
35
|
+
/** Preferred answer type */
|
|
36
|
+
answerType?: AnswerTypeEnum;
|
|
37
|
+
};
|
|
5
38
|
/**
|
|
6
39
|
* Visual settings for page-embedded chat experiences.
|
|
7
40
|
*
|
|
@@ -15,13 +48,7 @@ import { AnswerTypeEnum } from '../types';
|
|
|
15
48
|
* };
|
|
16
49
|
* ```
|
|
17
50
|
*/
|
|
18
|
-
export interface PageVisualSettings {
|
|
19
|
-
/** Settings schema version */
|
|
20
|
-
schemaVersion?: '1';
|
|
21
|
-
/** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
|
|
22
|
-
scroll?: 'body' | 'container' | 'modal';
|
|
23
|
-
/** Custom UI styling and behavior options */
|
|
24
|
-
customization?: ChatCustomization;
|
|
51
|
+
export interface PageVisualSettings extends ScrollableVisualSettings {
|
|
25
52
|
/** Context for the chat session — host-provided, not user-controllable */
|
|
26
53
|
context?: Pick<ChatContext, 'type' | 'id'>;
|
|
27
54
|
}
|
|
@@ -46,9 +73,7 @@ export interface PageVisualSettings {
|
|
|
46
73
|
* };
|
|
47
74
|
* ```
|
|
48
75
|
*/
|
|
49
|
-
export interface BannerVisualSettings {
|
|
50
|
-
/** Settings schema version */
|
|
51
|
-
schemaVersion?: '1';
|
|
76
|
+
export interface BannerVisualSettings extends BaseVisualSettings {
|
|
52
77
|
/** Banner title text */
|
|
53
78
|
title?: string;
|
|
54
79
|
/** Background image configuration */
|
|
@@ -82,62 +107,32 @@ export interface BannerVisualSettings {
|
|
|
82
107
|
* };
|
|
83
108
|
* ```
|
|
84
109
|
*/
|
|
85
|
-
export interface PopupVisualSettings {
|
|
86
|
-
/** Settings schema version */
|
|
87
|
-
schemaVersion?: '1';
|
|
88
|
-
/** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
|
|
89
|
-
scroll?: 'body' | 'container' | 'modal';
|
|
90
|
-
/** Custom UI styling and behavior options */
|
|
91
|
-
customization?: ChatCustomization;
|
|
110
|
+
export interface PopupVisualSettings extends ScrollableVisualSettings {
|
|
92
111
|
/** Optional question to ask automatically when popup opens */
|
|
93
|
-
initialQuestion?:
|
|
94
|
-
/** Question text */
|
|
95
|
-
question: string;
|
|
96
|
-
/** Preferred answer type */
|
|
97
|
-
answerType?: AnswerTypeEnum;
|
|
98
|
-
};
|
|
112
|
+
initialQuestion?: InitialQuestion;
|
|
99
113
|
}
|
|
100
|
-
export interface ContainedVisualSettings {
|
|
101
|
-
/** Settings schema version */
|
|
102
|
-
schemaVersion?: '1';
|
|
103
|
-
/** Contained type */
|
|
104
|
-
mode?: 'chat' | 'everywhere';
|
|
105
|
-
/** Custom UI styling and behavior options */
|
|
106
|
-
customization?: ChatCustomization;
|
|
114
|
+
export interface ContainedVisualSettings extends ScrollableVisualSettings, ModeContextVisualSettings {
|
|
107
115
|
/** Callback invoked when the widget requests to be closed */
|
|
108
116
|
onRequestClose?: () => void;
|
|
109
117
|
/** Callback invoked when the user clicks the expand button */
|
|
110
118
|
onExpand?: () => void;
|
|
111
119
|
/** Whether the host has expanded the widget; drives the expand/collapse icon in the header */
|
|
112
120
|
isExpanded?: boolean;
|
|
113
|
-
/** Scroll container mode: 'body' for page scroll, 'container' for internal scroll, 'modal' for modal dialog */
|
|
114
|
-
scroll?: 'body' | 'container' | 'modal';
|
|
115
|
-
/** Context for the chat session */
|
|
116
|
-
context?: ChatContext;
|
|
117
121
|
/** Type of close button to display in the header */
|
|
118
122
|
closeButtonType?: 'none' | 'drawer' | 'close';
|
|
119
123
|
}
|
|
120
|
-
export
|
|
121
|
-
schemaVersion?: '1';
|
|
124
|
+
export interface FloaterCTAVisualSettings extends ModeContextVisualSettings {
|
|
122
125
|
position?: 'bottom-right' | 'bottom-center' | 'bottom-left';
|
|
123
|
-
mode?: 'chat' | 'everywhere';
|
|
124
126
|
openByDefault?: boolean;
|
|
125
|
-
context?: ChatContext;
|
|
126
|
-
customization?: ChatCustomization;
|
|
127
|
-
} & {
|
|
128
127
|
type?: 'button';
|
|
129
128
|
text?: string;
|
|
130
129
|
showIcon?: boolean;
|
|
131
|
-
};
|
|
132
|
-
export interface FloaterVisualSettings {
|
|
133
|
-
schemaVersion?: '1';
|
|
134
|
-
mode?: 'chat' | 'everywhere';
|
|
135
|
-
context?: ChatContext;
|
|
136
|
-
customization?: ChatCustomization;
|
|
137
130
|
}
|
|
131
|
+
export type FloaterVisualSettings = ModeContextVisualSettings;
|
|
138
132
|
export declare const floaterVisualSettingsSchema: ValidatorSchema;
|
|
139
133
|
export declare const floaterCTAVisualSettingsSchema: ValidatorSchema;
|
|
140
134
|
export declare const containedVisualSettingsSchema: ValidatorSchema;
|
|
141
135
|
export declare const pageVisualSettingsSchema: ValidatorSchema;
|
|
142
136
|
export declare const bannerVisualSettingsSchema: ValidatorSchema;
|
|
143
137
|
export declare const popupVisualSettingsSchema: ValidatorSchema;
|
|
138
|
+
export {};
|