bstp-agent-widget 0.2.119 → 0.2.121
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/angular.cjs +2 -2
- package/dist/angular.mjs +137 -136
- package/dist/element.cjs +2 -2
- package/dist/element.mjs +137 -136
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +144 -140
- package/dist/shadow.cjs +2 -2
- package/dist/shadow.mjs +137 -136
- package/dist/types/internal/hooks/useRemoteAssistants.d.mts +6 -0
- package/dist/types/internal/hooks/useRemoteAssistants.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46220,30 +46220,26 @@ function VM({ onClick: e, zIndex: t, position: n, label: r }) {
|
|
|
46220
46220
|
return /* @__PURE__ */ (0, U.jsx)("div", {
|
|
46221
46221
|
className: BM.root,
|
|
46222
46222
|
style: d,
|
|
46223
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
46224
|
-
|
|
46225
|
-
|
|
46226
|
-
|
|
46227
|
-
|
|
46228
|
-
|
|
46229
|
-
|
|
46230
|
-
|
|
46231
|
-
|
|
46232
|
-
|
|
46233
|
-
|
|
46234
|
-
|
|
46235
|
-
|
|
46236
|
-
|
|
46237
|
-
|
|
46238
|
-
|
|
46239
|
-
|
|
46240
|
-
|
|
46241
|
-
|
|
46242
|
-
|
|
46243
|
-
"aria-label": `Open ${r ?? "agent widget"}`,
|
|
46244
|
-
title: r ?? "Assistant",
|
|
46245
|
-
children: r ?? "Assistant"
|
|
46246
|
-
})
|
|
46223
|
+
children: /* @__PURE__ */ (0, U.jsx)(jm, {
|
|
46224
|
+
onClick: e,
|
|
46225
|
+
onPointerDown: a,
|
|
46226
|
+
style: f,
|
|
46227
|
+
classNames: {
|
|
46228
|
+
root: BM.button,
|
|
46229
|
+
inner: BM.buttonInner,
|
|
46230
|
+
section: BM.iconSection,
|
|
46231
|
+
label: BM.label
|
|
46232
|
+
},
|
|
46233
|
+
leftSection: /* @__PURE__ */ (0, U.jsx)(zM, {
|
|
46234
|
+
width: s,
|
|
46235
|
+
height: s
|
|
46236
|
+
}),
|
|
46237
|
+
radius: 20,
|
|
46238
|
+
variant: "filled",
|
|
46239
|
+
color: "accent",
|
|
46240
|
+
"aria-label": `Open ${r ?? "agent widget"}`,
|
|
46241
|
+
title: `Open ${r ?? "agent widget"}`,
|
|
46242
|
+
children: r ?? "Assistant"
|
|
46247
46243
|
})
|
|
46248
46244
|
});
|
|
46249
46245
|
}
|
|
@@ -54985,17 +54981,33 @@ function fU({ visible: e, onClose: t, messages: n, composerText: r, onComposerTe
|
|
|
54985
54981
|
}) : null;
|
|
54986
54982
|
}
|
|
54987
54983
|
//#endregion
|
|
54984
|
+
//#region package/src/internal/types/models/widget-config.ts
|
|
54985
|
+
var pU = /* @__PURE__ */ function(e) {
|
|
54986
|
+
return e.SINGLE = "SINGLE", e.MULTI = "MULTI", e;
|
|
54987
|
+
}({});
|
|
54988
|
+
//#endregion
|
|
54989
|
+
//#region package/src/internal/hooks/useResolvedAgentType.ts
|
|
54990
|
+
function mU(e) {
|
|
54991
|
+
return (0, H.useMemo)(() => {
|
|
54992
|
+
let t = e === "MULTI" ? "MULTI" : "SINGLE";
|
|
54993
|
+
return {
|
|
54994
|
+
agentType: t,
|
|
54995
|
+
isMultiAgent: t === "MULTI"
|
|
54996
|
+
};
|
|
54997
|
+
}, [e]);
|
|
54998
|
+
}
|
|
54999
|
+
//#endregion
|
|
54988
55000
|
//#region package/src/internal/mappers/genai-agent-catalog.mapper.ts
|
|
54989
|
-
function
|
|
55001
|
+
function hU(e) {
|
|
54990
55002
|
return typeof e == "object" && !!e;
|
|
54991
55003
|
}
|
|
54992
|
-
function
|
|
55004
|
+
function gU(e) {
|
|
54993
55005
|
let t = Number(e);
|
|
54994
55006
|
return Number.isFinite(t) && t > 0 ? t : null;
|
|
54995
55007
|
}
|
|
54996
|
-
function
|
|
54997
|
-
if (Array.isArray(e)) return e.filter(
|
|
54998
|
-
if (!
|
|
55008
|
+
function _U(e) {
|
|
55009
|
+
if (Array.isArray(e)) return e.filter(hU);
|
|
55010
|
+
if (!hU(e)) return [];
|
|
54999
55011
|
for (let t of [
|
|
55000
55012
|
"data",
|
|
55001
55013
|
"items",
|
|
@@ -55006,20 +55018,20 @@ function hU(e) {
|
|
|
55006
55018
|
"response"
|
|
55007
55019
|
]) {
|
|
55008
55020
|
let n = e[t];
|
|
55009
|
-
if (Array.isArray(n)) return n.filter(
|
|
55010
|
-
if (
|
|
55011
|
-
let e =
|
|
55021
|
+
if (Array.isArray(n)) return n.filter(hU);
|
|
55022
|
+
if (hU(n)) {
|
|
55023
|
+
let e = _U(n);
|
|
55012
55024
|
if (e.length > 0) return e;
|
|
55013
55025
|
}
|
|
55014
55026
|
}
|
|
55015
55027
|
for (let t of Object.values(e)) if (Array.isArray(t)) {
|
|
55016
|
-
let e = t.filter(
|
|
55028
|
+
let e = t.filter(hU);
|
|
55017
55029
|
if (e.length > 0) return e;
|
|
55018
55030
|
}
|
|
55019
55031
|
return [];
|
|
55020
55032
|
}
|
|
55021
|
-
function
|
|
55022
|
-
let t =
|
|
55033
|
+
function vU(e) {
|
|
55034
|
+
let t = gU(e.assistantId ?? e.assistant_id ?? e.id ?? e.agentId ?? e.agent_id ?? e.appId ?? e.app_id);
|
|
55023
55035
|
if (!t) return null;
|
|
55024
55036
|
let n = e.description ?? e.appDescription ?? e.app_description ?? e.label ?? e.name ?? e.assistantName ?? e.assistant_name ?? e.agentName ?? e.agent_name ?? e.title, r = typeof n == "string" && n.trim().length > 0 ? n.trim() : `Agent ${t}`, i = e.assistantKey ?? e.assistant_key ?? e.key ?? e.agentKey ?? e.agent_key ?? e.code, a = typeof i == "string" && i.trim().length > 0 ? i.trim() : r.toLowerCase().replace(/\s+/g, "-"), o = e.initialMessage ?? e.initial_message ?? e.welcomeMessage ?? e.welcome_message, s = typeof o == "string" && o.trim().length > 0 ? o.trim() : void 0;
|
|
55025
55037
|
return {
|
|
@@ -55029,8 +55041,8 @@ function gU(e) {
|
|
|
55029
55041
|
...s ? { initialMessage: s } : {}
|
|
55030
55042
|
};
|
|
55031
55043
|
}
|
|
55032
|
-
function
|
|
55033
|
-
let t =
|
|
55044
|
+
function yU(e) {
|
|
55045
|
+
let t = gU(e.appId ?? e.app_id ?? e.id ?? e.assistantId ?? e.assistant_id);
|
|
55034
55046
|
if (!t) return null;
|
|
55035
55047
|
let n = e.description ?? e.name ?? e.label ?? e.title ?? e.appName ?? e.app_name, r = typeof n == "string" && n.trim().length > 0 ? n.trim() : `Agent ${t}`, i = e.assistantKey ?? e.assistant_key ?? e.key ?? e.code, a = typeof i == "string" && i.trim().length > 0 ? i.trim() : r.toLowerCase().replace(/\s+/g, "-"), o = e.initialMessage ?? e.initial_message ?? e.welcomeMessage ?? e.welcome_message, s = typeof o == "string" && o.trim().length > 0 ? o.trim() : void 0;
|
|
55036
55048
|
return {
|
|
@@ -55040,25 +55052,25 @@ function _U(e) {
|
|
|
55040
55052
|
...s ? { initialMessage: s } : {}
|
|
55041
55053
|
};
|
|
55042
55054
|
}
|
|
55043
|
-
function
|
|
55055
|
+
function bU(e) {
|
|
55044
55056
|
if (Array.isArray(e.apps) && e.apps.length > 0) {
|
|
55045
|
-
let t = e.apps.map((e) =>
|
|
55057
|
+
let t = e.apps.map((e) => yU(e)).filter((e) => e !== null);
|
|
55046
55058
|
if (t.length > 0) return t;
|
|
55047
55059
|
}
|
|
55048
|
-
let t =
|
|
55060
|
+
let t = vU(e);
|
|
55049
55061
|
return t ? [t] : [];
|
|
55050
55062
|
}
|
|
55051
|
-
function
|
|
55052
|
-
return
|
|
55063
|
+
function xU(e) {
|
|
55064
|
+
return _U(e).flatMap((e) => bU(e));
|
|
55053
55065
|
}
|
|
55054
55066
|
//#endregion
|
|
55055
55067
|
//#region package/src/internal/stores/agent-chat/agent-chat.store.ts
|
|
55056
|
-
var
|
|
55068
|
+
var SU = { runtimeInfo: {
|
|
55057
55069
|
customerId: null,
|
|
55058
55070
|
hasCustomerToken: !1,
|
|
55059
55071
|
hasGenaiToken: !1
|
|
55060
|
-
} },
|
|
55061
|
-
...
|
|
55072
|
+
} }, CU = fE((e) => ({
|
|
55073
|
+
...SU,
|
|
55062
55074
|
setRuntimeInfo: (t) => e({ runtimeInfo: t }),
|
|
55063
55075
|
updateCustomerId: (t) => e((e) => ({ runtimeInfo: {
|
|
55064
55076
|
...e.runtimeInfo,
|
|
@@ -55072,11 +55084,11 @@ var bU = { runtimeInfo: {
|
|
|
55072
55084
|
...e.runtimeInfo,
|
|
55073
55085
|
hasGenaiToken: t
|
|
55074
55086
|
} })),
|
|
55075
|
-
resetRuntimeInfo: () => e({ runtimeInfo:
|
|
55087
|
+
resetRuntimeInfo: () => e({ runtimeInfo: SU.runtimeInfo })
|
|
55076
55088
|
}));
|
|
55077
55089
|
//#endregion
|
|
55078
55090
|
//#region package/src/internal/api/genai.service.ts
|
|
55079
|
-
async function
|
|
55091
|
+
async function wU(e, t) {
|
|
55080
55092
|
try {
|
|
55081
55093
|
let n = new URLSearchParams();
|
|
55082
55094
|
n.set("username", atob(e)), n.set("password", atob(t));
|
|
@@ -55089,7 +55101,7 @@ async function SU(e, t) {
|
|
|
55089
55101
|
throw e;
|
|
55090
55102
|
}
|
|
55091
55103
|
}
|
|
55092
|
-
async function
|
|
55104
|
+
async function TU(e, t) {
|
|
55093
55105
|
try {
|
|
55094
55106
|
let n = await EE.post("/tenants/switch", { tenant_id: e }, {
|
|
55095
55107
|
anonymous: !0,
|
|
@@ -55100,21 +55112,21 @@ async function CU(e, t) {
|
|
|
55100
55112
|
throw e;
|
|
55101
55113
|
}
|
|
55102
55114
|
}
|
|
55103
|
-
async function
|
|
55115
|
+
async function EU(e) {
|
|
55104
55116
|
try {
|
|
55105
55117
|
return (await EE.post("/agent-message", e, { anonymous: !0 })).data;
|
|
55106
55118
|
} catch (e) {
|
|
55107
55119
|
throw e;
|
|
55108
55120
|
}
|
|
55109
55121
|
}
|
|
55110
|
-
async function
|
|
55122
|
+
async function DU(e) {
|
|
55111
55123
|
try {
|
|
55112
55124
|
return (await EE.post("/agentic-app-chat", e, { anonymous: !0 })).data;
|
|
55113
55125
|
} catch (e) {
|
|
55114
55126
|
throw e;
|
|
55115
55127
|
}
|
|
55116
55128
|
}
|
|
55117
|
-
async function
|
|
55129
|
+
async function OU(e) {
|
|
55118
55130
|
let { customerToken: t, tenantId: n, ...r } = e;
|
|
55119
55131
|
try {
|
|
55120
55132
|
return (await EE.post("/assistant", r, {
|
|
@@ -55128,7 +55140,7 @@ async function EU(e) {
|
|
|
55128
55140
|
throw e;
|
|
55129
55141
|
}
|
|
55130
55142
|
}
|
|
55131
|
-
async function
|
|
55143
|
+
async function kU(e) {
|
|
55132
55144
|
let { customerToken: t, tenantId: n, ...r } = e;
|
|
55133
55145
|
try {
|
|
55134
55146
|
return (await EE.post("/fetch-agentic-app", r, {
|
|
@@ -55142,17 +55154,17 @@ async function DU(e) {
|
|
|
55142
55154
|
throw e;
|
|
55143
55155
|
}
|
|
55144
55156
|
}
|
|
55145
|
-
var
|
|
55146
|
-
loginToGenai:
|
|
55147
|
-
switchTenant:
|
|
55148
|
-
sendAgentMessage:
|
|
55149
|
-
sendAgenticAppChat:
|
|
55150
|
-
fetchAssistants:
|
|
55151
|
-
fetchAgenticApps:
|
|
55157
|
+
var AU = {
|
|
55158
|
+
loginToGenai: wU,
|
|
55159
|
+
switchTenant: TU,
|
|
55160
|
+
sendAgentMessage: EU,
|
|
55161
|
+
sendAgenticAppChat: DU,
|
|
55162
|
+
fetchAssistants: OU,
|
|
55163
|
+
fetchAgenticApps: kU
|
|
55152
55164
|
};
|
|
55153
55165
|
//#endregion
|
|
55154
55166
|
//#region package/src/internal/queries/utils/createApiMutation.ts
|
|
55155
|
-
function
|
|
55167
|
+
function jU({ mutationKey: e, mutationFn: t, defaultOptions: n = {} }) {
|
|
55156
55168
|
return function(r) {
|
|
55157
55169
|
return tS({
|
|
55158
55170
|
...n,
|
|
@@ -55168,123 +55180,115 @@ function kU({ mutationKey: e, mutationFn: t, defaultOptions: n = {} }) {
|
|
|
55168
55180
|
}
|
|
55169
55181
|
//#endregion
|
|
55170
55182
|
//#region package/src/internal/queries/genai/useFetchAgenticAppsMutation.ts
|
|
55171
|
-
var
|
|
55183
|
+
var MU = jU({
|
|
55172
55184
|
mutationKey: ["genai", "agentic-apps"],
|
|
55173
|
-
mutationFn: async (e) =>
|
|
55174
|
-
}),
|
|
55185
|
+
mutationFn: async (e) => AU.fetchAgenticApps(e)
|
|
55186
|
+
}), NU = jU({
|
|
55175
55187
|
mutationKey: ["genai", "assistants"],
|
|
55176
|
-
mutationFn: async (e) =>
|
|
55177
|
-
})
|
|
55178
|
-
return e.SINGLE = "SINGLE", e.MULTI = "MULTI", e;
|
|
55179
|
-
}({});
|
|
55188
|
+
mutationFn: async (e) => AU.fetchAssistants(e)
|
|
55189
|
+
});
|
|
55180
55190
|
//#endregion
|
|
55181
|
-
//#region package/src/internal/hooks/
|
|
55182
|
-
function NU(e) {
|
|
55183
|
-
return e === "MULTI" ? "MULTI" : "SINGLE";
|
|
55184
|
-
}
|
|
55191
|
+
//#region package/src/internal/hooks/useRemoteAssistants.ts
|
|
55185
55192
|
function PU(e, t) {
|
|
55186
|
-
|
|
55187
|
-
let n = t.find((t) => t.assistantId === e);
|
|
55188
|
-
if (n) return n.assistantId;
|
|
55189
|
-
}
|
|
55190
|
-
return t[0]?.assistantId;
|
|
55193
|
+
return e && t.includes(e) ? e : t[0];
|
|
55191
55194
|
}
|
|
55192
|
-
function FU() {
|
|
55193
|
-
let
|
|
55195
|
+
function FU(e, t, n) {
|
|
55196
|
+
let { mutateAsync: r } = NU(), { mutateAsync: i } = MU(), { isMultiAgent: a } = mU(e), [o, s] = (0, H.useState)(null), c = (0, H.useRef)(null), l = (0, H.useRef)(null), u = _T(), d = yT(), f = d ? Number(d) : null, p = xT();
|
|
55194
55197
|
(0, H.useEffect)(() => {
|
|
55195
|
-
if (!
|
|
55196
|
-
|
|
55198
|
+
if (!n) {
|
|
55199
|
+
s(null);
|
|
55197
55200
|
return;
|
|
55198
55201
|
}
|
|
55199
|
-
if (!
|
|
55200
|
-
|
|
55202
|
+
if (!u || !f || Number.isNaN(f) || f <= 0 || !p) {
|
|
55203
|
+
s(null), c.current = null, l.current = null;
|
|
55201
55204
|
return;
|
|
55202
55205
|
}
|
|
55203
|
-
let
|
|
55204
|
-
if (
|
|
55205
|
-
|
|
55206
|
-
let
|
|
55206
|
+
let e = `${a ? "multi" : "single"}:${f}:${u}`;
|
|
55207
|
+
if (c.current === e || l.current === e) return;
|
|
55208
|
+
l.current = e;
|
|
55209
|
+
let t = !0;
|
|
55207
55210
|
return (async () => {
|
|
55208
55211
|
try {
|
|
55209
|
-
let
|
|
55212
|
+
let n = a ? await i({
|
|
55210
55213
|
page: 1,
|
|
55211
55214
|
limit: 10,
|
|
55212
|
-
customerToken:
|
|
55213
|
-
tenantId:
|
|
55214
|
-
}) : await
|
|
55215
|
+
customerToken: u,
|
|
55216
|
+
tenantId: f
|
|
55217
|
+
}) : await r({
|
|
55215
55218
|
page: 1,
|
|
55216
55219
|
limit: 20,
|
|
55217
55220
|
agent_type: "SINGLE",
|
|
55218
|
-
customerToken:
|
|
55219
|
-
tenantId:
|
|
55221
|
+
customerToken: u,
|
|
55222
|
+
tenantId: f
|
|
55220
55223
|
});
|
|
55221
|
-
if (!
|
|
55222
|
-
|
|
55224
|
+
if (!t) return;
|
|
55225
|
+
s(xU(n)), c.current = e;
|
|
55223
55226
|
} catch {
|
|
55224
|
-
|
|
55227
|
+
t && (s([]), c.current = null);
|
|
55225
55228
|
} finally {
|
|
55226
|
-
|
|
55229
|
+
l.current === e && (l.current = null);
|
|
55227
55230
|
}
|
|
55228
55231
|
})(), () => {
|
|
55229
|
-
|
|
55232
|
+
t = !1;
|
|
55230
55233
|
};
|
|
55231
55234
|
}, [
|
|
55232
|
-
e?.agentType,
|
|
55233
55235
|
n,
|
|
55236
|
+
i,
|
|
55237
|
+
r,
|
|
55238
|
+
u,
|
|
55239
|
+
f,
|
|
55240
|
+
a,
|
|
55241
|
+
p
|
|
55242
|
+
]);
|
|
55243
|
+
let m = o ?? [], h = PU(t, m.map((e) => e.assistantId));
|
|
55244
|
+
return {
|
|
55245
|
+
availableAssistants: m,
|
|
55246
|
+
selectedAssistantId: h,
|
|
55247
|
+
selectedAssistant: m.find((e) => e.assistantId === h)
|
|
55248
|
+
};
|
|
55249
|
+
}
|
|
55250
|
+
//#endregion
|
|
55251
|
+
//#region package/src/internal/hooks/useAgentConfig.ts
|
|
55252
|
+
function IU() {
|
|
55253
|
+
let e = (0, H.useContext)(kM), { agentType: t } = mU(e?.agentType), { selectedAssistantId: n, selectedAssistant: r } = FU(e?.agentType, e?.assistantId, !!e), i = (0, H.useMemo)(() => e ? {
|
|
55254
|
+
...e,
|
|
55255
|
+
assistantId: n,
|
|
55256
|
+
agentType: t,
|
|
55257
|
+
assistantLabel: r?.label,
|
|
55258
|
+
assistantInitialMessage: r?.initialMessage
|
|
55259
|
+
} : null, [
|
|
55260
|
+
e,
|
|
55234
55261
|
t,
|
|
55235
|
-
|
|
55236
|
-
|
|
55237
|
-
u
|
|
55262
|
+
r,
|
|
55263
|
+
n
|
|
55238
55264
|
]);
|
|
55239
|
-
|
|
55240
|
-
|
|
55241
|
-
let t = r ?? [], n = NU(e.agentType), i = PU(e.assistantId, t), a = t.find((e) => e.assistantId === i);
|
|
55242
|
-
return {
|
|
55243
|
-
...e,
|
|
55244
|
-
assistantId: i,
|
|
55245
|
-
agentType: n,
|
|
55246
|
-
assistantLabel: a?.label,
|
|
55247
|
-
assistantInitialMessage: a?.initialMessage
|
|
55248
|
-
};
|
|
55249
|
-
}, [e, r]);
|
|
55250
|
-
if (!d) throw Error("AgentConfigContext is missing.");
|
|
55251
|
-
return d;
|
|
55265
|
+
if (!i) throw Error("AgentConfigContext is missing.");
|
|
55266
|
+
return i;
|
|
55252
55267
|
}
|
|
55253
55268
|
//#endregion
|
|
55254
55269
|
//#region package/src/internal/hooks/useAgentRuntime.ts
|
|
55255
|
-
function
|
|
55270
|
+
function LU() {
|
|
55256
55271
|
let e = (0, H.useContext)(AM);
|
|
55257
55272
|
if (!e) throw Error("AgentRuntimeContext is missing.");
|
|
55258
55273
|
return e;
|
|
55259
55274
|
}
|
|
55260
55275
|
//#endregion
|
|
55261
55276
|
//#region package/src/internal/hooks/useAgentCustomerToken.ts
|
|
55262
|
-
function
|
|
55263
|
-
let e =
|
|
55277
|
+
function RU() {
|
|
55278
|
+
let e = LU();
|
|
55264
55279
|
return (0, H.useMemo)(() => {
|
|
55265
55280
|
let t = e?.customerToken;
|
|
55266
55281
|
return typeof t != "string" || t.trim().length === 0 ? null : t;
|
|
55267
55282
|
}, [e?.customerToken]);
|
|
55268
55283
|
}
|
|
55269
55284
|
//#endregion
|
|
55270
|
-
//#region package/src/internal/hooks/useResolvedAgentType.ts
|
|
55271
|
-
function RU(e) {
|
|
55272
|
-
return (0, H.useMemo)(() => {
|
|
55273
|
-
let t = e === "MULTI" ? "MULTI" : "SINGLE";
|
|
55274
|
-
return {
|
|
55275
|
-
agentType: t,
|
|
55276
|
-
isMultiAgent: t === "MULTI"
|
|
55277
|
-
};
|
|
55278
|
-
}, [e]);
|
|
55279
|
-
}
|
|
55280
|
-
//#endregion
|
|
55281
55285
|
//#region package/src/internal/queries/genai/useSendAgentMessageMutation.ts
|
|
55282
|
-
var zU =
|
|
55286
|
+
var zU = jU({
|
|
55283
55287
|
mutationKey: ["genai", "agent-message"],
|
|
55284
|
-
mutationFn: async ({ payload: e }) =>
|
|
55285
|
-
}), BU =
|
|
55288
|
+
mutationFn: async ({ payload: e }) => AU.sendAgentMessage(e)
|
|
55289
|
+
}), BU = jU({
|
|
55286
55290
|
mutationKey: ["genai", "agentic-app-chat"],
|
|
55287
|
-
mutationFn: async ({ payload: e }) =>
|
|
55291
|
+
mutationFn: async ({ payload: e }) => AU.sendAgenticAppChat(e)
|
|
55288
55292
|
});
|
|
55289
55293
|
//#endregion
|
|
55290
55294
|
//#region package/src/internal/hooks/useSendChatMessage.ts
|
|
@@ -55345,7 +55349,7 @@ function JU() {
|
|
|
55345
55349
|
return e?.randomUUID ? e.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
55346
55350
|
}
|
|
55347
55351
|
function YU() {
|
|
55348
|
-
let e =
|
|
55352
|
+
let e = LU(), t = RU(), n = IU(), { agentType: r, isMultiAgent: i } = mU(n.agentType), { sendChatMessage: a } = VU(), [o, s] = (0, H.useState)([]), [c, l] = (0, H.useState)(""), [u, d] = (0, H.useState)(null), [f, p] = (0, H.useState)(!1), [m, h] = (0, H.useState)(null), g = (0, H.useRef)(!1), _ = HU(n), v = i ? n.assistantLabel ?? "Assistant" : "Assistant", y = (0, H.useCallback)((e) => {
|
|
55349
55353
|
let t = {
|
|
55350
55354
|
id: JU(),
|
|
55351
55355
|
sentBy: "user",
|
|
@@ -55555,7 +55559,7 @@ function $U(e, t, n, r, i) {
|
|
|
55555
55559
|
//#endregion
|
|
55556
55560
|
//#region package/src/internal/hooks/useAgentRuntimeInfo.ts
|
|
55557
55561
|
function eW() {
|
|
55558
|
-
let e =
|
|
55562
|
+
let e = LU(), { runtimeInfo: t, setRuntimeInfo: n } = CU(), r = (0, H.useCallback)(async () => {
|
|
55559
55563
|
if (!e) {
|
|
55560
55564
|
n({
|
|
55561
55565
|
customerId: null,
|
|
@@ -55581,7 +55585,7 @@ function eW() {
|
|
|
55581
55585
|
//#endregion
|
|
55582
55586
|
//#region package/src/internal/hooks/useAgentSpeechLanguage.ts
|
|
55583
55587
|
function tW() {
|
|
55584
|
-
let e =
|
|
55588
|
+
let e = LU();
|
|
55585
55589
|
return (0, H.useMemo)(() => e && KU(e) || "en-US", [e]);
|
|
55586
55590
|
}
|
|
55587
55591
|
//#endregion
|
|
@@ -55746,9 +55750,9 @@ function cW(e, t = {}) {
|
|
|
55746
55750
|
}
|
|
55747
55751
|
//#endregion
|
|
55748
55752
|
//#region package/src/internal/queries/genai/useGenaiLoginMutation.ts
|
|
55749
|
-
var lW =
|
|
55753
|
+
var lW = jU({
|
|
55750
55754
|
mutationKey: ["genai", "login"],
|
|
55751
|
-
mutationFn: async ({ serviceAccount: e, serviceKey: t }) =>
|
|
55755
|
+
mutationFn: async ({ serviceAccount: e, serviceKey: t }) => AU.loginToGenai(e, t)
|
|
55752
55756
|
}), uW = new gE("useGenaiLogin"), dW = null, fW = null;
|
|
55753
55757
|
function pW(e = !1) {
|
|
55754
55758
|
let t = (0, H.useContext)(kM), { mutateAsync: n } = lW(), [r, i] = (0, H.useState)(!1), [a, o] = (0, H.useState)(null), [s, c] = (0, H.useState)(null), [l, u] = (0, H.useState)(null);
|
|
@@ -55796,9 +55800,9 @@ function pW(e = !1) {
|
|
|
55796
55800
|
}
|
|
55797
55801
|
//#endregion
|
|
55798
55802
|
//#region package/src/internal/queries/genai/useTenantSwitchMutation.ts
|
|
55799
|
-
var mW =
|
|
55803
|
+
var mW = jU({
|
|
55800
55804
|
mutationKey: ["genai", "tenant-switch"],
|
|
55801
|
-
mutationFn: async ({ tenant_id: e, token: t }) =>
|
|
55805
|
+
mutationFn: async ({ tenant_id: e, token: t }) => AU.switchTenant(e, t)
|
|
55802
55806
|
}), hW = new gE("useGenaiTenantSwitch"), gW = null, _W = null;
|
|
55803
55807
|
function vW(e, t, n = !1) {
|
|
55804
55808
|
let { mutateAsync: r } = mW(), [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(null), [c, l] = (0, H.useState)(!1);
|
|
@@ -56146,4 +56150,4 @@ function UW(e = {}) {
|
|
|
56146
56150
|
return r.options = n, r;
|
|
56147
56151
|
}
|
|
56148
56152
|
//#endregion
|
|
56149
|
-
export {
|
|
56153
|
+
export { pU as AgentType, BW as DEFAULT_WIDGET_ELEMENT_TAG, yM as DEFAULT_WIDGET_THEME_NAME, S as WIDGET_MOUNT_EVENT, vM as WIDGET_THEME_NAMES, xM as WIDGET_THEME_PRESETS, C as WIDGET_UNMOUNT_EVENT, TW as Widget, UW as createWidgetElement, wM as createWidgetTheme, HW as defineWidgetElement, RW as injectWidgetStyles, SM as isWidgetThemeName, zW as mountWidget, T as onWidgetEvent };
|