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/element.mjs
CHANGED
|
@@ -46214,30 +46214,26 @@ function BM({ onClick: e, zIndex: t, position: n, label: r }) {
|
|
|
46214
46214
|
return /* @__PURE__ */ (0, U.jsx)("div", {
|
|
46215
46215
|
className: zM.root,
|
|
46216
46216
|
style: d,
|
|
46217
|
-
children: /* @__PURE__ */ (0, U.jsx)(
|
|
46218
|
-
|
|
46219
|
-
|
|
46220
|
-
|
|
46221
|
-
|
|
46222
|
-
|
|
46223
|
-
|
|
46224
|
-
|
|
46225
|
-
|
|
46226
|
-
|
|
46227
|
-
|
|
46228
|
-
|
|
46229
|
-
|
|
46230
|
-
|
|
46231
|
-
|
|
46232
|
-
|
|
46233
|
-
|
|
46234
|
-
|
|
46235
|
-
|
|
46236
|
-
|
|
46237
|
-
"aria-label": `Open ${r ?? "agent widget"}`,
|
|
46238
|
-
title: r ?? "Assistant",
|
|
46239
|
-
children: r ?? "Assistant"
|
|
46240
|
-
})
|
|
46217
|
+
children: /* @__PURE__ */ (0, U.jsx)(Am, {
|
|
46218
|
+
onClick: e,
|
|
46219
|
+
onPointerDown: a,
|
|
46220
|
+
style: f,
|
|
46221
|
+
classNames: {
|
|
46222
|
+
root: zM.button,
|
|
46223
|
+
inner: zM.buttonInner,
|
|
46224
|
+
section: zM.iconSection,
|
|
46225
|
+
label: zM.label
|
|
46226
|
+
},
|
|
46227
|
+
leftSection: /* @__PURE__ */ (0, U.jsx)(RM, {
|
|
46228
|
+
width: s,
|
|
46229
|
+
height: s
|
|
46230
|
+
}),
|
|
46231
|
+
radius: 20,
|
|
46232
|
+
variant: "filled",
|
|
46233
|
+
color: "accent",
|
|
46234
|
+
"aria-label": `Open ${r ?? "agent widget"}`,
|
|
46235
|
+
title: `Open ${r ?? "agent widget"}`,
|
|
46236
|
+
children: r ?? "Assistant"
|
|
46241
46237
|
})
|
|
46242
46238
|
});
|
|
46243
46239
|
}
|
|
@@ -54979,17 +54975,28 @@ function dU({ visible: e, onClose: t, messages: n, composerText: r, onComposerTe
|
|
|
54979
54975
|
}) : null;
|
|
54980
54976
|
}
|
|
54981
54977
|
//#endregion
|
|
54982
|
-
//#region package/src/internal/
|
|
54978
|
+
//#region package/src/internal/hooks/useResolvedAgentType.ts
|
|
54983
54979
|
function fU(e) {
|
|
54984
|
-
return
|
|
54980
|
+
return (0, H.useMemo)(() => {
|
|
54981
|
+
let t = e === "MULTI" ? "MULTI" : "SINGLE";
|
|
54982
|
+
return {
|
|
54983
|
+
agentType: t,
|
|
54984
|
+
isMultiAgent: t === "MULTI"
|
|
54985
|
+
};
|
|
54986
|
+
}, [e]);
|
|
54985
54987
|
}
|
|
54988
|
+
//#endregion
|
|
54989
|
+
//#region package/src/internal/mappers/genai-agent-catalog.mapper.ts
|
|
54986
54990
|
function pU(e) {
|
|
54991
|
+
return typeof e == "object" && !!e;
|
|
54992
|
+
}
|
|
54993
|
+
function mU(e) {
|
|
54987
54994
|
let t = Number(e);
|
|
54988
54995
|
return Number.isFinite(t) && t > 0 ? t : null;
|
|
54989
54996
|
}
|
|
54990
|
-
function
|
|
54991
|
-
if (Array.isArray(e)) return e.filter(
|
|
54992
|
-
if (!
|
|
54997
|
+
function hU(e) {
|
|
54998
|
+
if (Array.isArray(e)) return e.filter(pU);
|
|
54999
|
+
if (!pU(e)) return [];
|
|
54993
55000
|
for (let t of [
|
|
54994
55001
|
"data",
|
|
54995
55002
|
"items",
|
|
@@ -55000,20 +55007,20 @@ function mU(e) {
|
|
|
55000
55007
|
"response"
|
|
55001
55008
|
]) {
|
|
55002
55009
|
let n = e[t];
|
|
55003
|
-
if (Array.isArray(n)) return n.filter(
|
|
55004
|
-
if (
|
|
55005
|
-
let e =
|
|
55010
|
+
if (Array.isArray(n)) return n.filter(pU);
|
|
55011
|
+
if (pU(n)) {
|
|
55012
|
+
let e = hU(n);
|
|
55006
55013
|
if (e.length > 0) return e;
|
|
55007
55014
|
}
|
|
55008
55015
|
}
|
|
55009
55016
|
for (let t of Object.values(e)) if (Array.isArray(t)) {
|
|
55010
|
-
let e = t.filter(
|
|
55017
|
+
let e = t.filter(pU);
|
|
55011
55018
|
if (e.length > 0) return e;
|
|
55012
55019
|
}
|
|
55013
55020
|
return [];
|
|
55014
55021
|
}
|
|
55015
|
-
function
|
|
55016
|
-
let t =
|
|
55022
|
+
function gU(e) {
|
|
55023
|
+
let t = mU(e.assistantId ?? e.assistant_id ?? e.id ?? e.agentId ?? e.agent_id ?? e.appId ?? e.app_id);
|
|
55017
55024
|
if (!t) return null;
|
|
55018
55025
|
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;
|
|
55019
55026
|
return {
|
|
@@ -55023,8 +55030,8 @@ function hU(e) {
|
|
|
55023
55030
|
...s ? { initialMessage: s } : {}
|
|
55024
55031
|
};
|
|
55025
55032
|
}
|
|
55026
|
-
function
|
|
55027
|
-
let t =
|
|
55033
|
+
function _U(e) {
|
|
55034
|
+
let t = mU(e.appId ?? e.app_id ?? e.id ?? e.assistantId ?? e.assistant_id);
|
|
55028
55035
|
if (!t) return null;
|
|
55029
55036
|
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;
|
|
55030
55037
|
return {
|
|
@@ -55034,25 +55041,25 @@ function gU(e) {
|
|
|
55034
55041
|
...s ? { initialMessage: s } : {}
|
|
55035
55042
|
};
|
|
55036
55043
|
}
|
|
55037
|
-
function
|
|
55044
|
+
function vU(e) {
|
|
55038
55045
|
if (Array.isArray(e.apps) && e.apps.length > 0) {
|
|
55039
|
-
let t = e.apps.map((e) =>
|
|
55046
|
+
let t = e.apps.map((e) => _U(e)).filter((e) => e !== null);
|
|
55040
55047
|
if (t.length > 0) return t;
|
|
55041
55048
|
}
|
|
55042
|
-
let t =
|
|
55049
|
+
let t = gU(e);
|
|
55043
55050
|
return t ? [t] : [];
|
|
55044
55051
|
}
|
|
55045
|
-
function
|
|
55046
|
-
return
|
|
55052
|
+
function yU(e) {
|
|
55053
|
+
return hU(e).flatMap((e) => vU(e));
|
|
55047
55054
|
}
|
|
55048
55055
|
//#endregion
|
|
55049
55056
|
//#region package/src/internal/stores/agent-chat/agent-chat.store.ts
|
|
55050
|
-
var
|
|
55057
|
+
var bU = { runtimeInfo: {
|
|
55051
55058
|
customerId: null,
|
|
55052
55059
|
hasCustomerToken: !1,
|
|
55053
55060
|
hasGenaiToken: !1
|
|
55054
|
-
} },
|
|
55055
|
-
...
|
|
55061
|
+
} }, xU = dE((e) => ({
|
|
55062
|
+
...bU,
|
|
55056
55063
|
setRuntimeInfo: (t) => e({ runtimeInfo: t }),
|
|
55057
55064
|
updateCustomerId: (t) => e((e) => ({ runtimeInfo: {
|
|
55058
55065
|
...e.runtimeInfo,
|
|
@@ -55066,11 +55073,11 @@ var yU = { runtimeInfo: {
|
|
|
55066
55073
|
...e.runtimeInfo,
|
|
55067
55074
|
hasGenaiToken: t
|
|
55068
55075
|
} })),
|
|
55069
|
-
resetRuntimeInfo: () => e({ runtimeInfo:
|
|
55076
|
+
resetRuntimeInfo: () => e({ runtimeInfo: bU.runtimeInfo })
|
|
55070
55077
|
}));
|
|
55071
55078
|
//#endregion
|
|
55072
55079
|
//#region package/src/internal/api/genai.service.ts
|
|
55073
|
-
async function
|
|
55080
|
+
async function SU(e, t) {
|
|
55074
55081
|
try {
|
|
55075
55082
|
let n = new URLSearchParams();
|
|
55076
55083
|
n.set("username", atob(e)), n.set("password", atob(t));
|
|
@@ -55083,7 +55090,7 @@ async function xU(e, t) {
|
|
|
55083
55090
|
throw e;
|
|
55084
55091
|
}
|
|
55085
55092
|
}
|
|
55086
|
-
async function
|
|
55093
|
+
async function CU(e, t) {
|
|
55087
55094
|
try {
|
|
55088
55095
|
let n = await TE.post("/tenants/switch", { tenant_id: e }, {
|
|
55089
55096
|
anonymous: !0,
|
|
@@ -55094,21 +55101,21 @@ async function SU(e, t) {
|
|
|
55094
55101
|
throw e;
|
|
55095
55102
|
}
|
|
55096
55103
|
}
|
|
55097
|
-
async function
|
|
55104
|
+
async function wU(e) {
|
|
55098
55105
|
try {
|
|
55099
55106
|
return (await TE.post("/agent-message", e, { anonymous: !0 })).data;
|
|
55100
55107
|
} catch (e) {
|
|
55101
55108
|
throw e;
|
|
55102
55109
|
}
|
|
55103
55110
|
}
|
|
55104
|
-
async function
|
|
55111
|
+
async function TU(e) {
|
|
55105
55112
|
try {
|
|
55106
55113
|
return (await TE.post("/agentic-app-chat", e, { anonymous: !0 })).data;
|
|
55107
55114
|
} catch (e) {
|
|
55108
55115
|
throw e;
|
|
55109
55116
|
}
|
|
55110
55117
|
}
|
|
55111
|
-
async function
|
|
55118
|
+
async function EU(e) {
|
|
55112
55119
|
let { customerToken: t, tenantId: n, ...r } = e;
|
|
55113
55120
|
try {
|
|
55114
55121
|
return (await TE.post("/assistant", r, {
|
|
@@ -55122,7 +55129,7 @@ async function TU(e) {
|
|
|
55122
55129
|
throw e;
|
|
55123
55130
|
}
|
|
55124
55131
|
}
|
|
55125
|
-
async function
|
|
55132
|
+
async function DU(e) {
|
|
55126
55133
|
let { customerToken: t, tenantId: n, ...r } = e;
|
|
55127
55134
|
try {
|
|
55128
55135
|
return (await TE.post("/fetch-agentic-app", r, {
|
|
@@ -55136,17 +55143,17 @@ async function EU(e) {
|
|
|
55136
55143
|
throw e;
|
|
55137
55144
|
}
|
|
55138
55145
|
}
|
|
55139
|
-
var
|
|
55140
|
-
loginToGenai:
|
|
55141
|
-
switchTenant:
|
|
55142
|
-
sendAgentMessage:
|
|
55143
|
-
sendAgenticAppChat:
|
|
55144
|
-
fetchAssistants:
|
|
55145
|
-
fetchAgenticApps:
|
|
55146
|
+
var OU = {
|
|
55147
|
+
loginToGenai: SU,
|
|
55148
|
+
switchTenant: CU,
|
|
55149
|
+
sendAgentMessage: wU,
|
|
55150
|
+
sendAgenticAppChat: TU,
|
|
55151
|
+
fetchAssistants: EU,
|
|
55152
|
+
fetchAgenticApps: DU
|
|
55146
55153
|
};
|
|
55147
55154
|
//#endregion
|
|
55148
55155
|
//#region package/src/internal/queries/utils/createApiMutation.ts
|
|
55149
|
-
function
|
|
55156
|
+
function kU({ mutationKey: e, mutationFn: t, defaultOptions: n = {} }) {
|
|
55150
55157
|
return function(r) {
|
|
55151
55158
|
return eS({
|
|
55152
55159
|
...n,
|
|
@@ -55162,121 +55169,115 @@ function OU({ mutationKey: e, mutationFn: t, defaultOptions: n = {} }) {
|
|
|
55162
55169
|
}
|
|
55163
55170
|
//#endregion
|
|
55164
55171
|
//#region package/src/internal/queries/genai/useFetchAgenticAppsMutation.ts
|
|
55165
|
-
var
|
|
55172
|
+
var AU = kU({
|
|
55166
55173
|
mutationKey: ["genai", "agentic-apps"],
|
|
55167
|
-
mutationFn: async (e) =>
|
|
55168
|
-
}),
|
|
55174
|
+
mutationFn: async (e) => OU.fetchAgenticApps(e)
|
|
55175
|
+
}), jU = kU({
|
|
55169
55176
|
mutationKey: ["genai", "assistants"],
|
|
55170
|
-
mutationFn: async (e) =>
|
|
55177
|
+
mutationFn: async (e) => OU.fetchAssistants(e)
|
|
55171
55178
|
});
|
|
55172
55179
|
//#endregion
|
|
55173
|
-
//#region package/src/internal/hooks/
|
|
55174
|
-
function jU(e) {
|
|
55175
|
-
return e === "MULTI" ? "MULTI" : "SINGLE";
|
|
55176
|
-
}
|
|
55180
|
+
//#region package/src/internal/hooks/useRemoteAssistants.ts
|
|
55177
55181
|
function MU(e, t) {
|
|
55178
|
-
|
|
55179
|
-
let n = t.find((t) => t.assistantId === e);
|
|
55180
|
-
if (n) return n.assistantId;
|
|
55181
|
-
}
|
|
55182
|
-
return t[0]?.assistantId;
|
|
55182
|
+
return e && t.includes(e) ? e : t[0];
|
|
55183
55183
|
}
|
|
55184
|
-
function NU() {
|
|
55185
|
-
let
|
|
55184
|
+
function NU(e, t, n) {
|
|
55185
|
+
let { mutateAsync: r } = jU(), { mutateAsync: i } = AU(), { isMultiAgent: a } = fU(e), [o, s] = (0, H.useState)(null), c = (0, H.useRef)(null), l = (0, H.useRef)(null), u = gT(), d = vT(), f = d ? Number(d) : null, p = bT();
|
|
55186
55186
|
(0, H.useEffect)(() => {
|
|
55187
|
-
if (!
|
|
55188
|
-
|
|
55187
|
+
if (!n) {
|
|
55188
|
+
s(null);
|
|
55189
55189
|
return;
|
|
55190
55190
|
}
|
|
55191
|
-
if (!
|
|
55192
|
-
|
|
55191
|
+
if (!u || !f || Number.isNaN(f) || f <= 0 || !p) {
|
|
55192
|
+
s(null), c.current = null, l.current = null;
|
|
55193
55193
|
return;
|
|
55194
55194
|
}
|
|
55195
|
-
let
|
|
55196
|
-
if (
|
|
55197
|
-
|
|
55198
|
-
let
|
|
55195
|
+
let e = `${a ? "multi" : "single"}:${f}:${u}`;
|
|
55196
|
+
if (c.current === e || l.current === e) return;
|
|
55197
|
+
l.current = e;
|
|
55198
|
+
let t = !0;
|
|
55199
55199
|
return (async () => {
|
|
55200
55200
|
try {
|
|
55201
|
-
let
|
|
55201
|
+
let n = a ? await i({
|
|
55202
55202
|
page: 1,
|
|
55203
55203
|
limit: 10,
|
|
55204
|
-
customerToken:
|
|
55205
|
-
tenantId:
|
|
55206
|
-
}) : await
|
|
55204
|
+
customerToken: u,
|
|
55205
|
+
tenantId: f
|
|
55206
|
+
}) : await r({
|
|
55207
55207
|
page: 1,
|
|
55208
55208
|
limit: 20,
|
|
55209
55209
|
agent_type: "SINGLE",
|
|
55210
|
-
customerToken:
|
|
55211
|
-
tenantId:
|
|
55210
|
+
customerToken: u,
|
|
55211
|
+
tenantId: f
|
|
55212
55212
|
});
|
|
55213
|
-
if (!
|
|
55214
|
-
|
|
55213
|
+
if (!t) return;
|
|
55214
|
+
s(yU(n)), c.current = e;
|
|
55215
55215
|
} catch {
|
|
55216
|
-
|
|
55216
|
+
t && (s([]), c.current = null);
|
|
55217
55217
|
} finally {
|
|
55218
|
-
|
|
55218
|
+
l.current === e && (l.current = null);
|
|
55219
55219
|
}
|
|
55220
55220
|
})(), () => {
|
|
55221
|
-
|
|
55221
|
+
t = !1;
|
|
55222
55222
|
};
|
|
55223
55223
|
}, [
|
|
55224
|
-
e?.agentType,
|
|
55225
55224
|
n,
|
|
55225
|
+
i,
|
|
55226
|
+
r,
|
|
55227
|
+
u,
|
|
55228
|
+
f,
|
|
55229
|
+
a,
|
|
55230
|
+
p
|
|
55231
|
+
]);
|
|
55232
|
+
let m = o ?? [], h = MU(t, m.map((e) => e.assistantId));
|
|
55233
|
+
return {
|
|
55234
|
+
availableAssistants: m,
|
|
55235
|
+
selectedAssistantId: h,
|
|
55236
|
+
selectedAssistant: m.find((e) => e.assistantId === h)
|
|
55237
|
+
};
|
|
55238
|
+
}
|
|
55239
|
+
//#endregion
|
|
55240
|
+
//#region package/src/internal/hooks/useAgentConfig.ts
|
|
55241
|
+
function PU() {
|
|
55242
|
+
let e = (0, H.useContext)(OM), { agentType: t } = fU(e?.agentType), { selectedAssistantId: n, selectedAssistant: r } = NU(e?.agentType, e?.assistantId, !!e), i = (0, H.useMemo)(() => e ? {
|
|
55243
|
+
...e,
|
|
55244
|
+
assistantId: n,
|
|
55245
|
+
agentType: t,
|
|
55246
|
+
assistantLabel: r?.label,
|
|
55247
|
+
assistantInitialMessage: r?.initialMessage
|
|
55248
|
+
} : null, [
|
|
55249
|
+
e,
|
|
55226
55250
|
t,
|
|
55227
|
-
|
|
55228
|
-
|
|
55229
|
-
u
|
|
55251
|
+
r,
|
|
55252
|
+
n
|
|
55230
55253
|
]);
|
|
55231
|
-
|
|
55232
|
-
|
|
55233
|
-
let t = r ?? [], n = jU(e.agentType), i = MU(e.assistantId, t), a = t.find((e) => e.assistantId === i);
|
|
55234
|
-
return {
|
|
55235
|
-
...e,
|
|
55236
|
-
assistantId: i,
|
|
55237
|
-
agentType: n,
|
|
55238
|
-
assistantLabel: a?.label,
|
|
55239
|
-
assistantInitialMessage: a?.initialMessage
|
|
55240
|
-
};
|
|
55241
|
-
}, [e, r]);
|
|
55242
|
-
if (!d) throw Error("AgentConfigContext is missing.");
|
|
55243
|
-
return d;
|
|
55254
|
+
if (!i) throw Error("AgentConfigContext is missing.");
|
|
55255
|
+
return i;
|
|
55244
55256
|
}
|
|
55245
55257
|
//#endregion
|
|
55246
55258
|
//#region package/src/internal/hooks/useAgentRuntime.ts
|
|
55247
|
-
function
|
|
55259
|
+
function FU() {
|
|
55248
55260
|
let e = (0, H.useContext)(kM);
|
|
55249
55261
|
if (!e) throw Error("AgentRuntimeContext is missing.");
|
|
55250
55262
|
return e;
|
|
55251
55263
|
}
|
|
55252
55264
|
//#endregion
|
|
55253
55265
|
//#region package/src/internal/hooks/useAgentCustomerToken.ts
|
|
55254
|
-
function
|
|
55255
|
-
let e =
|
|
55266
|
+
function IU() {
|
|
55267
|
+
let e = FU();
|
|
55256
55268
|
return (0, H.useMemo)(() => {
|
|
55257
55269
|
let t = e?.customerToken;
|
|
55258
55270
|
return typeof t != "string" || t.trim().length === 0 ? null : t;
|
|
55259
55271
|
}, [e?.customerToken]);
|
|
55260
55272
|
}
|
|
55261
55273
|
//#endregion
|
|
55262
|
-
//#region package/src/internal/hooks/useResolvedAgentType.ts
|
|
55263
|
-
function IU(e) {
|
|
55264
|
-
return (0, H.useMemo)(() => {
|
|
55265
|
-
let t = e === "MULTI" ? "MULTI" : "SINGLE";
|
|
55266
|
-
return {
|
|
55267
|
-
agentType: t,
|
|
55268
|
-
isMultiAgent: t === "MULTI"
|
|
55269
|
-
};
|
|
55270
|
-
}, [e]);
|
|
55271
|
-
}
|
|
55272
|
-
//#endregion
|
|
55273
55274
|
//#region package/src/internal/queries/genai/useSendAgentMessageMutation.ts
|
|
55274
|
-
var LU =
|
|
55275
|
+
var LU = kU({
|
|
55275
55276
|
mutationKey: ["genai", "agent-message"],
|
|
55276
|
-
mutationFn: async ({ payload: e }) =>
|
|
55277
|
-
}), RU =
|
|
55277
|
+
mutationFn: async ({ payload: e }) => OU.sendAgentMessage(e)
|
|
55278
|
+
}), RU = kU({
|
|
55278
55279
|
mutationKey: ["genai", "agentic-app-chat"],
|
|
55279
|
-
mutationFn: async ({ payload: e }) =>
|
|
55280
|
+
mutationFn: async ({ payload: e }) => OU.sendAgenticAppChat(e)
|
|
55280
55281
|
});
|
|
55281
55282
|
//#endregion
|
|
55282
55283
|
//#region package/src/internal/hooks/useSendChatMessage.ts
|
|
@@ -55337,7 +55338,7 @@ function KU() {
|
|
|
55337
55338
|
return e?.randomUUID ? e.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
55338
55339
|
}
|
|
55339
55340
|
function qU() {
|
|
55340
|
-
let e =
|
|
55341
|
+
let e = FU(), t = IU(), n = PU(), { agentType: r, isMultiAgent: i } = fU(n.agentType), { sendChatMessage: a } = zU(), [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), _ = BU(n), v = i ? n.assistantLabel ?? "Assistant" : "Assistant", y = (0, H.useCallback)((e) => {
|
|
55341
55342
|
let t = {
|
|
55342
55343
|
id: KU(),
|
|
55343
55344
|
sentBy: "user",
|
|
@@ -55547,7 +55548,7 @@ function ZU(e, t, n, r, i) {
|
|
|
55547
55548
|
//#endregion
|
|
55548
55549
|
//#region package/src/internal/hooks/useAgentRuntimeInfo.ts
|
|
55549
55550
|
function QU() {
|
|
55550
|
-
let e =
|
|
55551
|
+
let e = FU(), { runtimeInfo: t, setRuntimeInfo: n } = xU(), r = (0, H.useCallback)(async () => {
|
|
55551
55552
|
if (!e) {
|
|
55552
55553
|
n({
|
|
55553
55554
|
customerId: null,
|
|
@@ -55573,7 +55574,7 @@ function QU() {
|
|
|
55573
55574
|
//#endregion
|
|
55574
55575
|
//#region package/src/internal/hooks/useAgentSpeechLanguage.ts
|
|
55575
55576
|
function $U() {
|
|
55576
|
-
let e =
|
|
55577
|
+
let e = FU();
|
|
55577
55578
|
return (0, H.useMemo)(() => e && WU(e) || "en-US", [e]);
|
|
55578
55579
|
}
|
|
55579
55580
|
//#endregion
|
|
@@ -55738,9 +55739,9 @@ function oW(e, t = {}) {
|
|
|
55738
55739
|
}
|
|
55739
55740
|
//#endregion
|
|
55740
55741
|
//#region package/src/internal/queries/genai/useGenaiLoginMutation.ts
|
|
55741
|
-
var sW =
|
|
55742
|
+
var sW = kU({
|
|
55742
55743
|
mutationKey: ["genai", "login"],
|
|
55743
|
-
mutationFn: async ({ serviceAccount: e, serviceKey: t }) =>
|
|
55744
|
+
mutationFn: async ({ serviceAccount: e, serviceKey: t }) => OU.loginToGenai(e, t)
|
|
55744
55745
|
}), cW = new hE("useGenaiLogin"), lW = null, uW = null;
|
|
55745
55746
|
function dW(e = !1) {
|
|
55746
55747
|
let t = (0, H.useContext)(OM), { mutateAsync: n } = sW(), [r, i] = (0, H.useState)(!1), [a, o] = (0, H.useState)(null), [s, c] = (0, H.useState)(null), [l, u] = (0, H.useState)(null);
|
|
@@ -55788,9 +55789,9 @@ function dW(e = !1) {
|
|
|
55788
55789
|
}
|
|
55789
55790
|
//#endregion
|
|
55790
55791
|
//#region package/src/internal/queries/genai/useTenantSwitchMutation.ts
|
|
55791
|
-
var fW =
|
|
55792
|
+
var fW = kU({
|
|
55792
55793
|
mutationKey: ["genai", "tenant-switch"],
|
|
55793
|
-
mutationFn: async ({ tenant_id: e, token: t }) =>
|
|
55794
|
+
mutationFn: async ({ tenant_id: e, token: t }) => OU.switchTenant(e, t)
|
|
55794
55795
|
}), pW = new hE("useGenaiTenantSwitch"), mW = null, hW = null;
|
|
55795
55796
|
function gW(e, t, n = !1) {
|
|
55796
55797
|
let { mutateAsync: r } = fW(), [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(null), [c, l] = (0, H.useState)(!1);
|