llmasaservice-ui 0.16.16 → 0.17.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/dist/index.js +14 -14
- package/dist/index.mjs +11 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -77,12 +77,12 @@ var __async = (__this, __arguments, generator) => {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
// index.ts
|
|
80
|
-
var
|
|
81
|
-
__export(
|
|
80
|
+
var index_exports = {};
|
|
81
|
+
__export(index_exports, {
|
|
82
82
|
AgentPanel: () => AgentPanel_default,
|
|
83
83
|
ChatPanel: () => ChatPanel_default
|
|
84
84
|
});
|
|
85
|
-
module.exports = __toCommonJS(
|
|
85
|
+
module.exports = __toCommonJS(index_exports);
|
|
86
86
|
|
|
87
87
|
// src/ChatPanel.tsx
|
|
88
88
|
var import_llmasaservice_client = require("llmasaservice-client");
|
|
@@ -526,7 +526,7 @@ var ChatPanel = ({
|
|
|
526
526
|
const [toolsLoading, setToolsLoading] = (0, import_react3.useState)(false);
|
|
527
527
|
const [toolsFetchError, setToolsFetchError] = (0, import_react3.useState)(false);
|
|
528
528
|
(0, import_react3.useEffect)(() => {
|
|
529
|
-
const fetchAndSetTools = () => __async(
|
|
529
|
+
const fetchAndSetTools = () => __async(null, null, function* () {
|
|
530
530
|
if (!mcpServers || mcpServers.length === 0) {
|
|
531
531
|
setToolList([]);
|
|
532
532
|
setToolsLoading(false);
|
|
@@ -536,7 +536,7 @@ var ChatPanel = ({
|
|
|
536
536
|
setToolsLoading(true);
|
|
537
537
|
setToolsFetchError(false);
|
|
538
538
|
try {
|
|
539
|
-
const fetchPromises = (mcpServers != null ? mcpServers : []).map((m) => __async(
|
|
539
|
+
const fetchPromises = (mcpServers != null ? mcpServers : []).map((m) => __async(null, null, function* () {
|
|
540
540
|
const urlToFetch = `${publicAPIUrl}/tools/${encodeURIComponent(
|
|
541
541
|
m.url
|
|
542
542
|
)}`;
|
|
@@ -1029,7 +1029,7 @@ var ChatPanel = ({
|
|
|
1029
1029
|
(0, import_react3.useEffect)(() => {
|
|
1030
1030
|
pendingToolRequestsRef.current = pendingToolRequests;
|
|
1031
1031
|
}, [pendingToolRequests]);
|
|
1032
|
-
const processGivenToolRequests = (requests) => __async(
|
|
1032
|
+
const processGivenToolRequests = (requests) => __async(null, null, function* () {
|
|
1033
1033
|
if (!requests || requests.length === 0)
|
|
1034
1034
|
requests = pendingToolRequestsRef.current;
|
|
1035
1035
|
if (requests.length === 0) return;
|
|
@@ -1053,7 +1053,7 @@ var ChatPanel = ({
|
|
|
1053
1053
|
content: [],
|
|
1054
1054
|
tool_calls: []
|
|
1055
1055
|
};
|
|
1056
|
-
const toolCallsPromises = toolsToProcess.map((req) => __async(
|
|
1056
|
+
const toolCallsPromises = toolsToProcess.map((req) => __async(null, null, function* () {
|
|
1057
1057
|
if (!req) return null;
|
|
1058
1058
|
try {
|
|
1059
1059
|
return {
|
|
@@ -1073,7 +1073,7 @@ var ChatPanel = ({
|
|
|
1073
1073
|
});
|
|
1074
1074
|
newMessages.push(toolCallsMessage);
|
|
1075
1075
|
const finalToolCalls = toolCallsMessage.tool_calls;
|
|
1076
|
-
const toolResponsePromises = parsedToolCalls.map((item) => __async(
|
|
1076
|
+
const toolResponsePromises = parsedToolCalls.map((item) => __async(null, null, function* () {
|
|
1077
1077
|
var _a2;
|
|
1078
1078
|
if (!item || !item.req) return null;
|
|
1079
1079
|
const req = item.req;
|
|
@@ -1639,7 +1639,7 @@ var ChatPanel = ({
|
|
|
1639
1639
|
timezone: browserInfo2 == null ? void 0 : browserInfo2.userTimezone,
|
|
1640
1640
|
language: browserInfo2 == null ? void 0 : browserInfo2.userLanguage
|
|
1641
1641
|
})
|
|
1642
|
-
}).then((res) => __async(
|
|
1642
|
+
}).then((res) => __async(null, null, function* () {
|
|
1643
1643
|
if (!res.ok) {
|
|
1644
1644
|
const errorText = yield res.text();
|
|
1645
1645
|
throw new Error(
|
|
@@ -1996,11 +1996,11 @@ var ChatPanel = ({
|
|
|
1996
1996
|
interactionClicked(lastCallId, "email", to);
|
|
1997
1997
|
setEmailSent(true);
|
|
1998
1998
|
};
|
|
1999
|
-
const handleSuggestionClick = (suggestion) => __async(
|
|
1999
|
+
const handleSuggestionClick = (suggestion) => __async(null, null, function* () {
|
|
2000
2000
|
continueChat(suggestion);
|
|
2001
2001
|
yield interactionClicked(lastCallId, "suggestion");
|
|
2002
2002
|
});
|
|
2003
|
-
const sendConversationsViaEmail = (_0, ..._1) => __async(
|
|
2003
|
+
const sendConversationsViaEmail = (_0, ..._1) => __async(null, [_0, ..._1], function* (to, subject = `Conversation History from ${title}`, from = "") {
|
|
2004
2004
|
fetch(`${publicAPIUrl}/share/email`, {
|
|
2005
2005
|
method: "POST",
|
|
2006
2006
|
headers: {
|
|
@@ -2019,7 +2019,7 @@ var ChatPanel = ({
|
|
|
2019
2019
|
});
|
|
2020
2020
|
yield interactionClicked(lastCallId, "email", from);
|
|
2021
2021
|
});
|
|
2022
|
-
const sendCallToActionEmail = (from) => __async(
|
|
2022
|
+
const sendCallToActionEmail = (from) => __async(null, null, function* () {
|
|
2023
2023
|
const r = yield fetch(`${publicAPIUrl}/share/email`, {
|
|
2024
2024
|
method: "POST",
|
|
2025
2025
|
headers: {
|
|
@@ -2039,7 +2039,7 @@ var ChatPanel = ({
|
|
|
2039
2039
|
yield interactionClicked(lastCallId, "cta", from);
|
|
2040
2040
|
setCallToActionSent(true);
|
|
2041
2041
|
});
|
|
2042
|
-
const interactionClicked = (callId, action, emailaddress = "", comment = "") => __async(
|
|
2042
|
+
const interactionClicked = (callId, action, emailaddress = "", comment = "") => __async(null, null, function* () {
|
|
2043
2043
|
console.log(`Interaction clicked: ${action} for callId: ${callId}`);
|
|
2044
2044
|
ensureConversation().then((convId) => {
|
|
2045
2045
|
var _a2, _b;
|
|
@@ -2954,7 +2954,7 @@ var AgentPanel = ({
|
|
|
2954
2954
|
return Object.keys(customerData).length > 0 ? customerData : void 0;
|
|
2955
2955
|
};
|
|
2956
2956
|
(0, import_react4.useEffect)(() => {
|
|
2957
|
-
const fetchAgentData = () => __async(
|
|
2957
|
+
const fetchAgentData = () => __async(null, null, function* () {
|
|
2958
2958
|
try {
|
|
2959
2959
|
const fetchUrl = url.endsWith("dev") ? `https://8ftw8droff.execute-api.us-east-1.amazonaws.com/dev/agents/${agent}` : `https://api.llmasaservice.io/agents/${agent}`;
|
|
2960
2960
|
const response = yield fetch(fetchUrl, {
|
package/dist/index.mjs
CHANGED
|
@@ -498,7 +498,7 @@ var ChatPanel = ({
|
|
|
498
498
|
const [toolsLoading, setToolsLoading] = useState2(false);
|
|
499
499
|
const [toolsFetchError, setToolsFetchError] = useState2(false);
|
|
500
500
|
useEffect2(() => {
|
|
501
|
-
const fetchAndSetTools = () => __async(
|
|
501
|
+
const fetchAndSetTools = () => __async(null, null, function* () {
|
|
502
502
|
if (!mcpServers || mcpServers.length === 0) {
|
|
503
503
|
setToolList([]);
|
|
504
504
|
setToolsLoading(false);
|
|
@@ -508,7 +508,7 @@ var ChatPanel = ({
|
|
|
508
508
|
setToolsLoading(true);
|
|
509
509
|
setToolsFetchError(false);
|
|
510
510
|
try {
|
|
511
|
-
const fetchPromises = (mcpServers != null ? mcpServers : []).map((m) => __async(
|
|
511
|
+
const fetchPromises = (mcpServers != null ? mcpServers : []).map((m) => __async(null, null, function* () {
|
|
512
512
|
const urlToFetch = `${publicAPIUrl}/tools/${encodeURIComponent(
|
|
513
513
|
m.url
|
|
514
514
|
)}`;
|
|
@@ -1001,7 +1001,7 @@ var ChatPanel = ({
|
|
|
1001
1001
|
useEffect2(() => {
|
|
1002
1002
|
pendingToolRequestsRef.current = pendingToolRequests;
|
|
1003
1003
|
}, [pendingToolRequests]);
|
|
1004
|
-
const processGivenToolRequests = (requests) => __async(
|
|
1004
|
+
const processGivenToolRequests = (requests) => __async(null, null, function* () {
|
|
1005
1005
|
if (!requests || requests.length === 0)
|
|
1006
1006
|
requests = pendingToolRequestsRef.current;
|
|
1007
1007
|
if (requests.length === 0) return;
|
|
@@ -1025,7 +1025,7 @@ var ChatPanel = ({
|
|
|
1025
1025
|
content: [],
|
|
1026
1026
|
tool_calls: []
|
|
1027
1027
|
};
|
|
1028
|
-
const toolCallsPromises = toolsToProcess.map((req) => __async(
|
|
1028
|
+
const toolCallsPromises = toolsToProcess.map((req) => __async(null, null, function* () {
|
|
1029
1029
|
if (!req) return null;
|
|
1030
1030
|
try {
|
|
1031
1031
|
return {
|
|
@@ -1045,7 +1045,7 @@ var ChatPanel = ({
|
|
|
1045
1045
|
});
|
|
1046
1046
|
newMessages.push(toolCallsMessage);
|
|
1047
1047
|
const finalToolCalls = toolCallsMessage.tool_calls;
|
|
1048
|
-
const toolResponsePromises = parsedToolCalls.map((item) => __async(
|
|
1048
|
+
const toolResponsePromises = parsedToolCalls.map((item) => __async(null, null, function* () {
|
|
1049
1049
|
var _a2;
|
|
1050
1050
|
if (!item || !item.req) return null;
|
|
1051
1051
|
const req = item.req;
|
|
@@ -1611,7 +1611,7 @@ var ChatPanel = ({
|
|
|
1611
1611
|
timezone: browserInfo2 == null ? void 0 : browserInfo2.userTimezone,
|
|
1612
1612
|
language: browserInfo2 == null ? void 0 : browserInfo2.userLanguage
|
|
1613
1613
|
})
|
|
1614
|
-
}).then((res) => __async(
|
|
1614
|
+
}).then((res) => __async(null, null, function* () {
|
|
1615
1615
|
if (!res.ok) {
|
|
1616
1616
|
const errorText = yield res.text();
|
|
1617
1617
|
throw new Error(
|
|
@@ -1968,11 +1968,11 @@ var ChatPanel = ({
|
|
|
1968
1968
|
interactionClicked(lastCallId, "email", to);
|
|
1969
1969
|
setEmailSent(true);
|
|
1970
1970
|
};
|
|
1971
|
-
const handleSuggestionClick = (suggestion) => __async(
|
|
1971
|
+
const handleSuggestionClick = (suggestion) => __async(null, null, function* () {
|
|
1972
1972
|
continueChat(suggestion);
|
|
1973
1973
|
yield interactionClicked(lastCallId, "suggestion");
|
|
1974
1974
|
});
|
|
1975
|
-
const sendConversationsViaEmail = (_0, ..._1) => __async(
|
|
1975
|
+
const sendConversationsViaEmail = (_0, ..._1) => __async(null, [_0, ..._1], function* (to, subject = `Conversation History from ${title}`, from = "") {
|
|
1976
1976
|
fetch(`${publicAPIUrl}/share/email`, {
|
|
1977
1977
|
method: "POST",
|
|
1978
1978
|
headers: {
|
|
@@ -1991,7 +1991,7 @@ var ChatPanel = ({
|
|
|
1991
1991
|
});
|
|
1992
1992
|
yield interactionClicked(lastCallId, "email", from);
|
|
1993
1993
|
});
|
|
1994
|
-
const sendCallToActionEmail = (from) => __async(
|
|
1994
|
+
const sendCallToActionEmail = (from) => __async(null, null, function* () {
|
|
1995
1995
|
const r = yield fetch(`${publicAPIUrl}/share/email`, {
|
|
1996
1996
|
method: "POST",
|
|
1997
1997
|
headers: {
|
|
@@ -2011,7 +2011,7 @@ var ChatPanel = ({
|
|
|
2011
2011
|
yield interactionClicked(lastCallId, "cta", from);
|
|
2012
2012
|
setCallToActionSent(true);
|
|
2013
2013
|
});
|
|
2014
|
-
const interactionClicked = (callId, action, emailaddress = "", comment = "") => __async(
|
|
2014
|
+
const interactionClicked = (callId, action, emailaddress = "", comment = "") => __async(null, null, function* () {
|
|
2015
2015
|
console.log(`Interaction clicked: ${action} for callId: ${callId}`);
|
|
2016
2016
|
ensureConversation().then((convId) => {
|
|
2017
2017
|
var _a2, _b;
|
|
@@ -2926,7 +2926,7 @@ var AgentPanel = ({
|
|
|
2926
2926
|
return Object.keys(customerData).length > 0 ? customerData : void 0;
|
|
2927
2927
|
};
|
|
2928
2928
|
useEffect3(() => {
|
|
2929
|
-
const fetchAgentData = () => __async(
|
|
2929
|
+
const fetchAgentData = () => __async(null, null, function* () {
|
|
2930
2930
|
try {
|
|
2931
2931
|
const fetchUrl = url.endsWith("dev") ? `https://8ftw8droff.execute-api.us-east-1.amazonaws.com/dev/agents/${agent}` : `https://api.llmasaservice.io/agents/${agent}`;
|
|
2932
2932
|
const response = yield fetch(fetchUrl, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llmasaservice-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Prebuilt UI components for LLMAsAService.io",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"@storybook/react": "^8.3.6",
|
|
32
32
|
"@storybook/react-webpack5": "^8.3.6",
|
|
33
33
|
"@storybook/test": "^8.3.6",
|
|
34
|
-
"@types/react": "^
|
|
35
|
-
"@types/react-dom": "^
|
|
34
|
+
"@types/react": "^18.3.0",
|
|
35
|
+
"@types/react-dom": "^18.3.0",
|
|
36
36
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
37
37
|
"@testing-library/jest-dom": "^6.4.8",
|
|
38
38
|
"@testing-library/react": "^16.0.1",
|
|
39
39
|
"@testing-library/user-event": "^14.5.2",
|
|
40
40
|
"jsdom": "^24.1.3",
|
|
41
|
-
"react": "^
|
|
42
|
-
"react-dom": "^
|
|
41
|
+
"react": "^18.3.0",
|
|
42
|
+
"react-dom": "^18.3.0",
|
|
43
43
|
"storybook": "^8.3.6",
|
|
44
44
|
"vitest": "^2.0.5",
|
|
45
45
|
"tsup": "^8.2.4",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
57
57
|
"dotenv": "^16.4.7",
|
|
58
|
-
"llmasaservice-client": "^0.
|
|
58
|
+
"llmasaservice-client": "^0.11.0",
|
|
59
59
|
"process": "^0.11.10",
|
|
60
60
|
"react-markdown": "^9.0.1",
|
|
61
61
|
"react-syntax-highlighter": "^15.5.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"remark-html": "^16.0.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"react": "^
|
|
68
|
-
"react-dom": "^
|
|
67
|
+
"react": "^18.3.0",
|
|
68
|
+
"react-dom": "^18.3.0"
|
|
69
69
|
}
|
|
70
70
|
}
|