reachat 0.0.1 → 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/README.md +84 -39
- package/dist/{Sessions.d.ts → Chat.d.ts} +23 -17
- package/dist/ChatContext.d.ts +16 -0
- package/dist/ChatInput.d.ts +42 -0
- package/dist/Markdown/CodeHighlighter.d.ts +9 -0
- package/dist/Markdown/Markdown.d.ts +11 -0
- package/dist/Markdown/Table.d.ts +5 -0
- package/dist/Markdown/index.d.ts +4 -0
- package/dist/Markdown/plugins/index.d.ts +1 -0
- package/dist/Markdown/plugins/remarkCve.d.ts +1 -0
- package/dist/SessionMessages/MessageActions.d.ts +45 -0
- package/dist/SessionMessages/MessageFile.d.ts +14 -0
- package/dist/SessionMessages/MessageFiles.d.ts +11 -0
- package/dist/SessionMessages/MessageQuestion.d.ts +9 -0
- package/dist/SessionMessages/MessageResponse.d.ts +13 -0
- package/dist/SessionMessages/MessageSource.d.ts +10 -0
- package/dist/SessionMessages/MessageSources.d.ts +11 -0
- package/dist/SessionMessages/SessionEmpty.d.ts +6 -0
- package/dist/SessionMessages/SessionMessage.d.ts +15 -0
- package/dist/SessionMessages/SessionMessagePanel.d.ts +3 -0
- package/dist/SessionMessages/SessionMessages.d.ts +23 -0
- package/dist/SessionMessages/SessionMessagesHeader.d.ts +3 -0
- package/dist/SessionMessages/index.d.ts +12 -0
- package/dist/SessionsList/NewSessionButton.d.ts +10 -0
- package/dist/SessionsList/SessionGroups.d.ts +10 -0
- package/dist/SessionsList/SessionListItem.d.ts +22 -0
- package/dist/SessionsList/SessionsGroup.d.ts +10 -0
- package/dist/SessionsList/SessionsList.d.ts +3 -0
- package/dist/SessionsList/index.d.ts +5 -0
- package/dist/docs.json +1379 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +758 -131
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +737 -120
- package/dist/index.umd.cjs.map +1 -1
- package/dist/theme.d.ts +70 -1
- package/dist/types.d.ts +71 -17
- package/dist/utils.d.ts +7 -0
- package/dist/utils.spec.d.ts +1 -0
- package/package.json +31 -19
- package/dist/SessionInput.d.ts +0 -22
- package/dist/SessionListItem.d.ts +0 -11
- package/dist/SessionMessage.d.ts +0 -10
- package/dist/SessionMessages.d.ts +0 -9
- package/dist/SessionsList.d.ts +0 -11
- package/dist/useLlm.d.ts +0 -3
package/dist/theme.d.ts
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ChatTheme {
|
|
2
2
|
base: string;
|
|
3
|
+
console: string;
|
|
4
|
+
companion: string;
|
|
5
|
+
empty: string;
|
|
6
|
+
sessions: {
|
|
7
|
+
base: string;
|
|
8
|
+
create: string;
|
|
9
|
+
group: string;
|
|
10
|
+
session: {
|
|
11
|
+
base: string;
|
|
12
|
+
active: string;
|
|
13
|
+
delete: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
messages: {
|
|
17
|
+
base: string;
|
|
18
|
+
title: string;
|
|
19
|
+
date: string;
|
|
20
|
+
content: string;
|
|
21
|
+
header: string;
|
|
22
|
+
showMore: string;
|
|
23
|
+
message: {
|
|
24
|
+
base: string;
|
|
25
|
+
question: string;
|
|
26
|
+
response: string;
|
|
27
|
+
cursor: string;
|
|
28
|
+
files: {
|
|
29
|
+
base: string;
|
|
30
|
+
file: {
|
|
31
|
+
base: string;
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
sources: {
|
|
36
|
+
base: string;
|
|
37
|
+
source: {
|
|
38
|
+
base: string;
|
|
39
|
+
image: string;
|
|
40
|
+
title: string;
|
|
41
|
+
url: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
markdown: {
|
|
45
|
+
p: string;
|
|
46
|
+
a: string;
|
|
47
|
+
table: string;
|
|
48
|
+
th: string;
|
|
49
|
+
td: string;
|
|
50
|
+
code: string;
|
|
51
|
+
li: string;
|
|
52
|
+
ul: string;
|
|
53
|
+
ol: string;
|
|
54
|
+
};
|
|
55
|
+
footer: {
|
|
56
|
+
base: string;
|
|
57
|
+
copy: string;
|
|
58
|
+
upvote: string;
|
|
59
|
+
downvote: string;
|
|
60
|
+
refresh: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
input: {
|
|
65
|
+
base: string;
|
|
66
|
+
upload: string;
|
|
67
|
+
input: string;
|
|
68
|
+
send: string;
|
|
69
|
+
stop: string;
|
|
70
|
+
};
|
|
3
71
|
}
|
|
72
|
+
export declare const chatTheme: ChatTheme;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,30 +1,84 @@
|
|
|
1
|
-
export interface User {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
avatarUrl?: string;
|
|
5
|
-
}
|
|
6
1
|
export interface ConversationSource {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
/**
|
|
3
|
+
* URL of the source, if applicable
|
|
4
|
+
*/
|
|
5
|
+
url?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Title or description of the source
|
|
8
|
+
*/
|
|
9
|
+
title?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Image URL of the source, if applicable.
|
|
12
|
+
*/
|
|
13
|
+
image?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ConversationFile {
|
|
16
|
+
/**
|
|
17
|
+
* Name of the file
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Type of the file
|
|
22
|
+
*/
|
|
23
|
+
type?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Size of the file
|
|
26
|
+
*/
|
|
27
|
+
size?: number;
|
|
28
|
+
/**
|
|
29
|
+
* URL of the file
|
|
30
|
+
*/
|
|
31
|
+
url?: string;
|
|
10
32
|
}
|
|
11
33
|
export interface Conversation {
|
|
34
|
+
/**
|
|
35
|
+
* Unique identifier for the conversation
|
|
36
|
+
*/
|
|
12
37
|
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* Date and time when the conversation was created
|
|
40
|
+
*/
|
|
13
41
|
createdAt: Date;
|
|
14
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Date and time when the conversation was last updated
|
|
44
|
+
*/
|
|
45
|
+
updatedAt?: Date;
|
|
46
|
+
/**
|
|
47
|
+
* The user's question or input that initiated the conversation
|
|
48
|
+
*/
|
|
15
49
|
question: string;
|
|
50
|
+
/**
|
|
51
|
+
* The AI's response to the user's question
|
|
52
|
+
*/
|
|
16
53
|
response?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Array of sources referenced in the conversation
|
|
56
|
+
*/
|
|
17
57
|
sources?: ConversationSource[];
|
|
18
|
-
|
|
19
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Array of file paths or identifiers associated with the conversation
|
|
60
|
+
*/
|
|
61
|
+
files?: ConversationFile[];
|
|
20
62
|
}
|
|
21
63
|
export interface Session {
|
|
64
|
+
/**
|
|
65
|
+
* Unique identifier for the session
|
|
66
|
+
*/
|
|
22
67
|
id: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Title of the session
|
|
70
|
+
*/
|
|
71
|
+
title?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Date and time when the session was created
|
|
74
|
+
*/
|
|
75
|
+
createdAt?: Date;
|
|
76
|
+
/**
|
|
77
|
+
* Date and time when the session was last updated
|
|
78
|
+
*/
|
|
79
|
+
updatedAt?: Date;
|
|
80
|
+
/**
|
|
81
|
+
* Array of conversations within this session
|
|
82
|
+
*/
|
|
26
83
|
conversations: Conversation[];
|
|
27
84
|
}
|
|
28
|
-
export interface ResponseTransformer {
|
|
29
|
-
(response: string, next: (transformedResponse: string) => string): string;
|
|
30
|
-
}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reachat",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Chat UI for Building LLMs",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build-storybook": "storybook build",
|
|
7
|
-
"build": "
|
|
7
|
+
"build": "npm run build:js && npm run build:docs",
|
|
8
|
+
"build:js": "vite build --mode library",
|
|
9
|
+
"build:docs": "node scripts/docs.js",
|
|
8
10
|
"lint": "eslint --ext js,ts,tsx",
|
|
9
11
|
"lint:fix": "eslint --ext js,ts,tsx --fix src",
|
|
10
12
|
"lint:prettier": "prettier --loglevel warn --write 'src/**/*.{ts,tsx,js,jsx}'",
|
|
@@ -29,26 +31,34 @@
|
|
|
29
31
|
"require": "./dist/index.umd.cjs",
|
|
30
32
|
"types": "./dist/index.d.ts"
|
|
31
33
|
},
|
|
34
|
+
"./docs.json": "./dist/docs.json",
|
|
32
35
|
"./index.css": "./dist/index.css"
|
|
33
36
|
},
|
|
34
37
|
"browser": "dist/index.js",
|
|
35
38
|
"typings": "dist/index.d.ts",
|
|
36
39
|
"dependencies": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"framer-motion": "^10.16.16"
|
|
40
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
41
|
+
"date-fns": "^3.6.0",
|
|
42
|
+
"framer-motion": "^10.16.16",
|
|
43
|
+
"highlight.js": "^11.10.0",
|
|
44
|
+
"mdast-util-find-and-replace": "^3.0.1",
|
|
45
|
+
"reablocks": "^8.4.0",
|
|
46
|
+
"react-markdown": "^9.0.1",
|
|
47
|
+
"reakeys": "^2.0.3",
|
|
48
|
+
"remark-gfm": "^4.0.0",
|
|
49
|
+
"remark-youtube": "^1.3.2"
|
|
40
50
|
},
|
|
41
51
|
"devDependencies": {
|
|
42
|
-
"@storybook/addon-docs": "^8.
|
|
43
|
-
"@storybook/addon-essentials": "^8.
|
|
44
|
-
"@storybook/addon-mdx-gfm": "^8.
|
|
45
|
-
"@storybook/addon-storysource": "^8.
|
|
46
|
-
"@storybook/addon-themes": "^8.
|
|
47
|
-
"@storybook/manager-api": "^8.
|
|
48
|
-
"@storybook/preview-api": "^8.
|
|
49
|
-
"@storybook/react": "^8.
|
|
50
|
-
"@storybook/react-vite": "^8.
|
|
51
|
-
"@storybook/theming": "^8.
|
|
52
|
+
"@storybook/addon-docs": "^8.2.6",
|
|
53
|
+
"@storybook/addon-essentials": "^8.2.6",
|
|
54
|
+
"@storybook/addon-mdx-gfm": "^8.2.6",
|
|
55
|
+
"@storybook/addon-storysource": "^8.2.6",
|
|
56
|
+
"@storybook/addon-themes": "^8.2.6",
|
|
57
|
+
"@storybook/manager-api": "^8.2.6",
|
|
58
|
+
"@storybook/preview-api": "^8.2.6",
|
|
59
|
+
"@storybook/react": "^8.2.6",
|
|
60
|
+
"@storybook/react-vite": "^8.2.6",
|
|
61
|
+
"@storybook/theming": "^8.2.6",
|
|
52
62
|
"@types/classnames": "^2.3.1",
|
|
53
63
|
"@types/react": "^18.2.61",
|
|
54
64
|
"@types/react-dom": "^18.2.19",
|
|
@@ -67,6 +77,8 @@
|
|
|
67
77
|
"husky": "^9.0.11",
|
|
68
78
|
"jsdom": "^24.0.0",
|
|
69
79
|
"lint-staged": "^15.2.2",
|
|
80
|
+
"openai": "^4.53.0",
|
|
81
|
+
"postcss": "^8.4.39",
|
|
70
82
|
"postcss-nested": "^6.0.1",
|
|
71
83
|
"postcss-preset-env": "^9.5.2",
|
|
72
84
|
"prettier": "^3.2.5",
|
|
@@ -75,8 +87,8 @@
|
|
|
75
87
|
"react-dom": "^18.0.0",
|
|
76
88
|
"react-hook-form": "^7.51.1",
|
|
77
89
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
78
|
-
"storybook": "^8.
|
|
79
|
-
"tailwindcss": "^3.4.
|
|
90
|
+
"storybook": "^8.2.6",
|
|
91
|
+
"tailwindcss": "^3.4.6",
|
|
80
92
|
"tw-colors": "^3.3.1",
|
|
81
93
|
"typescript": "^4.9.5",
|
|
82
94
|
"typescript-rewrite-paths": "^1.3.1",
|
|
@@ -84,7 +96,6 @@
|
|
|
84
96
|
"vite-plugin-checker": "^0.6.4",
|
|
85
97
|
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
86
98
|
"vite-plugin-dts": "^3.7.3",
|
|
87
|
-
"vite-plugin-static-copy": "^1.0.4",
|
|
88
99
|
"vite-plugin-svgr": "^4.2.0",
|
|
89
100
|
"vite-tsconfig-paths": "^4.3.2",
|
|
90
101
|
"vitest": "^1.4.0"
|
|
@@ -107,5 +118,6 @@
|
|
|
107
118
|
"hooks": {
|
|
108
119
|
"pre-commit": "lint-staged"
|
|
109
120
|
}
|
|
110
|
-
}
|
|
121
|
+
},
|
|
122
|
+
"packageManager": "pnpm@9.5.0+sha1.8c155dc114e1689d18937974f6571e0ceee66f1d"
|
|
111
123
|
}
|
package/dist/SessionInput.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
interface SessionInputProps {
|
|
4
|
-
/**
|
|
5
|
-
* Indicates whether the sessions are currently loading.
|
|
6
|
-
*/
|
|
7
|
-
isLoading?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Placeholder text for the input field.
|
|
10
|
-
*/
|
|
11
|
-
inputPlaceholder?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Callback function to handle sending a new message.
|
|
14
|
-
*/
|
|
15
|
-
onSendMessage?: (message: string) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Callback function to handle stopping the current action.
|
|
18
|
-
*/
|
|
19
|
-
onStopMessage?: () => void;
|
|
20
|
-
}
|
|
21
|
-
export declare const SessionInput: FC<SessionInputProps>;
|
|
22
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Session } from './types';
|
|
3
|
-
|
|
4
|
-
interface SessionListItemProps {
|
|
5
|
-
session: Session;
|
|
6
|
-
isActive: boolean;
|
|
7
|
-
onSelectSession?: (sessionId: string) => void;
|
|
8
|
-
onDeleteSession?: (sessionId: string) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const SessionListItem: FC<SessionListItemProps>;
|
|
11
|
-
export {};
|
package/dist/SessionMessage.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ResponseTransformer } from './types';
|
|
3
|
-
|
|
4
|
-
interface SessionMessageProps {
|
|
5
|
-
question: string;
|
|
6
|
-
response: string;
|
|
7
|
-
responseTransformers?: ResponseTransformer[];
|
|
8
|
-
}
|
|
9
|
-
export declare const SessionMessage: FC<SessionMessageProps>;
|
|
10
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ResponseTransformer, Conversation } from './types';
|
|
3
|
-
|
|
4
|
-
interface SessionMessagesProps {
|
|
5
|
-
conversations: Conversation[];
|
|
6
|
-
responseTransformers?: ResponseTransformer[];
|
|
7
|
-
}
|
|
8
|
-
export declare const SessionMessages: React.FC<SessionMessagesProps>;
|
|
9
|
-
export {};
|
package/dist/SessionsList.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Session } from './types';
|
|
3
|
-
|
|
4
|
-
interface SessionsListProps {
|
|
5
|
-
sessions: Session[];
|
|
6
|
-
activeSessionId?: string;
|
|
7
|
-
onSelectSession?: (sessionId: string) => void;
|
|
8
|
-
onDeleteSession?: (sessionId: string) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const SessionsList: FC<SessionsListProps>;
|
|
11
|
-
export {};
|
package/dist/useLlm.d.ts
DELETED