@hef2024/llmasaservice-ui 0.23.0 → 0.23.2
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 +10 -8
- package/dist/index.mjs +10 -8
- package/package.json +1 -1
- package/src/AIAgentPanel.tsx +96 -98
package/dist/index.js
CHANGED
|
@@ -6993,8 +6993,7 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
6993
6993
|
if (e.target === e.currentTarget) {
|
|
6994
6994
|
toggleCollapse();
|
|
6995
6995
|
}
|
|
6996
|
-
}
|
|
6997
|
-
title: "Click to expand"
|
|
6996
|
+
}
|
|
6998
6997
|
},
|
|
6999
6998
|
/* @__PURE__ */ import_react16.default.createElement(Tooltip, { content: "Expand Panel", side: "left" }, /* @__PURE__ */ import_react16.default.createElement(Button, { variant: "ghost", size: "icon", onClick: toggleCollapse }, position === "right" ? /* @__PURE__ */ import_react16.default.createElement(ChevronLeftIcon, null) : /* @__PURE__ */ import_react16.default.createElement(ChevronRightIcon, null))),
|
|
7000
6999
|
/* @__PURE__ */ import_react16.default.createElement("div", { className: "ai-agent-panel__collapsed-divider" }),
|
|
@@ -7034,11 +7033,13 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
7034
7033
|
(conv) => conv.agentId === agent.id
|
|
7035
7034
|
);
|
|
7036
7035
|
const hasActiveConversation = !!activeConvForAgent;
|
|
7037
|
-
return /* @__PURE__ */ import_react16.default.createElement(
|
|
7036
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
7038
7037
|
Button,
|
|
7039
7038
|
{
|
|
7039
|
+
key: agent.id,
|
|
7040
7040
|
variant: agent.id === currentAgentId ? "secondary" : "ghost",
|
|
7041
7041
|
size: "icon",
|
|
7042
|
+
title: agent.name,
|
|
7042
7043
|
onClick: () => {
|
|
7043
7044
|
if (!isControlled) {
|
|
7044
7045
|
setUncontrolledIsCollapsed(false);
|
|
@@ -7080,7 +7081,7 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
7080
7081
|
}
|
|
7081
7082
|
) : agent.name.charAt(0).toUpperCase(),
|
|
7082
7083
|
hasActiveConversation && /* @__PURE__ */ import_react16.default.createElement("span", { className: "ai-agent-panel__agent-active-indicator" })
|
|
7083
|
-
)
|
|
7084
|
+
);
|
|
7084
7085
|
}),
|
|
7085
7086
|
/* @__PURE__ */ import_react16.default.createElement("div", { className: "ai-agent-panel__collapsed-spacer" })
|
|
7086
7087
|
));
|
|
@@ -7114,8 +7115,7 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
7114
7115
|
if (e.target === e.currentTarget) {
|
|
7115
7116
|
toggleHistoryCollapse();
|
|
7116
7117
|
}
|
|
7117
|
-
}
|
|
7118
|
-
title: "Click to expand history"
|
|
7118
|
+
}
|
|
7119
7119
|
},
|
|
7120
7120
|
/* @__PURE__ */ import_react16.default.createElement(Tooltip, { content: "Expand History", side: sidebarPosition === "left" ? "right" : "left" }, /* @__PURE__ */ import_react16.default.createElement(
|
|
7121
7121
|
Button,
|
|
@@ -7142,11 +7142,13 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
7142
7142
|
(conv) => conv.agentId === agent.id
|
|
7143
7143
|
);
|
|
7144
7144
|
const hasActiveConversation = !!activeConvForAgent;
|
|
7145
|
-
return /* @__PURE__ */ import_react16.default.createElement(
|
|
7145
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
7146
7146
|
Button,
|
|
7147
7147
|
{
|
|
7148
|
+
key: agent.id,
|
|
7148
7149
|
variant: agent.id === currentAgentId ? "secondary" : "ghost",
|
|
7149
7150
|
size: "icon",
|
|
7151
|
+
title: agent.name,
|
|
7150
7152
|
onClick: () => {
|
|
7151
7153
|
if (hasActiveConversation && activeConvForAgent) {
|
|
7152
7154
|
setCurrentConversationId(activeConvForAgent.conversationId);
|
|
@@ -7184,7 +7186,7 @@ var AIAgentPanel = import_react16.default.forwardRef(({
|
|
|
7184
7186
|
}
|
|
7185
7187
|
) : agent.name.charAt(0).toUpperCase(),
|
|
7186
7188
|
hasActiveConversation && /* @__PURE__ */ import_react16.default.createElement("span", { className: "ai-agent-panel__agent-active-indicator" })
|
|
7187
|
-
)
|
|
7189
|
+
);
|
|
7188
7190
|
}),
|
|
7189
7191
|
/* @__PURE__ */ import_react16.default.createElement("div", { className: "ai-agent-panel__history-collapsed-spacer" })
|
|
7190
7192
|
)
|
package/dist/index.mjs
CHANGED
|
@@ -6958,8 +6958,7 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
6958
6958
|
if (e.target === e.currentTarget) {
|
|
6959
6959
|
toggleCollapse();
|
|
6960
6960
|
}
|
|
6961
|
-
}
|
|
6962
|
-
title: "Click to expand"
|
|
6961
|
+
}
|
|
6963
6962
|
},
|
|
6964
6963
|
/* @__PURE__ */ React15.createElement(Tooltip, { content: "Expand Panel", side: "left" }, /* @__PURE__ */ React15.createElement(Button, { variant: "ghost", size: "icon", onClick: toggleCollapse }, position === "right" ? /* @__PURE__ */ React15.createElement(ChevronLeftIcon, null) : /* @__PURE__ */ React15.createElement(ChevronRightIcon, null))),
|
|
6965
6964
|
/* @__PURE__ */ React15.createElement("div", { className: "ai-agent-panel__collapsed-divider" }),
|
|
@@ -6999,11 +6998,13 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
6999
6998
|
(conv) => conv.agentId === agent.id
|
|
7000
6999
|
);
|
|
7001
7000
|
const hasActiveConversation = !!activeConvForAgent;
|
|
7002
|
-
return /* @__PURE__ */ React15.createElement(
|
|
7001
|
+
return /* @__PURE__ */ React15.createElement(
|
|
7003
7002
|
Button,
|
|
7004
7003
|
{
|
|
7004
|
+
key: agent.id,
|
|
7005
7005
|
variant: agent.id === currentAgentId ? "secondary" : "ghost",
|
|
7006
7006
|
size: "icon",
|
|
7007
|
+
title: agent.name,
|
|
7007
7008
|
onClick: () => {
|
|
7008
7009
|
if (!isControlled) {
|
|
7009
7010
|
setUncontrolledIsCollapsed(false);
|
|
@@ -7045,7 +7046,7 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
7045
7046
|
}
|
|
7046
7047
|
) : agent.name.charAt(0).toUpperCase(),
|
|
7047
7048
|
hasActiveConversation && /* @__PURE__ */ React15.createElement("span", { className: "ai-agent-panel__agent-active-indicator" })
|
|
7048
|
-
)
|
|
7049
|
+
);
|
|
7049
7050
|
}),
|
|
7050
7051
|
/* @__PURE__ */ React15.createElement("div", { className: "ai-agent-panel__collapsed-spacer" })
|
|
7051
7052
|
));
|
|
@@ -7079,8 +7080,7 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
7079
7080
|
if (e.target === e.currentTarget) {
|
|
7080
7081
|
toggleHistoryCollapse();
|
|
7081
7082
|
}
|
|
7082
|
-
}
|
|
7083
|
-
title: "Click to expand history"
|
|
7083
|
+
}
|
|
7084
7084
|
},
|
|
7085
7085
|
/* @__PURE__ */ React15.createElement(Tooltip, { content: "Expand History", side: sidebarPosition === "left" ? "right" : "left" }, /* @__PURE__ */ React15.createElement(
|
|
7086
7086
|
Button,
|
|
@@ -7107,11 +7107,13 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
7107
7107
|
(conv) => conv.agentId === agent.id
|
|
7108
7108
|
);
|
|
7109
7109
|
const hasActiveConversation = !!activeConvForAgent;
|
|
7110
|
-
return /* @__PURE__ */ React15.createElement(
|
|
7110
|
+
return /* @__PURE__ */ React15.createElement(
|
|
7111
7111
|
Button,
|
|
7112
7112
|
{
|
|
7113
|
+
key: agent.id,
|
|
7113
7114
|
variant: agent.id === currentAgentId ? "secondary" : "ghost",
|
|
7114
7115
|
size: "icon",
|
|
7116
|
+
title: agent.name,
|
|
7115
7117
|
onClick: () => {
|
|
7116
7118
|
if (hasActiveConversation && activeConvForAgent) {
|
|
7117
7119
|
setCurrentConversationId(activeConvForAgent.conversationId);
|
|
@@ -7149,7 +7151,7 @@ var AIAgentPanel = React15.forwardRef(({
|
|
|
7149
7151
|
}
|
|
7150
7152
|
) : agent.name.charAt(0).toUpperCase(),
|
|
7151
7153
|
hasActiveConversation && /* @__PURE__ */ React15.createElement("span", { className: "ai-agent-panel__agent-active-indicator" })
|
|
7152
|
-
)
|
|
7154
|
+
);
|
|
7153
7155
|
}),
|
|
7154
7156
|
/* @__PURE__ */ React15.createElement("div", { className: "ai-agent-panel__history-collapsed-spacer" })
|
|
7155
7157
|
)
|
package/package.json
CHANGED
package/src/AIAgentPanel.tsx
CHANGED
|
@@ -1956,7 +1956,6 @@ const AIAgentPanel = React.forwardRef<AIAgentPanelHandle, AIAgentPanelProps>(({
|
|
|
1956
1956
|
toggleCollapse();
|
|
1957
1957
|
}
|
|
1958
1958
|
}}
|
|
1959
|
-
title="Click to expand"
|
|
1960
1959
|
>
|
|
1961
1960
|
{/* Expand button at top for discoverability */}
|
|
1962
1961
|
<Tooltip content="Expand Panel" side="left">
|
|
@@ -2013,58 +2012,58 @@ const AIAgentPanel = React.forwardRef<AIAgentPanelHandle, AIAgentPanelProps>(({
|
|
|
2013
2012
|
const hasActiveConversation = !!activeConvForAgent;
|
|
2014
2013
|
|
|
2015
2014
|
return (
|
|
2016
|
-
<
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2015
|
+
<Button
|
|
2016
|
+
key={agent.id}
|
|
2017
|
+
variant={agent.id === currentAgentId ? 'secondary' : 'ghost'}
|
|
2018
|
+
size="icon"
|
|
2019
|
+
title={agent.name}
|
|
2020
|
+
onClick={() => {
|
|
2021
|
+
// Expand panel in controlled or uncontrolled mode
|
|
2022
|
+
if (!isControlled) {
|
|
2023
|
+
setUncontrolledIsCollapsed(false);
|
|
2024
|
+
}
|
|
2025
|
+
onCollapsedChange?.(false);
|
|
2026
|
+
if (hasActiveConversation && activeConvForAgent) {
|
|
2027
|
+
// Switch to the existing conversation
|
|
2028
|
+
setCurrentConversationId(activeConvForAgent.conversationId);
|
|
2029
|
+
setCurrentAgentId(agent.id);
|
|
2030
|
+
if (onConversationChange) {
|
|
2031
|
+
onConversationChange(activeConvForAgent.conversationId);
|
|
2024
2032
|
}
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
const next = new Map(prev);
|
|
2038
|
-
next.set(tempId, {
|
|
2039
|
-
conversationId: tempId,
|
|
2040
|
-
stableKey: tempId, // Stable key never changes
|
|
2041
|
-
agentId: agent.id,
|
|
2042
|
-
history: {},
|
|
2043
|
-
isLoading: false,
|
|
2044
|
-
title: 'New conversation',
|
|
2045
|
-
});
|
|
2046
|
-
return next;
|
|
2033
|
+
} else {
|
|
2034
|
+
// Start a new conversation with this agent
|
|
2035
|
+
const tempId = `new-${Date.now()}`;
|
|
2036
|
+
setActiveConversations(prev => {
|
|
2037
|
+
const next = new Map(prev);
|
|
2038
|
+
next.set(tempId, {
|
|
2039
|
+
conversationId: tempId,
|
|
2040
|
+
stableKey: tempId, // Stable key never changes
|
|
2041
|
+
agentId: agent.id,
|
|
2042
|
+
history: {},
|
|
2043
|
+
isLoading: false,
|
|
2044
|
+
title: 'New conversation',
|
|
2047
2045
|
});
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2046
|
+
return next;
|
|
2047
|
+
});
|
|
2048
|
+
setCurrentConversationId(tempId);
|
|
2049
|
+
setCurrentAgentId(agent.id);
|
|
2050
|
+
}
|
|
2051
|
+
}}
|
|
2052
|
+
className={`ai-agent-panel__agent-icon ${hasActiveConversation ? 'ai-agent-panel__agent-icon--active' : ''}`}
|
|
2053
|
+
>
|
|
2054
|
+
{agent.avatarUrl ? (
|
|
2055
|
+
<img
|
|
2056
|
+
src={agent.avatarUrl}
|
|
2057
|
+
alt={agent.name}
|
|
2058
|
+
className="ai-agent-panel__agent-avatar"
|
|
2059
|
+
/>
|
|
2060
|
+
) : (
|
|
2061
|
+
agent.name.charAt(0).toUpperCase()
|
|
2062
|
+
)}
|
|
2063
|
+
{hasActiveConversation && (
|
|
2064
|
+
<span className="ai-agent-panel__agent-active-indicator" />
|
|
2065
|
+
)}
|
|
2066
|
+
</Button>
|
|
2068
2067
|
);
|
|
2069
2068
|
})}
|
|
2070
2069
|
|
|
@@ -2105,7 +2104,6 @@ const AIAgentPanel = React.forwardRef<AIAgentPanelHandle, AIAgentPanelProps>(({
|
|
|
2105
2104
|
toggleHistoryCollapse();
|
|
2106
2105
|
}
|
|
2107
2106
|
}}
|
|
2108
|
-
title="Click to expand history"
|
|
2109
2107
|
>
|
|
2110
2108
|
{/* Expand button at top for discoverability */}
|
|
2111
2109
|
<Tooltip content="Expand History" side={sidebarPosition === 'left' ? 'right' : 'left'}>
|
|
@@ -2140,53 +2138,53 @@ const AIAgentPanel = React.forwardRef<AIAgentPanelHandle, AIAgentPanelProps>(({
|
|
|
2140
2138
|
const hasActiveConversation = !!activeConvForAgent;
|
|
2141
2139
|
|
|
2142
2140
|
return (
|
|
2143
|
-
<
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
} else {
|
|
2156
|
-
// Start a new conversation with this agent
|
|
2157
|
-
const tempId = `new-${Date.now()}`;
|
|
2158
|
-
setActiveConversations(prev => {
|
|
2159
|
-
const next = new Map(prev);
|
|
2160
|
-
next.set(tempId, {
|
|
2161
|
-
conversationId: tempId,
|
|
2162
|
-
stableKey: tempId, // Stable key never changes
|
|
2163
|
-
agentId: agent.id,
|
|
2164
|
-
history: {},
|
|
2165
|
-
isLoading: false,
|
|
2166
|
-
title: 'New conversation',
|
|
2167
|
-
});
|
|
2168
|
-
return next;
|
|
2169
|
-
});
|
|
2170
|
-
setCurrentConversationId(tempId);
|
|
2171
|
-
setCurrentAgentId(agent.id);
|
|
2141
|
+
<Button
|
|
2142
|
+
key={agent.id}
|
|
2143
|
+
variant={agent.id === currentAgentId ? 'secondary' : 'ghost'}
|
|
2144
|
+
size="icon"
|
|
2145
|
+
title={agent.name}
|
|
2146
|
+
onClick={() => {
|
|
2147
|
+
if (hasActiveConversation && activeConvForAgent) {
|
|
2148
|
+
// Switch to the existing conversation
|
|
2149
|
+
setCurrentConversationId(activeConvForAgent.conversationId);
|
|
2150
|
+
setCurrentAgentId(agent.id);
|
|
2151
|
+
if (onConversationChange) {
|
|
2152
|
+
onConversationChange(activeConvForAgent.conversationId);
|
|
2172
2153
|
}
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2154
|
+
} else {
|
|
2155
|
+
// Start a new conversation with this agent
|
|
2156
|
+
const tempId = `new-${Date.now()}`;
|
|
2157
|
+
setActiveConversations(prev => {
|
|
2158
|
+
const next = new Map(prev);
|
|
2159
|
+
next.set(tempId, {
|
|
2160
|
+
conversationId: tempId,
|
|
2161
|
+
stableKey: tempId, // Stable key never changes
|
|
2162
|
+
agentId: agent.id,
|
|
2163
|
+
history: {},
|
|
2164
|
+
isLoading: false,
|
|
2165
|
+
title: 'New conversation',
|
|
2166
|
+
});
|
|
2167
|
+
return next;
|
|
2168
|
+
});
|
|
2169
|
+
setCurrentConversationId(tempId);
|
|
2170
|
+
setCurrentAgentId(agent.id);
|
|
2171
|
+
}
|
|
2172
|
+
}}
|
|
2173
|
+
className={`ai-agent-panel__agent-icon ${hasActiveConversation ? 'ai-agent-panel__agent-icon--active' : ''}`}
|
|
2174
|
+
>
|
|
2175
|
+
{agent.avatarUrl ? (
|
|
2176
|
+
<img
|
|
2177
|
+
src={agent.avatarUrl}
|
|
2178
|
+
alt={agent.name}
|
|
2179
|
+
className="ai-agent-panel__agent-avatar"
|
|
2180
|
+
/>
|
|
2181
|
+
) : (
|
|
2182
|
+
agent.name.charAt(0).toUpperCase()
|
|
2183
|
+
)}
|
|
2184
|
+
{hasActiveConversation && (
|
|
2185
|
+
<span className="ai-agent-panel__agent-active-indicator" />
|
|
2186
|
+
)}
|
|
2187
|
+
</Button>
|
|
2190
2188
|
);
|
|
2191
2189
|
})}
|
|
2192
2190
|
|