@cognizant-ai-lab/ui-common 1.8.0 → 1.9.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.
Files changed (56) hide show
  1. package/README.md +3 -3
  2. package/dist/components/AgentChat/ChatCommon/ChatCommon.d.ts +9 -3
  3. package/dist/components/AgentChat/ChatCommon/ChatCommon.js +89 -23
  4. package/dist/components/AgentChat/ChatCommon/ChatHistory.d.ts +7 -0
  5. package/dist/components/AgentChat/ChatCommon/ChatHistory.js +1 -1
  6. package/dist/components/AgentChat/ChatCommon/ControlButtons.d.ts +4 -2
  7. package/dist/components/AgentChat/ChatCommon/ControlButtons.js +8 -2
  8. package/dist/components/AgentChat/ChatCommon/ConversationTurn.d.ts +5 -5
  9. package/dist/components/AgentChat/ChatCommon/ConversationTurn.js +1 -0
  10. package/dist/components/AgentChat/Common/Utils.d.ts +4 -0
  11. package/dist/components/AgentChat/Common/Utils.js +5 -1
  12. package/dist/components/Common/Breadcrumbs.js +1 -1
  13. package/dist/components/Common/notification.d.ts +4 -4
  14. package/dist/components/MultiAgentAccelerator/{AgentFlow.d.ts → AgentFlow/AgentFlow.d.ts} +15 -5
  15. package/dist/components/MultiAgentAccelerator/{AgentFlow.js → AgentFlow/AgentFlow.js} +44 -35
  16. package/dist/components/MultiAgentAccelerator/{AgentNode.d.ts → AgentFlow/AgentNode.d.ts} +1 -1
  17. package/dist/components/MultiAgentAccelerator/{AgentNode.js → AgentFlow/AgentNode.js} +4 -4
  18. package/dist/components/MultiAgentAccelerator/{GraphLayouts.d.ts → AgentFlow/GraphLayouts.d.ts} +4 -4
  19. package/dist/components/MultiAgentAccelerator/{GraphLayouts.js → AgentFlow/GraphLayouts.js} +6 -35
  20. package/dist/components/MultiAgentAccelerator/AgentFlow/GraphStructure.d.ts +21 -0
  21. package/dist/components/MultiAgentAccelerator/AgentFlow/GraphStructure.js +27 -0
  22. package/dist/components/MultiAgentAccelerator/AgentFlow/PlasmaEdge.d.ts +7 -0
  23. package/dist/components/MultiAgentAccelerator/{PlasmaEdge.js → AgentFlow/PlasmaEdge.js} +13 -8
  24. package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +116 -78
  25. package/dist/components/MultiAgentAccelerator/Schema/SlyData.d.ts +17 -0
  26. package/dist/components/MultiAgentAccelerator/Schema/SlyData.js +23 -0
  27. package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.js +9 -4
  28. package/dist/components/MultiAgentAccelerator/Sidebar/ImportNetworkModal.d.ts +67 -0
  29. package/dist/components/MultiAgentAccelerator/Sidebar/ImportNetworkModal.js +585 -0
  30. package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.d.ts +2 -0
  31. package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.js +19 -26
  32. package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.d.ts +2 -1
  33. package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.js +24 -4
  34. package/dist/components/MultiAgentAccelerator/TemporaryNetworks.d.ts +22 -0
  35. package/dist/components/MultiAgentAccelerator/TemporaryNetworks.js +74 -3
  36. package/dist/components/MultiAgentAccelerator/{ThoughtBubbleEdge.d.ts → ThoughtBubbles/ThoughtBubbleEdge.d.ts} +1 -1
  37. package/dist/components/MultiAgentAccelerator/{ThoughtBubbleOverlay.js → ThoughtBubbles/ThoughtBubbleOverlay.js} +1 -1
  38. package/dist/components/MultiAgentAccelerator/Tour/MainTourSteps.js +5 -0
  39. package/dist/components/MultiAgentAccelerator/const.d.ts +1 -0
  40. package/dist/components/MultiAgentAccelerator/const.js +2 -0
  41. package/dist/components/Settings/SettingsDialog.js +26 -10
  42. package/dist/controller/agent/Agent.d.ts +14 -6
  43. package/dist/controller/agent/Agent.js +18 -14
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/state/Settings.d.ts +81 -4
  47. package/dist/state/Settings.js +87 -7
  48. package/dist/tsconfig.build.tsbuildinfo +1 -1
  49. package/dist/utils/BrowserNavigation.js +2 -0
  50. package/dist/utils/File.d.ts +4 -1
  51. package/dist/utils/File.js +4 -9
  52. package/dist/utils/text.js +3 -7
  53. package/package.json +9 -10
  54. package/dist/components/MultiAgentAccelerator/PlasmaEdge.d.ts +0 -3
  55. /package/dist/components/MultiAgentAccelerator/{ThoughtBubbleEdge.js → ThoughtBubbles/ThoughtBubbleEdge.js} +0 -0
  56. /package/dist/components/MultiAgentAccelerator/{ThoughtBubbleOverlay.d.ts → ThoughtBubbles/ThoughtBubbleOverlay.d.ts} +0 -0
@@ -17,6 +17,8 @@ limitations under the License.
17
17
  * Navigate to the specified URL by setting window.location.href
18
18
  * @param url The URL to navigate to
19
19
  */
20
+ // See: https://github.com/jsdom/jsdom/issues/2112
21
+ /* istanbul ignore next -- JSDom doesn't support simulated navigation */
20
22
  export const navigateToUrl = (url) => {
21
23
  window.location.href = url;
22
24
  };
