@cognizant-ai-lab/ui-common 1.4.1 → 1.5.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/components/AgentChat/ChatCommon/AgentConnectivity.d.ts +14 -0
- package/dist/components/AgentChat/ChatCommon/AgentConnectivity.js +23 -0
- package/dist/components/AgentChat/{ChatCommon.d.ts → ChatCommon/ChatCommon.d.ts} +8 -4
- package/dist/components/AgentChat/{ChatCommon.js → ChatCommon/ChatCommon.js} +318 -307
- package/dist/components/AgentChat/ChatCommon/ChatHistory.d.ts +17 -0
- package/dist/components/AgentChat/ChatCommon/ChatHistory.js +27 -0
- package/dist/components/AgentChat/{ControlButtons.d.ts → ChatCommon/ControlButtons.d.ts} +1 -1
- package/dist/components/AgentChat/ChatCommon/ControlButtons.js +26 -0
- package/dist/components/AgentChat/{FormattedMarkdown.js → ChatCommon/FormattedMarkdown.js} +1 -1
- package/dist/components/AgentChat/ChatCommon/SampleQueries.d.ts +16 -0
- package/dist/components/AgentChat/ChatCommon/SampleQueries.js +29 -0
- package/dist/components/AgentChat/{SendButton.js → ChatCommon/SendButton.js} +1 -1
- package/dist/components/AgentChat/ChatCommon/UserQueryDisplay.d.ts +7 -0
- package/dist/components/AgentChat/{UserQueryDisplay.js → ChatCommon/UserQueryDisplay.js} +4 -3
- package/dist/components/AgentChat/{LlmChatButton.d.ts → Common/LlmChatButton.d.ts} +2 -2
- package/dist/components/AgentChat/{Utils.d.ts → Common/Utils.d.ts} +1 -1
- package/dist/components/AgentChat/{Utils.js → Common/Utils.js} +2 -1
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.js +1 -1
- package/dist/components/ChatBot/ChatBot.js +2 -2
- package/dist/components/Common/CustomerLogo.js +1 -1
- package/dist/components/Common/LlmChatOptionsButton.d.ts +1 -1
- package/dist/components/Common/MUIDialog.d.ts +1 -0
- package/dist/components/Common/MUIDialog.js +2 -2
- package/dist/components/MultiAgentAccelerator/AgentCounts.d.ts +2 -2
- package/dist/components/MultiAgentAccelerator/AgentFlow.d.ts +13 -1
- package/dist/components/MultiAgentAccelerator/AgentFlow.js +193 -20
- package/dist/components/MultiAgentAccelerator/AgentNetworkDesigner.d.ts +10 -0
- package/dist/components/MultiAgentAccelerator/AgentNetworkDesigner.js +20 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.d.ts +1 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.js +9 -4
- package/dist/components/MultiAgentAccelerator/AgentNodePopup.d.ts +33 -0
- package/dist/components/MultiAgentAccelerator/AgentNodePopup.js +81 -0
- package/dist/components/MultiAgentAccelerator/GraphLayouts.d.ts +4 -4
- package/dist/components/MultiAgentAccelerator/GraphLayouts.js +12 -8
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.d.ts +1 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +103 -65
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.d.ts +1 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.js +24 -5
- package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.d.ts +1 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.js +34 -23
- package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.js +1 -1
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.d.ts +21 -0
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.js +42 -2
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.js +8 -7
- package/dist/components/MultiAgentAccelerator/const.d.ts +26 -0
- package/dist/components/MultiAgentAccelerator/const.js +23 -0
- package/dist/controller/llm/LlmChat.js +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +8 -7
- package/dist/state/ChatHistory.d.ts +50 -0
- package/dist/state/ChatHistory.js +98 -0
- package/dist/state/IndexedDBStorage.d.ts +14 -0
- package/dist/state/IndexedDBStorage.js +65 -0
- package/dist/state/TemporaryNetworks.d.ts +24 -0
- package/dist/state/TemporaryNetworks.js +43 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/File.d.ts +29 -0
- package/dist/utils/File.js +61 -0
- package/package.json +16 -11
- package/dist/components/AgentChat/ControlButtons.js +0 -26
- package/dist/components/AgentChat/UserQueryDisplay.d.ts +0 -5
- /package/dist/components/AgentChat/{FormattedMarkdown.d.ts → ChatCommon/FormattedMarkdown.d.ts} +0 -0
- /package/dist/components/AgentChat/{Greetings.d.ts → ChatCommon/Greetings.d.ts} +0 -0
- /package/dist/components/AgentChat/{Greetings.js → ChatCommon/Greetings.js} +0 -0
- /package/dist/components/AgentChat/{SendButton.d.ts → ChatCommon/SendButton.d.ts} +0 -0
- /package/dist/components/AgentChat/{SyntaxHighlighterThemes.d.ts → ChatCommon/SyntaxHighlighterThemes.d.ts} +0 -0
- /package/dist/components/AgentChat/{SyntaxHighlighterThemes.js → ChatCommon/SyntaxHighlighterThemes.js} +0 -0
- /package/dist/components/AgentChat/{LlmChatButton.js → Common/LlmChatButton.js} +0 -0
- /package/dist/components/AgentChat/{Types.d.ts → Common/Types.d.ts} +0 -0
- /package/dist/components/AgentChat/{Types.js → Common/Types.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ConnectivityInfo } from "../../../generated/neuro-san/NeuroSanClient.js";
|
|
3
|
+
interface AgentConnectivityProps {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly connectivityInfo?: readonly ConnectivityInfo[];
|
|
7
|
+
readonly targetAgent: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Render the connectivity info as a list of origins and their tools
|
|
11
|
+
* @returns A MUIAccordion representing the connectivity info with agents and their tools
|
|
12
|
+
*/
|
|
13
|
+
export declare const AgentConnectivity: FC<AgentConnectivityProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { MUIAccordion } from "../../Common/MUIAccordion.js";
|
|
3
|
+
const renderConnectivityInfo = (targetAgent, connectivityInfo) => (_jsx(_Fragment, { children: connectivityInfo
|
|
4
|
+
// Don't show connection to self
|
|
5
|
+
?.filter((info) => info.origin.toLowerCase() !== targetAgent.toLowerCase())
|
|
6
|
+
// Sort by origin name
|
|
7
|
+
.sort((a, b) => a.origin.localeCompare(b.origin))
|
|
8
|
+
// Render each origin and its tools
|
|
9
|
+
.map((info) => (_jsxs("li", { id: info.origin, children: [_jsx("b", { children: info.origin }), _jsx("ul", { id: `${info.origin}-tools`, style: { marginLeft: "8px" }, children: info?.tools?.map((tool) => (_jsx("li", { children: tool }, tool))) })] }, info.origin))) }));
|
|
10
|
+
/**
|
|
11
|
+
* Render the connectivity info as a list of origins and their tools
|
|
12
|
+
* @returns A MUIAccordion representing the connectivity info with agents and their tools
|
|
13
|
+
*/
|
|
14
|
+
export const AgentConnectivity = ({ connectivityInfo, description, id, targetAgent }) => (_jsx(MUIAccordion, { id: `${id}-agent-details`, sx: { marginTop: "1rem", marginBottom: "1rem" }, items: [
|
|
15
|
+
{
|
|
16
|
+
title: "Network Details",
|
|
17
|
+
content: [
|
|
18
|
+
`My description is: "${description}"`,
|
|
19
|
+
_jsx("h6", { id: "connectivity-header", style: { marginTop: "1rem" }, children: "I can connect you to the following agents" }, "item-1"),
|
|
20
|
+
_jsx("ul", { id: "connectivity-list", "aria-labelledby": "connectivity-header", style: { marginTop: "1rem" }, children: renderConnectivityInfo(targetAgent, connectivityInfo) }, "item-2"),
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
] }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, Ref, SetStateAction } from "react";
|
|
2
|
-
import { CombinedAgentType } from "
|
|
2
|
+
import { CombinedAgentType } from "../Common/Types.js";
|
|
3
3
|
export interface ChatCommonProps {
|
|
4
4
|
/**
|
|
5
5
|
* HTML id to use for the outer component
|
|
@@ -57,10 +57,9 @@ export interface ChatCommonProps {
|
|
|
57
57
|
*/
|
|
58
58
|
readonly agentPlaceholders?: Partial<Record<CombinedAgentType, string>>;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Defaults to not clearing the chat.
|
|
60
|
+
* Optional greetings for specific agents to display
|
|
62
61
|
*/
|
|
63
|
-
readonly
|
|
62
|
+
readonly agentGreetings?: Partial<Record<CombinedAgentType, string>>;
|
|
64
63
|
/**
|
|
65
64
|
* Extra parameters to send to the server to be forwarded to the agent or used by the server.
|
|
66
65
|
* @note This is only used for legacy agents to aid in UI consolidation, only Neuro-san agents.
|
|
@@ -82,6 +81,11 @@ export interface ChatCommonProps {
|
|
|
82
81
|
* The neuro-san server URL
|
|
83
82
|
*/
|
|
84
83
|
readonly neuroSanURL?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Extra sly_data entries to merge into each outgoing request. Used by parent components (e.g. temp networks)
|
|
86
|
+
* to re-supply data that lives outside the IndexedDB slyData store (e.g. localStorage).
|
|
87
|
+
*/
|
|
88
|
+
readonly extraSlyData?: Record<string, unknown>;
|
|
85
89
|
}
|
|
86
90
|
export type ChatCommonHandle = {
|
|
87
91
|
handleStop: () => void;
|