@infinilabs/chat-message 0.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/README.md +123 -0
- package/dist/App.d.ts +2 -0
- package/dist/ChatMessage.cjs +32 -0
- package/dist/ChatMessage.iife.js +32 -0
- package/dist/ChatMessage.js +4950 -0
- package/dist/ChatMessage.umd.cjs +32 -0
- package/dist/components/Assistant/AttachmentList.d.ts +9 -0
- package/dist/components/CallTools.d.ts +8 -0
- package/dist/components/Common/CopyButton.d.ts +5 -0
- package/dist/components/Common/Icons/FileIcon.d.ts +7 -0
- package/dist/components/Common/Icons/FontIcon.d.ts +8 -0
- package/dist/components/Common/Tooltip2.d.ts +8 -0
- package/dist/components/DeepRead.d.ts +8 -0
- package/dist/components/FetchSource.d.ts +25 -0
- package/dist/components/MessageActions.d.ts +11 -0
- package/dist/components/PickSource.d.ts +8 -0
- package/dist/components/PrevSuggestion.d.ts +6 -0
- package/dist/components/QueryIntent.d.ts +9 -0
- package/dist/components/SuggestionList.d.ts +6 -0
- package/dist/components/Think.d.ts +8 -0
- package/dist/components/UserMessage.d.ts +7 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/demo.d.ts +98 -0
- package/dist/hooks/useMessageChunkData.d.ts +22 -0
- package/dist/i18n/config.d.ts +2 -0
- package/dist/icons/Reading.d.ts +2 -0
- package/dist/icons/Retrieve.d.ts +2 -0
- package/dist/icons/SVGWrap.d.ts +2 -0
- package/dist/icons/Selection.d.ts +2 -0
- package/dist/icons/Understand.d.ts +2 -0
- package/dist/icons/types.d.ts +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/main.d.ts +0 -0
- package/dist/stores/appStore.d.ts +5 -0
- package/dist/stores/chatStore.d.ts +20 -0
- package/dist/stores/connectStore.d.ts +8 -0
- package/dist/types/chat.d.ts +31 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/platformAdapter.d.ts +9 -0
- package/dist/vite.svg +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UploadAttachments {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
size: number;
|
|
6
|
+
uploading?: boolean;
|
|
7
|
+
uploaded?: boolean;
|
|
8
|
+
uploadFailed?: boolean;
|
|
9
|
+
failedMessage?: string;
|
|
10
|
+
attachmentId?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
interface ChatState {
|
|
14
|
+
synthesizeItem: any;
|
|
15
|
+
setSynthesizeItem: (item: any) => void;
|
|
16
|
+
uploadAttachments: UploadAttachments[];
|
|
17
|
+
setUploadAttachments: (items: UploadAttachments[]) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const useChatStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ChatState>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ConnectState {
|
|
2
|
+
currentAssistant: any;
|
|
3
|
+
assistantList: any[];
|
|
4
|
+
currentService: any;
|
|
5
|
+
setAssistant: (assistant: any) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useConnectStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ConnectState>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ISource {
|
|
2
|
+
id?: string;
|
|
3
|
+
created?: string;
|
|
4
|
+
updated?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
session_id?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
message?: any;
|
|
9
|
+
attachments?: string[];
|
|
10
|
+
title?: string;
|
|
11
|
+
question?: string;
|
|
12
|
+
details?: any[] | null;
|
|
13
|
+
assistant_id?: string;
|
|
14
|
+
assistant_item?: any;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export interface IChatMessage {
|
|
18
|
+
_id?: string;
|
|
19
|
+
_source: ISource;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
export interface IChunkData {
|
|
23
|
+
session_id?: string;
|
|
24
|
+
message_id?: string;
|
|
25
|
+
message_type?: string;
|
|
26
|
+
reply_to_message?: string;
|
|
27
|
+
chunk_sequence?: number;
|
|
28
|
+
chunk_type?: string;
|
|
29
|
+
message_chunk?: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@infinilabs/chat-message",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"private": false,
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"version": "0.0.0",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "dist/ChatMessage.cjs",
|
|
15
|
+
"module": "dist/ChatMessage.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/ChatMessage.js",
|
|
21
|
+
"require": "./dist/ChatMessage.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "tsc -b && vite build",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"preview": "vite preview"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "^18.3.1",
|
|
32
|
+
"react-dom": "^18.3.1",
|
|
33
|
+
"react-i18next": ">=11.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@ant-design/x-markdown": "^2.1.3",
|
|
37
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
38
|
+
"ahooks": "^3.9.6",
|
|
39
|
+
"clsx": "^2.1.1",
|
|
40
|
+
"i18next": "^25.7.3",
|
|
41
|
+
"lucide-react": "^0.461.0",
|
|
42
|
+
"mermaid": "^11.6.0",
|
|
43
|
+
"react-markdown": "^9.1.0",
|
|
44
|
+
"rehype-highlight": "^7.0.2",
|
|
45
|
+
"rehype-katex": "^7.0.1",
|
|
46
|
+
"remark-breaks": "^4.0.0",
|
|
47
|
+
"remark-gfm": "^4.0.1",
|
|
48
|
+
"remark-math": "^6.0.0",
|
|
49
|
+
"use-debounce": "^10.0.4",
|
|
50
|
+
"zustand": "^5.0.4"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@eslint/js": "^9.33.0",
|
|
54
|
+
"@types/react": "18.3.3",
|
|
55
|
+
"@types/react-dom": "18.3.0",
|
|
56
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
57
|
+
"eslint": "^9.33.0",
|
|
58
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
59
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
60
|
+
"globals": "^16.3.0",
|
|
61
|
+
"react": "^18.3.1",
|
|
62
|
+
"react-dom": "^18.3.1",
|
|
63
|
+
"react-i18next": "^16.5.1",
|
|
64
|
+
"tailwind-merge": "^3.4.0",
|
|
65
|
+
"tailwindcss": "^4.1.18",
|
|
66
|
+
"typescript": "~5.8.3",
|
|
67
|
+
"typescript-eslint": "^8.39.1",
|
|
68
|
+
"vite": "^7.1.2",
|
|
69
|
+
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
70
|
+
"vite-plugin-dts": "^4.5.4"
|
|
71
|
+
}
|
|
72
|
+
}
|