@@ -1,3 +1,4 @@
1
+ type MimeType = `${string}/${string}`;
1
2
  /**
2
3
  * // Sanitize filename for saving
3
4
  * @param input Filename as string
@@ -32,5 +33,7 @@ export declare const getFileName: (path: string) => string;
32
33
  * Downloads a file containing the supplied content with the specified filename
33
34
  * @param messageContents The contents of the file to be downloaded
34
35
  * @param fileName Local filename for the file to be downloaded
36
+ * @param mimeType Optional MIME type for the file to be downloaded, defaults to "application/octet-stream"
35
37
  */
36
- export declare const downloadFile: (messageContents: string | Uint8Array, fileName: string) => void;
38
+ export declare const downloadFile: (messageContents: string | Uint8Array, fileName: string, mimeType?: MimeType) => void;
39
+ export {};
@@ -46,21 +46,16 @@ export const splitFilename = (filename) => {
46
46
  * @param path The path to be parsed
47
47
  * @return The filename part of the path only
48
48
  */
49
- export const getFileName = (path) =>
50
- // conflicts with ESLint newline-per-chained-call rule
51
- // prettier-ignore
52
- path.split("\\")
53
- .pop()
54
- .split("/")
55
- .pop();
49
+ export const getFileName = (path) => path.split("\\").pop().split("/").pop();
56
50
  /**
57
51
  * Downloads a file containing the supplied content with the specified filename
58
52
  * @param messageContents The contents of the file to be downloaded
59
53
  * @param fileName Local filename for the file to be downloaded
54
+ * @param mimeType Optional MIME type for the file to be downloaded, defaults to "application/octet-stream"
60
55
  */
61
- export const downloadFile = (messageContents, fileName) => {
56
+ export const downloadFile = (messageContents, fileName, mimeType = "application/octet-stream") => {
62
57
  const downloadLink = document.createElement("a");
63
- const blob = new Blob([messageContents]);
58
+ const blob = new Blob([messageContents], { type: mimeType });
64
59
  // Apply the url and filename to the anchor tag
65
60
  downloadLink.href = URL.createObjectURL(blob);
66
61
  downloadLink.download = fileName;
@@ -41,9 +41,8 @@ export const extractId = (modelId, modelType) => {
41
41
  if (!modelId || !modelType || !modelId.includes(modelType)) {
42
42
  return "";
43
43
  }
44
- // conflicts with ESLint newline-per-chained-call rule
45
- // prettier-ignore
46
- return modelId.slice(`${modelType}-`.length) // remove the model type
44
+ return modelId
45
+ .slice(`${modelType}-`.length) // remove the model type
47
46
  .split("-") // split by hyphens
48
47
  .slice(0, -1) // remove the last element
49
48
  .join("-"); // join with hyphens
@@ -55,8 +54,5 @@ export const extractId = (modelId, modelType) => {
55
54
  * @returns Hashed string
56
55
  */
57
56
  export const hashString = (input) => {
58
- // prettier-ignore
59
- return createHash("md5")
60
- .update(input)
61
- .digest("hex");
57
+ return createHash("md5").update(input).digest("hex");
62
58
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cognizant-ai-lab/ui-common",
3
3
  "description": "A shared UI component library for Cognizant AI Labs projects",
4
- "version": "1.8.0",
4
+ "version": "1.9.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "yarn clean && yarn generate && yarn run --top-level tsc --project tsconfig.build.json && fix-esm-import-path dist > /dev/null",
@@ -12,10 +12,6 @@
12
12
  "dependencies": {
13
13
  "@dagrejs/dagre": "1.0.4",
14
14
  "@langchain/core": "1.1.17",
15
- "@mui/icons-material": "9.0.1",
16
- "@mui/material": "9.0.1",
17
- "@mui/system": "9.0.1",
18
- "@mui/x-tree-view": "9.1.0",
19
15
  "@xyflow/react": "12.10.1",
20
16
  "http-status": "1.7.3",
21
17
  "lodash-es": "4.18.1",
@@ -27,27 +23,30 @@
27
23
  "rehype-slug": "6.0.0",
28
24
  "remark-gfm": "4.0.1",
29
25
  "uuid": "14.0.0",
26
+ "zod": "4.4.3",
30
27
  "zustand": "4.5.7"
31
28
  },
32
29
  "devDependencies": {
33
- "@babel/core": "7.29.0",
34
- "@babel/preset-env": "7.29.5",
30
+ "@mui/icons-material": "9.0.1",
31
+ "@mui/material": "9.0.1",
32
+ "@mui/system": "9.1.2",
33
+ "@mui/x-tree-view": "9.1.0",
35
34
  "@testing-library/dom": "10.4.1",
36
35
  "@testing-library/react": "16.3.0",
37
36
  "@testing-library/user-event": "14.6.1",
38
37
  "@types/lodash-es": "4.17.12",
39
- "@types/node": "22.17.1",
38
+ "@types/node": "26.1.1",
40
39
  "@types/react": "19.2.14",
41
40
  "@types/react-dom": "19.2.3",
42
41
  "@types/react-syntax-highlighter": "15.5.13",
43
- "babel-jest": "30.4.0",
44
42
  "fake-indexeddb": "6.2.5",
45
43
  "fix-esm-import-path": "1.10.3",
46
44
  "globals": "17.4.0",
47
45
  "openapi-typescript": "7.8.0",
48
46
  "react": "19.2.4",
49
47
  "react-dom": "19.2.4",
50
- "typescript": "5.9.3"
48
+ "typescript": "5.9.3",
49
+ "vitest": "4.1.10"
51
50
  },
52
51
  "peerDependencies": {
53
52
  "@emotion/react": "^11.14.0",
@@ -1,3 +0,0 @@
1
- import { EdgeProps } from "@xyflow/react";
2
- import { FC } from "react";
3
- export declare const PlasmaEdge: FC<EdgeProps>;