@mujian/js-sdk 0.0.6-beta.9 → 0.0.6-beta.91
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/dist/events/index.d.ts +31 -3
- package/dist/index.d.ts +16 -39
- package/dist/index.js +360 -62
- package/dist/lite.d.ts +73 -0
- package/dist/lite.js +119 -0
- package/dist/modules/ai/chat/chat.d.ts +46 -4
- package/dist/modules/ai/chat/index.d.ts +1 -1
- package/dist/modules/ai/chat/message/index.d.ts +3 -7
- package/dist/modules/ai/chat/settings/index.d.ts +1 -2
- package/dist/modules/ai/chat/settings/persona.d.ts +0 -8
- package/dist/modules/ai/index.d.ts +3 -2
- package/dist/modules/ai/openai/chat.d.ts +22 -0
- package/dist/modules/ai/openai/completions.d.ts +17 -0
- package/dist/modules/ai/openai/images.d.ts +17 -0
- package/dist/modules/ai/openai/index.d.ts +4 -0
- package/dist/modules/ai/openai/responses.d.ts +18 -0
- package/dist/modules/ai/text/index.d.ts +9 -2
- package/dist/modules/config.d.ts +17 -0
- package/dist/modules/utils/clipboard.d.ts +5 -0
- package/dist/modules/utils/index.d.ts +4 -0
- package/dist/react/chat/useChat/index.d.ts +34 -8
- package/dist/react/chat/useChat/inner/chatStreaming.d.ts +4 -2
- package/dist/react/chat/useChat/message.d.ts +31 -13
- package/dist/react/components/MdRenderer/index.d.ts +5 -3
- package/dist/react/components/MdRenderer/utils/height.d.ts +0 -0
- package/dist/react/components/MdRenderer/utils/iframe.d.ts +9 -0
- package/dist/react/components/MdRenderer/utils/scripts.d.ts +4 -0
- package/dist/react/components/MujianSpinner/index.d.ts +7 -0
- package/dist/react/components/index.d.ts +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/mjEngine/index.d.ts +48 -0
- package/dist/react.css +65 -4
- package/dist/react.js +834 -188
- package/dist/types/index.d.ts +39 -0
- package/dist/umd/index.js +2 -0
- package/dist/umd/index.js.LICENSE.txt +7 -0
- package/dist/umd/lite.js +2 -0
- package/dist/umd/lite.js.LICENSE.txt +7 -0
- package/dist/umd/react.css +1 -0
- package/dist/umd/react.js +133 -0
- package/dist/umd/react.js.LICENSE.txt +31 -0
- package/dist/utils/is-network-error.d.ts +1 -0
- package/dist/utils/log.d.ts +4 -0
- package/package.json +16 -6
- package/dist/modules/ai/chat/settings/model.d.ts +0 -24
- /package/dist/react/components/MdRenderer/{utils.d.ts → utils/md.d.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PersonaInfo, ProjectInfo } from '../../types';
|
|
2
|
+
import { useChat } from '../chat';
|
|
3
|
+
declare global {
|
|
4
|
+
interface MjEngineAiChat {
|
|
5
|
+
complete?: (message: string) => Promise<void>;
|
|
6
|
+
project?: ProjectInfo;
|
|
7
|
+
settings: {
|
|
8
|
+
persona?: PersonaInfo;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @param index 下标从1开始
|
|
12
|
+
*/
|
|
13
|
+
setFirstMesIndex?: (index: number) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
interface MjEngineAi {
|
|
16
|
+
chat: MjEngineAiChat;
|
|
17
|
+
}
|
|
18
|
+
interface MjEngine {
|
|
19
|
+
ai: MjEngineAi;
|
|
20
|
+
}
|
|
21
|
+
interface Window {
|
|
22
|
+
$mj_engine: MjEngine & {
|
|
23
|
+
bind: (extra: {
|
|
24
|
+
messageId: string;
|
|
25
|
+
swipeId: number;
|
|
26
|
+
}) => MjEngine & {
|
|
27
|
+
ai: {
|
|
28
|
+
chat: {
|
|
29
|
+
mjv: {
|
|
30
|
+
get: (path: string) => unknown;
|
|
31
|
+
getAll: () => unknown;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
type UseChatRet = ReturnType<typeof useChat>;
|
|
40
|
+
export type UseMjEngineOpts = {
|
|
41
|
+
projectInfo?: ProjectInfo;
|
|
42
|
+
activePersona?: PersonaInfo;
|
|
43
|
+
onSend: (query: string) => unknown;
|
|
44
|
+
messages: UseChatRet['messages'];
|
|
45
|
+
setSwipe: UseChatRet['setSwipe'];
|
|
46
|
+
};
|
|
47
|
+
export declare function useMjEngine({ projectInfo, activePersona, onSend, messages, setSwipe, }: UseMjEngineOpts): void;
|
|
48
|
+
export {};
|
package/dist/react.css
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
--SmartThemeBodyColor: #abc6df;
|
|
43
43
|
--SmartThemeEmColor: #fff;
|
|
44
44
|
--SmartThemeUnderlineColor: #bce7cf;
|
|
45
|
-
--SmartThemeQuoteColor: #
|
|
45
|
+
--SmartThemeQuoteColor: #b983ff;
|
|
46
46
|
--SmartThemeBlurTintColor: #171717;
|
|
47
47
|
--SmartThemeChatTintColor: #171717;
|
|
48
48
|
--SmartThemeUserMesBlurTintColor: #0000004d;
|
|
@@ -89,6 +89,69 @@
|
|
|
89
89
|
-moz-osx-font-smoothing: grayscale;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
.spin-overlay {
|
|
93
|
+
background-color: #000;
|
|
94
|
+
animation: 3s ease-in-out infinite breath;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes breath {
|
|
98
|
+
0% {
|
|
99
|
+
background-color: #0009;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
50% {
|
|
103
|
+
background-color: #00000080;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
100% {
|
|
107
|
+
background-color: #0009;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.wave-text span {
|
|
112
|
+
font-family: var(--mainFontFamily);
|
|
113
|
+
animation: 2s ease-in-out infinite wave;
|
|
114
|
+
display: inline-block;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.wave-text span:first-child {
|
|
118
|
+
animation-delay: 0s;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.wave-text span:nth-child(2) {
|
|
122
|
+
animation-delay: .2s;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.wave-text span:nth-child(3) {
|
|
126
|
+
animation-delay: .4s;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.wave-text span:nth-child(4) {
|
|
130
|
+
animation-delay: .6s;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.wave-text span:nth-child(5) {
|
|
134
|
+
animation-delay: .8s;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.wave-text span:nth-child(6) {
|
|
138
|
+
animation-delay: 1s;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.wave-text span:nth-child(7) {
|
|
142
|
+
animation-delay: 1.2s;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes wave {
|
|
146
|
+
0%, 100% {
|
|
147
|
+
transform: translateY(0);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
50% {
|
|
151
|
+
transform: translateY(-8px);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
92
155
|
body {
|
|
93
156
|
font-size: var(--mainFontSize);
|
|
94
157
|
color: var(--SmartThemeBodyColor);
|
|
@@ -261,11 +324,9 @@ body {
|
|
|
261
324
|
code {
|
|
262
325
|
font-family: var(--monoFontFamily);
|
|
263
326
|
white-space: pre-wrap;
|
|
264
|
-
border: 1px solid var(--SmartThemeBorderColor);
|
|
265
|
-
background-color: var(--black70a);
|
|
266
327
|
line-height: var(--mainFontSize);
|
|
267
328
|
color: var(--white70a);
|
|
268
|
-
border
|
|
329
|
+
border: 1px solid #fff;
|
|
269
330
|
padding: 0 3px;
|
|
270
331
|
}
|
|
271
332
|
|