cmcts-c-agent-embedding-react 1.0.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/.env ADDED
@@ -0,0 +1,36 @@
1
+ # ==============================================
2
+ # REQUIRED CONFIGURATION
3
+ # ==============================================
4
+
5
+ # API Host URL (required)
6
+ # This should be the URL where your Flowise instance is running
7
+ # Example: https://your-flowise-instance.com
8
+ API_HOST=https://stock.cmcts.ai/c-agent
9
+
10
+ # Flowise API Key (required)
11
+ # Generate this from your Flowise instance settings page
12
+ # Example: OxxGE-h_LaH7ZYorStjTOik1XY999RxxoHpCSYl8BXxc
13
+ FLOWISE_API_KEY=ztl44tnaaZKMAEHmPBYgCCw3tiEdE-ls5F9Uv7kyMG4
14
+
15
+ # ==============================================
16
+ # CHATFLOWS CONFIGURATION (required)
17
+ # ==============================================
18
+
19
+ # Format: [identifier]=[chatflowId],[allowedDomain1],[allowedDomain2],...
20
+ #
21
+ # Each entry consists of:
22
+ # - identifier: Any name you choose (e.g., agent1, support, salesbot)
23
+ # - chatflowId: The UUID of your Flowise chatflow
24
+ # - allowedDomains: Comma-separated list of domains where this chat can be embedded
25
+ # Note: Wildcard domains (*) are not supported for security reasons
26
+ #
27
+ # Examples:
28
+ # agent1=20db97c6-64c9-4411-bab4-7d6202171600,https://example1.com
29
+ # support=1c28f529-a70f-5001-9bc5-4f4c5d03d8c0,https://example2.com,https://another-example2.com
30
+ # salesbot=3db97c6-64c9-4411-bab4-7d620217160a,https://sales.example.com
31
+
32
+ # Add your chatflows below:
33
+ chatflow_1=6a63bb88-88f7-4c4d-805e-9c027c85707b
34
+ chatflow_2=
35
+
36
+ CHATWOOT_BASE_URL=http://203.145.47.214:8003
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,60 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <option name="LINE_SEPARATOR" value="&#10;" />
4
+ <HTMLCodeStyleSettings>
5
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
6
+ </HTMLCodeStyleSettings>
7
+ <JSCodeStyleSettings version="0">
8
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
9
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
10
+ <option name="USE_DOUBLE_QUOTES" value="false" />
11
+ <option name="FORCE_QUOTE_STYlE" value="true" />
12
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
13
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
14
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
15
+ </JSCodeStyleSettings>
16
+ <TypeScriptCodeStyleSettings version="0">
17
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
18
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
19
+ <option name="USE_DOUBLE_QUOTES" value="false" />
20
+ <option name="FORCE_QUOTE_STYlE" value="true" />
21
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
22
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
23
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
24
+ </TypeScriptCodeStyleSettings>
25
+ <VueCodeStyleSettings>
26
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
27
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
28
+ </VueCodeStyleSettings>
29
+ <codeStyleSettings language="HTML">
30
+ <option name="SOFT_MARGINS" value="150" />
31
+ <indentOptions>
32
+ <option name="INDENT_SIZE" value="2" />
33
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
34
+ <option name="TAB_SIZE" value="2" />
35
+ </indentOptions>
36
+ </codeStyleSettings>
37
+ <codeStyleSettings language="JavaScript">
38
+ <option name="SOFT_MARGINS" value="150" />
39
+ <indentOptions>
40
+ <option name="INDENT_SIZE" value="2" />
41
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
42
+ <option name="TAB_SIZE" value="2" />
43
+ </indentOptions>
44
+ </codeStyleSettings>
45
+ <codeStyleSettings language="TypeScript">
46
+ <option name="SOFT_MARGINS" value="150" />
47
+ <indentOptions>
48
+ <option name="INDENT_SIZE" value="2" />
49
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
50
+ <option name="TAB_SIZE" value="2" />
51
+ </indentOptions>
52
+ </codeStyleSettings>
53
+ <codeStyleSettings language="Vue">
54
+ <option name="SOFT_MARGINS" value="150" />
55
+ <indentOptions>
56
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
57
+ </indentOptions>
58
+ </codeStyleSettings>
59
+ </code_scheme>
60
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,16 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="1">
8
+ <item index="0" class="java.lang.String" itemvalue="className" />
9
+ </list>
10
+ </value>
11
+ </option>
12
+ <option name="myCustomValuesEnabled" value="true" />
13
+ </inspection_tool>
14
+ <inspection_tool class="JSXNamespaceValidation" enabled="false" level="INFORMATION" enabled_by_default="false" />
15
+ </profile>
16
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/Flowise-share-chatbox.iml" filepath="$PROJECT_DIR$/.idea/Flowise-share-chatbox.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PrettierConfiguration">
4
+ <option name="myConfigurationMode" value="AUTOMATIC" />
5
+ </component>
6
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ <!-- markdownlint-disable MD030 -->
2
+
3
+ # Flowise Embed React
4
+
5
+ React library to display flowise chatbot on your website
6
+
7
+ ![Flowise](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install c-agent-embedding c-agent-embedding-react
13
+ ```
14
+
15
+ or
16
+
17
+ ```bash
18
+ yarn add c-agent-embedding c-agent-embedding-react
19
+ ```
20
+
21
+ ## Import
22
+
23
+ Full Page Chat
24
+
25
+ ```tsx
26
+ import { FullPageChat } from "c-agent-embedding-react";
27
+
28
+ const App = () => {
29
+ return (
30
+ <FullPageChat
31
+ chatflowid="your-chatflow-id"
32
+ apiHost="http://localhost:3000"
33
+ />
34
+ );
35
+ };
36
+ ```
37
+
38
+ Popup Chat
39
+
40
+ ```tsx
41
+ import { BubbleChat } from "c-agent-embedding-react";
42
+
43
+ const App = () => {
44
+ return (
45
+ <BubbleChat chatflowid="your-chatflow-id" apiHost="http://localhost:3000" />
46
+ );
47
+ };
48
+ ```
package/a.json ADDED
@@ -0,0 +1,57 @@
1
+ [
2
+ {
3
+ "agentName": "question_analyzer",
4
+ "messages": [
5
+ "{\"sub_requests\":[\"gọi tư vấn viên\"],\"convesation_related\":true,\"worker_call\":false,\"name\":\"Van dong\",\"phone_number\":\"0376561156\",\"human_support\":true,\"unsatisfied_times\":0}"
6
+ ],
7
+ "usedTools": [
8
+ null
9
+ ],
10
+ "sourceDocuments": [
11
+ null
12
+ ],
13
+ "artifacts": [
14
+ null
15
+ ],
16
+ "state": {
17
+ "worker_call": false,
18
+ "sub_requests": [
19
+ "gọi tư vấn viên"
20
+ ],
21
+ "current_date": "Thursday, December 26, 2024 at 05:11 AM UTC",
22
+ "name": "Van dong",
23
+ "phone_number": "0376561156",
24
+ "human_support": true
25
+ },
26
+ "nodeName": "seqLLMNode",
27
+ "nodeId": "seqLLMNode_0"
28
+ },
29
+ {
30
+ "agentName": "check_call_CMC_worker",
31
+ "messages": [
32
+ "human_router"
33
+ ],
34
+ "nodeName": "seqCondition",
35
+ "nodeId": "seqCondition_0"
36
+ },
37
+ {
38
+ "agentName": "human_router",
39
+ "messages": [
40
+ "{\"assistant_phone_number\":\"034567812\",\"assistant_name\":\"Huy - Tư vấn viên học phí, học bổng\"}"
41
+ ],
42
+ "usedTools": [
43
+ null
44
+ ],
45
+ "sourceDocuments": [
46
+ null
47
+ ],
48
+ "artifacts": [
49
+ null
50
+ ],
51
+ "state": {
52
+ "human_support": false
53
+ },
54
+ "nodeName": "seqLLMNode",
55
+ "nodeId": "seqLLMNode_3"
56
+ }
57
+ ]
package/base.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Default",
4
+ "compilerOptions": {
5
+ "composite": false,
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "inlineSources": false,
11
+ "isolatedModules": true,
12
+ "moduleResolution": "node",
13
+ "noUnusedLocals": false,
14
+ "noUnusedParameters": false,
15
+ "preserveWatchOutput": true,
16
+ "skipLibCheck": true,
17
+ "strict": true,
18
+ "downlevelIteration": true
19
+ },
20
+ "exclude": ["node_modules"]
21
+ }
package/bun.lockb ADDED
Binary file
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { BubbleProps } from 'cmcts-c-agent-embedding';
3
+ type Props = BubbleProps;
4
+ declare global {
5
+ namespace JSX {
6
+ interface IntrinsicElements {
7
+ 'flowise-chatbot': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
8
+ }
9
+ }
10
+ }
11
+ export declare const BubbleChat: (props: Props) => null;
12
+ export {};
13
+ //# sourceMappingURL=BubbleChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BubbleChat.d.ts","sourceRoot":"","sources":["../src/BubbleChat.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,KAAK,KAAK,GAAG,WAAW,CAAA;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CACxC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,CAAA;SACF;KACF;CACF;AAID,eAAO,MAAM,UAAU,UAAW,KAAK,SAkCtC,CAAA"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { BotProps } from 'cmcts-c-agent-embedding';
3
+ type Props = BotProps & {
4
+ style?: React.CSSProperties;
5
+ className?: string;
6
+ };
7
+ declare global {
8
+ namespace JSX {
9
+ interface IntrinsicElements {
10
+ 'flowise-fullchatbot': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
11
+ class?: string;
12
+ };
13
+ }
14
+ }
15
+ }
16
+ export declare const FullPageChat: ({ style, className, ...assignableProps }: Props) => JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=FullPageChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullPageChat.d.ts","sourceRoot":"","sources":["../src/FullPageChat.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGvD,KAAK,KAAK,GAAG,QAAQ,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAC5C,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SACvB;KACF;CACF;AAID,eAAO,MAAM,YAAY,6CAA8C,KAAK,gBAe3E,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { FullPageChat } from './FullPageChat';
2
+ export { BubbleChat } from './BubbleChat';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}