cmcts-c-agent-embedding 1.0.63-vib → 1.1.1-cmcuni

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.
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,QAAQ,GAAG;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,QAAQ,UAAW,QAAQ,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,SAMzD,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,QAAQ,SAOnC,CAAC;AAEF,eAAO,MAAM,OAAO,YAEnB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAC;AAQF,eAAO,MAAM,YAAY;sBAjCO,QAAQ,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;kBAQ9B,QAAQ;;CA6BlC,CAAC;A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
- {
2
- "name": "cmcts-c-agent-embedding",
3
- "version": "1.0.63-vib",
4
- "description": "Javascript library to display flowise chatbot on your website",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "scripts": {
9
- "dev": "cross-env NODE_ENV=development rollup --watch --config rollup.config.js",
10
- "build": "cross-env NODE_ENV=production rollup --config rollup.config.js",
11
- "type-check": "tsc --noEmit",
12
- "lint": "eslint \"src/**/*.ts*\"",
13
- "lint-fix": "eslint --fix \"src/**/*.ts*\"",
14
- "format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
15
- "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
16
- "start": "node server.js",
17
- "build-and-publish": "yarn build && npm publish"
18
- },
19
- "license": "MIT",
20
- "dependencies": {
21
- "@babel/core": "^7.22.1",
22
- "@microsoft/fetch-event-source": "^2.0.1",
23
- "@ts-stack/markdown": "^1.4.0",
24
- "@types/pdfjs-dist": "^2.10.378",
25
- "axios": "^1.7.7",
26
- "c-agent-embedding": "^1.0.4",
27
- "c-agent-embedding-react": "^1.0.1",
28
- "cors": "^2.8.5",
29
- "cross-env": "^7.0.3",
30
- "device-detector-js": "^3.0.3",
31
- "dotenv": "^16.4.5",
32
- "express": "^4.21.1",
33
- "form-data": "^4.0.1",
34
- "lodash": "^4.17.21",
35
- "multer": "^2.0.1",
36
- "node-fetch": "^3.3.2",
37
- "pdfjs-dist": "3.11.174",
38
- "prettier": "^3.4.2",
39
- "solid-element": "1.7.0",
40
- "solid-js": "^1.9.4",
41
- "zod": "^3.22.4"
42
- },
43
- "devDependencies": {
44
- "@babel/preset-typescript": "7.21.4",
45
- "@rollup/plugin-babel": "6.0.3",
46
- "@rollup/plugin-commonjs": "^25.0.0",
47
- "@rollup/plugin-json": "^6.1.0",
48
- "@rollup/plugin-node-resolve": "15.0.1",
49
- "@rollup/plugin-terser": "0.4.0",
50
- "@rollup/plugin-typescript": "11.0.0",
51
- "@tailwindcss/typography": "^0.5.10",
52
- "@types/lodash": "^4.14.195",
53
- "@types/node": "18.15.11",
54
- "@types/uuid": "^8.3.4",
55
- "@typescript-eslint/eslint-plugin": "^5.57.0",
56
- "@typescript-eslint/parser": "^5.57.0",
57
- "autoprefixer": "10.4.14",
58
- "babel-plugin-lodash": "^3.3.4",
59
- "babel-preset-solid": "1.7.1",
60
- "eslint": "^8.24.0",
61
- "eslint-config-next": "13.2.4",
62
- "eslint-config-prettier": "^9.0.0",
63
- "eslint-plugin-prettier": "^5.0.1",
64
- "eslint-plugin-react": "^7.26.1",
65
- "eslint-plugin-solid": "0.12.0",
66
- "postcss": "8.4.21",
67
- "react": "18.2.0",
68
- "rollup": "3.23.0",
69
- "rollup-plugin-livereload": "2.0.5",
70
- "rollup-plugin-postcss": "4.0.2",
71
- "rollup-plugin-serve": "2.0.2",
72
- "rollup-plugin-typescript-paths": "1.4.0",
73
- "rollup-plugin-uglify": "^6.0.4",
74
- "tailwindcss": "3.3.1",
75
- "typescript": "5.0.3",
76
- "uuid": "^9.0.1"
77
- },
78
- "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
79
- }
1
+ {
2
+ "name": "cmcts-c-agent-embedding",
3
+ "version": "1.1.1-cmcuni",
4
+ "description": "Javascript library to display flowise chatbot on your website",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "dev": "cross-env NODE_ENV=development rollup --watch --config rollup.config.js",
10
+ "build": "cross-env NODE_ENV=production rollup --config rollup.config.js",
11
+ "type-check": "tsc --noEmit",
12
+ "lint": "eslint \"src/**/*.ts*\"",
13
+ "lint-fix": "eslint --fix \"src/**/*.ts*\"",
14
+ "format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
15
+ "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
16
+ "prepare": "husky install",
17
+ "start": "node server.js",
18
+ "build-and-publish": "yarn build && npm publish"
19
+ },
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "@babel/core": "^7.22.1",
23
+ "@microsoft/fetch-event-source": "^2.0.1",
24
+ "@ts-stack/markdown": "^1.4.0",
25
+ "@types/pdfjs-dist": "^2.10.378",
26
+ "axios": "^1.7.7",
27
+ "c-agent-embedding": "^1.0.4",
28
+ "c-agent-embedding-react": "^1.0.1",
29
+ "cors": "^2.8.5",
30
+ "cross-env": "^7.0.3",
31
+ "device-detector-js": "^3.0.3",
32
+ "dotenv": "^16.4.5",
33
+ "express": "^4.21.1",
34
+ "form-data": "^4.0.1",
35
+ "lodash": "^4.17.21",
36
+ "multer": "^1.4.5-lts.1",
37
+ "node-fetch": "^3.3.2",
38
+ "pdfjs-dist": "3.11.174",
39
+ "prettier": "^3.4.2",
40
+ "solid-element": "1.7.0",
41
+ "solid-js": "1.7.1",
42
+ "zod": "^3.22.4"
43
+ },
44
+ "devDependencies": {
45
+ "@babel/preset-typescript": "7.21.4",
46
+ "@rollup/plugin-babel": "6.0.3",
47
+ "@rollup/plugin-commonjs": "^25.0.0",
48
+ "@rollup/plugin-json": "^6.1.0",
49
+ "@rollup/plugin-node-resolve": "15.0.1",
50
+ "@rollup/plugin-terser": "0.4.0",
51
+ "@rollup/plugin-typescript": "11.0.0",
52
+ "@tailwindcss/typography": "^0.5.10",
53
+ "@types/lodash": "^4.14.195",
54
+ "@types/node": "18.15.11",
55
+ "@types/uuid": "^8.3.4",
56
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
57
+ "@typescript-eslint/parser": "^5.57.0",
58
+ "autoprefixer": "10.4.14",
59
+ "babel-plugin-lodash": "^3.3.4",
60
+ "babel-preset-solid": "1.7.1",
61
+ "eslint": "^8.24.0",
62
+ "eslint-config-next": "13.2.4",
63
+ "eslint-config-prettier": "^9.0.0",
64
+ "eslint-plugin-prettier": "^5.0.1",
65
+ "eslint-plugin-react": "^7.26.1",
66
+ "eslint-plugin-solid": "0.12.0",
67
+ "husky": "^8.0.0",
68
+ "postcss": "8.4.21",
69
+ "react": "18.2.0",
70
+ "rollup": "3.23.0",
71
+ "rollup-plugin-livereload": "2.0.5",
72
+ "rollup-plugin-postcss": "4.0.2",
73
+ "rollup-plugin-serve": "2.0.2",
74
+ "rollup-plugin-typescript-paths": "1.4.0",
75
+ "rollup-plugin-uglify": "^6.0.4",
76
+ "tailwindcss": "3.3.1",
77
+ "typescript": "5.0.3",
78
+ "uuid": "^9.0.1"
79
+ },
80
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
81
+ }
package/public/index.html CHANGED
@@ -1,153 +1,58 @@
1
- <!--
2
- NOTE: This .html file (and public folder) is optional and can be safely deleted.
3
- It serves only as a demo/test page.
4
-
5
- The chatbot can be embedded directly on any allowed domain using the embed script that
6
- is generated when starting the server.
7
- -->
8
-
9
- <!doctype html>
10
- <html lang="en">
11
-
12
- <head>
13
- <meta charset="UTF-8" />
14
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
- <title>Flowise Chatbot Widget</title>
16
- </head>
17
-
18
- <body>
19
- <!-- <div id="root">
20
- <flowise-fullchatbot></flowise-fullchatbot>
21
- </div> -->
22
- <script type="module">
23
- import Chatbot from './web.js';
24
-
25
- const customStringify = (obj) => {
26
- let stringified = JSON.stringify(obj, null, 4)
27
- .replace(/"([^"]+)":/g, '$1:')
28
- .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
29
- .replace(/: "(true|false|\d+)"/g, ': $1')
30
- .replace(/customCSS: ""/g, 'customCSS: ``');
31
- return stringified
32
- .split('\n')
33
- .map((line, index) => {
34
- if (index === 0) return line;
35
- return ' '.repeat(8) + line;
36
- })
37
- .join('\n');
38
- };
39
-
40
- // Example initialization:
41
- // If your .env contains:
42
- // agent1=xyz789-uvw456,https://example.com
43
- // support=abc123-def456,https://example.com
44
- // salesbot=ghi123-jkl456,https://example.com
45
- //
46
- // Then use the environment variable name as chatflowid:
47
- Chatbot.init({
48
- // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
49
- // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
50
- // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
51
- chatflowid: '1755164d-cb72-4325-9831-83b295ce42bc', // or 'support', 'salesbot', etc.
52
- apiHost: 'https://vib.cagent.cmcts.ai',
53
- // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
54
- chatwootUrl: 'https://livechat.cagent.cmcts.ai',
55
- roomIds: {
56
- '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
57
- },
58
- theme: customStringify({
59
- button: {
60
- backgroundColor: '#3B81F6',
61
- right: 20,
62
- bottom: 20,
63
- size: 48,
64
- dragAndDrop: true,
65
- iconColor: 'white',
66
- customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
67
- autoWindowOpen: {
68
- autoOpen: true,
69
- openDelay: 2,
70
- autoOpenOnMobile: false,
71
- },
72
- },
73
- tooltip: {
74
- showTooltip: true,
75
- tooltipMessage: 'Hi There 👋!',
76
- tooltipBackgroundColor: 'black',
77
- tooltipTextColor: 'white',
78
- tooltipFontSize: 16,
79
- },
80
- disclaimer: {
81
- title: 'Disclaimer',
82
- message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
83
- textColor: 'black',
84
- buttonColor: '#3b82f6',
85
- buttonText: 'Start Chatting',
86
- buttonTextColor: 'white',
87
- blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)',
88
- backgroundColor: 'white',
89
- },
90
- customCSS: ``,
91
- chatWindow: {
92
- showTitle: true,
93
- showAgentMessages: true,
94
- title: 'Agent Studio Bot',
95
- titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
96
- welcomeMessage: 'Hello! This is custom welcome message',
97
- errorMessage: 'This is a custom error message',
98
- backgroundColor: '#ffffff',
99
- backgroundImage: 'enter image path or link',
100
- height: 700,
101
- width: 400,
102
- fontSize: 16,
103
- starterPrompts: ['What is a bot?', 'Who are you?'],
104
- starterPromptFontSize: 15,
105
- clearChatOnReload: false,
106
- sourceDocsTitle: 'Sources:',
107
- renderHTML: true,
108
- botMessage: {
109
- backgroundColor: '#f7f8ff',
110
- textColor: '#303235',
111
- showAvatar: true,
112
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
113
- },
114
- userMessage: {
115
- backgroundColor: '#3B81F6',
116
- textColor: '#ffffff',
117
- showAvatar: true,
118
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
119
- },
120
- textInput: {
121
- placeholder: 'Type your question',
122
- backgroundColor: '#ffffff',
123
- textColor: '#303235',
124
- sendButtonColor: '#3B81F6',
125
- maxChars: 50,
126
- maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
127
- autoFocus: true,
128
- sendMessageSound: true,
129
- sendSoundLocation: 'send_message.mp3',
130
- receiveMessageSound: true,
131
- receiveSoundLocation: 'receive_message.mp3',
132
- },
133
- feedback: {
134
- color: '#303235',
135
- },
136
- dateTimeToggle: {
137
- date: true,
138
- time: true,
139
- },
140
- footer: {
141
- textColor: '#303235',
142
- text: 'Powered by',
143
- company: 'Agent Studio',
144
- // companyLink: 'https://flowiseai.com'
145
- companyLink: '#',
146
- },
147
- },
148
- }),
149
- });
150
- </script>
151
- </body>
152
-
1
+ <!--
2
+ NOTE: This .html file (and public folder) is optional and can be safely deleted.
3
+ It serves only as a demo/test page.
4
+
5
+ The chatbot can be embedded directly on any allowed domain using the embed script that
6
+ is generated when starting the server.
7
+ -->
8
+
9
+ <!doctype html>
10
+ <html lang="en">
11
+
12
+ <head>
13
+ <meta charset="UTF-8" />
14
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
+ <title>Flowise Chatbot Widget</title>
16
+ </head>
17
+
18
+ <body>
19
+ <!-- <div id="root">
20
+ <flowise-fullchatbot></flowise-fullchatbot>
21
+ </div> -->
22
+ <script type="module">
23
+ import Chatbot from './web.js';
24
+
25
+ const customStringify = (obj) => {
26
+ let stringified = JSON.stringify(obj, null, 4)
27
+ .replace(/"([^"]+)":/g, '$1:')
28
+ .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
29
+ .replace(/: "(true|false|\d+)"/g, ': $1')
30
+ .replace(/customCSS: ""/g, 'customCSS: ``');
31
+ return stringified
32
+ .split('\n')
33
+ .map((line, index) => {
34
+ if (index === 0) return line;
35
+ return ' '.repeat(8) + line;
36
+ })
37
+ .join('\n');
38
+ };
39
+
40
+ // Example initialization:
41
+ // If your .env contains:
42
+ // agent1=xyz789-uvw456,https://example.com
43
+ // support=abc123-def456,https://example.com
44
+ // salesbot=ghi123-jkl456,https://example.com
45
+ //
46
+ // Then use the environment variable name as chatflowid:
47
+ Chatbot.init({
48
+ // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
49
+ // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
50
+ // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
51
+ chatflowid: '226da69f-74ed-4250-b754-a388e57b2877', // or 'support', 'salesbot', etc.
52
+ apiHost: 'https://cmc-uni.cagent.cmcts.ai',
53
+ }
54
+ );
55
+ </script>
56
+ </body>
57
+
153
58
  </html>