@xpert-ai/chatkit-web-component 0.3.6 → 0.4.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.
package/dist/xpert-chatkit.js
CHANGED
|
@@ -47,7 +47,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
47
47
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
48
48
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
49
49
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
50
|
-
var _a, _b, _setTrainingOptOut_dec, _hideHistory_dec, _showHistory_dec, _sendCustomAction_dec, _shareThread_dec, _setThreadId_dec, _setComposerValue_dec, _sendUserMessage_dec, _fetchUpdates_dec, _focusComposer_dec, _c, _opts, _frameUrl, _frame, _wrapper, _launcherCloseButton, _launcherOpen, _chatMinimizedToPet, _framePetOptionsOverride, _petClosedByContextMenu, _shadow, _petOverlay, _resolveLoaded, _loaded, _messenger, _ChatKitElementBase_instances, emitAndThrow_fn, setOptionsDataAttributes_fn, getDisplayMode_fn, getConfiguredPetOptions_fn, mergeConfiguredPetPositionDefaults_fn, getOverlayPetOptions_fn, resolvePetAssetUrl_fn, resolveOverlayPetOptions_fn, getFrameOptions_fn, setLauncherOpen_fn, setChatMinimizedToPet_fn, syncPetOverlayOptions_fn, handlePetActivate_fn, handlePetClose_fn, handlePetReply_fn, handlePetThreadSummaryActivate_fn, _handleLauncherClose, getFrameUrl_fn, setFrameUrl_fn, consumeFrameUrl_fn, _handleFrameLoad, _initialized, maybeInit_fn, _init;
|
|
50
|
+
var _a, _b, _setTrainingOptOut_dec, _hideHistory_dec, _showHistory_dec, _sendCustomAction_dec, _shareThread_dec, _setThreadId_dec, _setRuntimeCapabilities_dec, _setComposerValue_dec, _sendUserMessage_dec, _fetchUpdates_dec, _focusComposer_dec, _c, _opts, _frameUrl, _frame, _wrapper, _launcherCloseButton, _launcherOpen, _chatMinimizedToPet, _framePetOptionsOverride, _petClosedByContextMenu, _shadow, _petOverlay, _resolveLoaded, _loaded, _messenger, _ChatKitElementBase_instances, emitAndThrow_fn, setOptionsDataAttributes_fn, getDisplayMode_fn, getConfiguredPetOptions_fn, mergeConfiguredPetPositionDefaults_fn, getOverlayPetOptions_fn, resolvePetAssetUrl_fn, resolveOverlayPetOptions_fn, getFrameOptions_fn, setLauncherOpen_fn, setChatMinimizedToPet_fn, syncPetOverlayOptions_fn, handlePetActivate_fn, handlePetClose_fn, handlePetReply_fn, handlePetThreadSummaryActivate_fn, _handleLauncherClose, getFrameUrl_fn, setFrameUrl_fn, consumeFrameUrl_fn, _handleFrameLoad, _initialized, maybeInit_fn, _init;
|
|
51
51
|
class EventEmitter {
|
|
52
52
|
constructor() {
|
|
53
53
|
__publicField(this, "callbacks", /* @__PURE__ */ new Map());
|
|
@@ -696,6 +696,7 @@ const BASE_CAPABILITY_ALLOWLIST = [
|
|
|
696
696
|
"command.setOptions",
|
|
697
697
|
"command.sendUserMessage",
|
|
698
698
|
"command.setComposerValue",
|
|
699
|
+
"command.setRuntimeCapabilities",
|
|
699
700
|
"command.setThreadId",
|
|
700
701
|
"command.focusComposer",
|
|
701
702
|
"command.fetchUpdates",
|
|
@@ -2577,7 +2578,7 @@ function requireCommandCapability(value, context) {
|
|
|
2577
2578
|
return value.apply(this, args);
|
|
2578
2579
|
};
|
|
2579
2580
|
}
|
|
2580
|
-
class ChatKitElementBase extends (_c = HTMLElement, _focusComposer_dec = [requireCommandCapability], _fetchUpdates_dec = [requireCommandCapability], _sendUserMessage_dec = [requireCommandCapability], _setComposerValue_dec = [requireCommandCapability], _setThreadId_dec = [requireCommandCapability], _shareThread_dec = [requireCommandCapability], _sendCustomAction_dec = [requireCommandCapability], _showHistory_dec = [requireCommandCapability], _hideHistory_dec = [requireCommandCapability], _setTrainingOptOut_dec = [requireCommandCapability], _c) {
|
|
2581
|
+
class ChatKitElementBase extends (_c = HTMLElement, _focusComposer_dec = [requireCommandCapability], _fetchUpdates_dec = [requireCommandCapability], _sendUserMessage_dec = [requireCommandCapability], _setComposerValue_dec = [requireCommandCapability], _setRuntimeCapabilities_dec = [requireCommandCapability], _setThreadId_dec = [requireCommandCapability], _shareThread_dec = [requireCommandCapability], _sendCustomAction_dec = [requireCommandCapability], _showHistory_dec = [requireCommandCapability], _hideHistory_dec = [requireCommandCapability], _setTrainingOptOut_dec = [requireCommandCapability], _c) {
|
|
2581
2582
|
constructor({ profile }) {
|
|
2582
2583
|
super();
|
|
2583
2584
|
__runInitializers(_init, 5, this);
|
|
@@ -2649,6 +2650,28 @@ class ChatKitElementBase extends (_c = HTMLElement, _focusComposer_dec = [requir
|
|
|
2649
2650
|
}
|
|
2650
2651
|
return onClientTool({ name, params, id, tool_call_id });
|
|
2651
2652
|
},
|
|
2653
|
+
onWorkbenchClientCommand: async ({
|
|
2654
|
+
commandKey,
|
|
2655
|
+
payload,
|
|
2656
|
+
hostType,
|
|
2657
|
+
hostId,
|
|
2658
|
+
viewKey
|
|
2659
|
+
}) => {
|
|
2660
|
+
var _a2, _b2;
|
|
2661
|
+
const onClientCommand = (_b2 = (_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.workbench) == null ? void 0 : _b2.onClientCommand;
|
|
2662
|
+
if (!onClientCommand) {
|
|
2663
|
+
__privateMethod(this, _ChatKitElementBase_instances, emitAndThrow_fn).call(this, new IntegrationError2(
|
|
2664
|
+
`No handler for workbench client command "${commandKey}". Add workbench.onClientCommand to your ChatKit options.`
|
|
2665
|
+
));
|
|
2666
|
+
}
|
|
2667
|
+
return onClientCommand({
|
|
2668
|
+
commandKey,
|
|
2669
|
+
payload,
|
|
2670
|
+
hostType,
|
|
2671
|
+
hostId,
|
|
2672
|
+
viewKey
|
|
2673
|
+
});
|
|
2674
|
+
},
|
|
2652
2675
|
onWidgetAction: async ({
|
|
2653
2676
|
action,
|
|
2654
2677
|
widgetItem
|
|
@@ -3019,6 +3042,11 @@ class ChatKitElementBase extends (_c = HTMLElement, _focusComposer_dec = [requir
|
|
|
3019
3042
|
await __privateGet(this, _loaded);
|
|
3020
3043
|
await ((_a2 = __privateGet(this, _messenger)) == null ? void 0 : _a2.commands.setComposerValue(params));
|
|
3021
3044
|
}
|
|
3045
|
+
async setRuntimeCapabilities(selection) {
|
|
3046
|
+
var _a2;
|
|
3047
|
+
await __privateGet(this, _loaded);
|
|
3048
|
+
await ((_a2 = __privateGet(this, _messenger)) == null ? void 0 : _a2.commands.setRuntimeCapabilities(selection));
|
|
3049
|
+
}
|
|
3022
3050
|
async setThreadId(threadId) {
|
|
3023
3051
|
var _a2;
|
|
3024
3052
|
await __privateGet(this, _loaded);
|
|
@@ -3286,6 +3314,7 @@ __decorateElement(_init, 1, "focusComposer", _focusComposer_dec, ChatKitElementB
|
|
|
3286
3314
|
__decorateElement(_init, 1, "fetchUpdates", _fetchUpdates_dec, ChatKitElementBase);
|
|
3287
3315
|
__decorateElement(_init, 1, "sendUserMessage", _sendUserMessage_dec, ChatKitElementBase);
|
|
3288
3316
|
__decorateElement(_init, 1, "setComposerValue", _setComposerValue_dec, ChatKitElementBase);
|
|
3317
|
+
__decorateElement(_init, 1, "setRuntimeCapabilities", _setRuntimeCapabilities_dec, ChatKitElementBase);
|
|
3289
3318
|
__decorateElement(_init, 1, "setThreadId", _setThreadId_dec, ChatKitElementBase);
|
|
3290
3319
|
__decorateElement(_init, 1, "shareThread", _shareThread_dec, ChatKitElementBase);
|
|
3291
3320
|
__decorateElement(_init, 1, "sendCustomAction", _sendCustomAction_dec, ChatKitElementBase);
|