@xpert-ai/chatkit-ui5 0.3.1 → 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/chatkit.cjs +44 -2
- package/dist/chatkit.cjs.map +1 -1
- package/dist/chatkit.ui5.js +44 -2
- package/dist/chatkit.ui5.js.map +1 -1
- package/dist/index.js +44 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/chatkit.ui5.js
CHANGED
|
@@ -51,7 +51,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
51
51
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
52
52
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
53
53
|
|
|
54
|
-
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;
|
|
54
|
+
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;
|
|
55
55
|
class EventEmitter {
|
|
56
56
|
constructor() {
|
|
57
57
|
__publicField(this, "callbacks", /* @__PURE__ */ new Map());
|
|
@@ -700,6 +700,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
700
700
|
"command.setOptions",
|
|
701
701
|
"command.sendUserMessage",
|
|
702
702
|
"command.setComposerValue",
|
|
703
|
+
"command.setRuntimeCapabilities",
|
|
703
704
|
"command.setThreadId",
|
|
704
705
|
"command.focusComposer",
|
|
705
706
|
"command.fetchUpdates",
|
|
@@ -2335,7 +2336,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2335
2336
|
return value.apply(this, args);
|
|
2336
2337
|
};
|
|
2337
2338
|
}
|
|
2338
|
-
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) {
|
|
2339
|
+
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) {
|
|
2339
2340
|
constructor({ profile }) {
|
|
2340
2341
|
super();
|
|
2341
2342
|
__runInitializers(_init, 5, this);
|
|
@@ -2407,6 +2408,38 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2407
2408
|
}
|
|
2408
2409
|
return onClientTool({ name, params, id, tool_call_id });
|
|
2409
2410
|
},
|
|
2411
|
+
onToolOutputAttachmentPreview: async (request) => {
|
|
2412
|
+
var _a2, _b2;
|
|
2413
|
+
const onRequestPreview = (_b2 = (_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.toolOutputAttachments) == null ? void 0 : _b2.onRequestPreview;
|
|
2414
|
+
if (!onRequestPreview) {
|
|
2415
|
+
__privateMethod(this, _ChatKitElementBase_instances, emitAndThrow_fn).call(this, new IntegrationError(
|
|
2416
|
+
"No handler for tool-output attachment previews. Add toolOutputAttachments.onRequestPreview to your ChatKit options."
|
|
2417
|
+
));
|
|
2418
|
+
}
|
|
2419
|
+
return onRequestPreview(request);
|
|
2420
|
+
},
|
|
2421
|
+
onWorkbenchClientCommand: async ({
|
|
2422
|
+
commandKey,
|
|
2423
|
+
payload,
|
|
2424
|
+
hostType,
|
|
2425
|
+
hostId,
|
|
2426
|
+
viewKey
|
|
2427
|
+
}) => {
|
|
2428
|
+
var _a2, _b2;
|
|
2429
|
+
const onClientCommand = (_b2 = (_a2 = __privateGet(this, _opts)) == null ? void 0 : _a2.workbench) == null ? void 0 : _b2.onClientCommand;
|
|
2430
|
+
if (!onClientCommand) {
|
|
2431
|
+
__privateMethod(this, _ChatKitElementBase_instances, emitAndThrow_fn).call(this, new IntegrationError(
|
|
2432
|
+
`No handler for workbench client command "${commandKey}". Add workbench.onClientCommand to your ChatKit options.`
|
|
2433
|
+
));
|
|
2434
|
+
}
|
|
2435
|
+
return onClientCommand({
|
|
2436
|
+
commandKey,
|
|
2437
|
+
payload,
|
|
2438
|
+
hostType,
|
|
2439
|
+
hostId,
|
|
2440
|
+
viewKey
|
|
2441
|
+
});
|
|
2442
|
+
},
|
|
2410
2443
|
onWidgetAction: async ({
|
|
2411
2444
|
action,
|
|
2412
2445
|
widgetItem
|
|
@@ -2777,6 +2810,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2777
2810
|
await __privateGet(this, _loaded);
|
|
2778
2811
|
await ((_a2 = __privateGet(this, _messenger)) == null ? void 0 : _a2.commands.setComposerValue(params));
|
|
2779
2812
|
}
|
|
2813
|
+
async setRuntimeCapabilities(selection) {
|
|
2814
|
+
var _a2;
|
|
2815
|
+
await __privateGet(this, _loaded);
|
|
2816
|
+
await ((_a2 = __privateGet(this, _messenger)) == null ? void 0 : _a2.commands.setRuntimeCapabilities(selection));
|
|
2817
|
+
}
|
|
2780
2818
|
async setThreadId(threadId) {
|
|
2781
2819
|
var _a2;
|
|
2782
2820
|
await __privateGet(this, _loaded);
|
|
@@ -3044,6 +3082,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3044
3082
|
__decorateElement(_init, 1, "fetchUpdates", _fetchUpdates_dec, ChatKitElementBase);
|
|
3045
3083
|
__decorateElement(_init, 1, "sendUserMessage", _sendUserMessage_dec, ChatKitElementBase);
|
|
3046
3084
|
__decorateElement(_init, 1, "setComposerValue", _setComposerValue_dec, ChatKitElementBase);
|
|
3085
|
+
__decorateElement(_init, 1, "setRuntimeCapabilities", _setRuntimeCapabilities_dec, ChatKitElementBase);
|
|
3047
3086
|
__decorateElement(_init, 1, "setThreadId", _setThreadId_dec, ChatKitElementBase);
|
|
3048
3087
|
__decorateElement(_init, 1, "shareThread", _shareThread_dec, ChatKitElementBase);
|
|
3049
3088
|
__decorateElement(_init, 1, "sendCustomAction", _sendCustomAction_dec, ChatKitElementBase);
|
|
@@ -3268,6 +3307,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3268
3307
|
setComposerValue(...args) {
|
|
3269
3308
|
return this._callMethod("setComposerValue", ...args);
|
|
3270
3309
|
},
|
|
3310
|
+
setRuntimeCapabilities(...args) {
|
|
3311
|
+
return this._callMethod("setRuntimeCapabilities", ...args);
|
|
3312
|
+
},
|
|
3271
3313
|
fetchUpdates(...args) {
|
|
3272
3314
|
return this._callMethod("fetchUpdates", ...args);
|
|
3273
3315
|
},
|