@gientech/modual 1.4.7 → 1.5.2
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/assets/GientechStreamReader-KtCNi1G3.js +447 -0
- package/dist/assets/Input-CNqIA41v.js +236 -0
- package/dist/assets/index-Bof0D4vl.js +1088 -0
- package/dist/assets/{index-BVENTW1Q.js → index-C5RhLYRh.js} +1 -1
- package/dist/assets/index-COcmK9my.js +1 -0
- package/dist/assets/index-CysDmrpo.js +1798 -0
- package/dist/assets/{index-7rZAt9P3.js → index-DP8Ki8qW.js} +1 -1
- package/dist/assets/index-pybYlMAT.js +11 -0
- package/dist/assets/{plus-CrtEUXaQ.js → plus-CzbYbK8K.js} +1 -1
- package/dist/assets/style3.css +1 -1
- package/dist/assets/worker-BbpylX7l.js +13 -0
- package/dist/assets/{x-Dr3EBTzJ.js → x-DdRafKQU.js} +1 -1
- package/dist/chat.d.ts +17 -0
- package/dist/chat.js +2539 -52
- package/dist/database.js +2 -2
- package/dist/databaseId.js +1 -11
- package/dist/databaseTable.js +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -14
- package/dist/modelManage.js +1 -1
- package/dist/package.json +1 -1
- package/dist/sensitive.js +1 -1
- package/dist/streamFilesReader.js +1 -1
- package/dist/worker/pdf.worker1.min.js +23 -0
- package/package.json +6 -6
- package/public/worker/pdf.worker1.min.js +23 -0
- package/scripts/README.md +133 -133
- package/scripts/build-demo.js +88 -88
- package/scripts/demo-selector.js +216 -216
- package/scripts/preview-demo.js +130 -130
- package/scripts/run-demo.bat +34 -34
- package/src/assets/img/close.png +0 -0
- package/src/assets/img/database.png +0 -0
- package/src/assets/img/downLoad.png +0 -0
- package/src/assets/img/graphIcon.png +0 -0
- package/src/assets/img/pdf.png +0 -0
- package/src/assets/img/singleQa.png +0 -0
- package/src/assets/img/webSearch.png +0 -0
- package/src/examples/chat/index.tsx +5 -29
- package/src/main.tsx.backup +5 -5
- package/src/modules/chat/ReferenceBar.tsx +522 -0
- package/src/modules/chat/constants.tsx +29 -6
- package/src/modules/chat/index.tsx +118 -4
- package/src/modules/chat/referenceCom/DeleteModal.tsx +75 -0
- package/src/modules/chat/referenceCom/DrawerContent.tsx +136 -0
- package/src/modules/chat/referenceCom/DrawerDatabase.tsx +110 -0
- package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +86 -0
- package/src/modules/chat/referenceCom/DrawerPreview.tsx +73 -0
- package/src/modules/chat/referenceCom/DrawerTitle.tsx +26 -0
- package/src/modules/chat/referenceCom/RenameModal.tsx +86 -0
- package/src/modules/chat/referenceCom/TagCom.tsx +30 -0
- package/src/modules/chat/style.css +3 -0
- package/src/modules/chat/utils/index.ts +326 -0
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +231 -18
- package/src/utils/testconfigs/index.ts +1 -1
- package/stats.html +1 -1
- package/dist/assets/AppLoading-mci3gLZt.js +0 -414
- package/dist/assets/GientechStreamReader-4496nAm0.js +0 -446
- package/dist/assets/index-Bb8_WB-l.js +0 -1
- package/dist/assets/index-BpJ9Bm5x.js +0 -21
- package/dist/assets/index-CNxDI4h-.js +0 -1078
- package/dist/assets/index-CWzpBU29.js +0 -1
- package/dist/assets/index-D1m34Ij7.js +0 -1429
- package/dist/assets/index-_gBtdXQV.js +0 -585
- package/dist/assets/style4.css +0 -1
package/scripts/preview-demo.js
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawn } from 'child_process';
|
|
4
|
-
import { main, restoreMainFile } from './demo-selector.js';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = path.dirname(__filename);
|
|
10
|
-
|
|
11
|
-
// 检测操作系统
|
|
12
|
-
const isWindows = process.platform === 'win32';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 执行打包
|
|
16
|
-
*/
|
|
17
|
-
function runBuild() {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
console.log('\n🔨 正在执行打包...\n');
|
|
20
|
-
console.log('🔧 调试信息:');
|
|
21
|
-
console.log(' 操作系统:', process.platform);
|
|
22
|
-
console.log(' Windows 模式:', isWindows);
|
|
23
|
-
console.log(' 工作目录:', path.resolve(__dirname, '..'));
|
|
24
|
-
console.log('');
|
|
25
|
-
|
|
26
|
-
const buildProcess = spawn('pnpm', ['run', 'build:app'], {
|
|
27
|
-
stdio: 'inherit',
|
|
28
|
-
shell: isWindows, // Windows 下需要 shell: true
|
|
29
|
-
cwd: path.resolve(__dirname, '..'),
|
|
30
|
-
env: {
|
|
31
|
-
...process.env,
|
|
32
|
-
NODE_OPTIONS: '--max-old-space-size=16384'
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
buildProcess.on('close', (code) => {
|
|
37
|
-
if (code === 0) {
|
|
38
|
-
console.log('\n✅ 打包完成!');
|
|
39
|
-
console.log('📁 输出目录: dist-app/');
|
|
40
|
-
resolve();
|
|
41
|
-
} else {
|
|
42
|
-
console.error(`\n❌ 打包失败 (退出码: ${code})`);
|
|
43
|
-
reject(new Error(`打包失败,退出码: ${code}`));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
buildProcess.on('error', (error) => {
|
|
48
|
-
console.error('❌ 执行打包失败:', error);
|
|
49
|
-
reject(error);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// 处理进程退出信号
|
|
53
|
-
process.on('SIGINT', () => {
|
|
54
|
-
console.log('\n🔄 正在取消打包...');
|
|
55
|
-
buildProcess.kill('SIGINT');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
process.on('SIGTERM', () => {
|
|
59
|
-
console.log('\n🔄 正在取消打包...');
|
|
60
|
-
buildProcess.kill('SIGTERM');
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 启动预览服务
|
|
67
|
-
*/
|
|
68
|
-
function startPreviewServer() {
|
|
69
|
-
console.log('\n🚀 正在启动预览服务器...\n');
|
|
70
|
-
console.log('🔧 调试信息:');
|
|
71
|
-
console.log(' 操作系统:', process.platform);
|
|
72
|
-
console.log(' Windows 模式:', isWindows);
|
|
73
|
-
console.log(' 工作目录:', path.resolve(__dirname, '..'));
|
|
74
|
-
console.log('');
|
|
75
|
-
|
|
76
|
-
const previewProcess = spawn('pnpm', ['run', 'preview:app'], {
|
|
77
|
-
stdio: 'inherit',
|
|
78
|
-
shell: isWindows, // Windows 下需要 shell: true
|
|
79
|
-
cwd: path.resolve(__dirname, '..')
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
previewProcess.on('close', (code) => {
|
|
83
|
-
console.log(`\n🔄 预览服务器已关闭 (退出码: ${code})`);
|
|
84
|
-
restoreMainFile();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
previewProcess.on('error', (error) => {
|
|
88
|
-
console.error('❌ 启动预览服务器失败:', error);
|
|
89
|
-
restoreMainFile();
|
|
90
|
-
process.exit(1);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// 处理进程退出信号
|
|
94
|
-
process.on('SIGINT', () => {
|
|
95
|
-
console.log('\n🔄 正在关闭预览服务器...');
|
|
96
|
-
previewProcess.kill('SIGINT');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
process.on('SIGTERM', () => {
|
|
100
|
-
console.log('\n🔄 正在关闭预览服务器...');
|
|
101
|
-
previewProcess.kill('SIGTERM');
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* 主函数
|
|
107
|
-
*/
|
|
108
|
-
async function runPreviewDemo() {
|
|
109
|
-
try {
|
|
110
|
-
// 先选择示例
|
|
111
|
-
await main();
|
|
112
|
-
|
|
113
|
-
// 执行打包
|
|
114
|
-
await runBuild();
|
|
115
|
-
|
|
116
|
-
// 启动预览服务
|
|
117
|
-
startPreviewServer();
|
|
118
|
-
} catch (error) {
|
|
119
|
-
console.error('❌ 预览模式启动失败:', error);
|
|
120
|
-
restoreMainFile();
|
|
121
|
-
process.exit(1);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 如果直接运行此脚本
|
|
126
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
127
|
-
runPreviewDemo();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export { runPreviewDemo };
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { main, restoreMainFile } from './demo-selector.js';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
// 检测操作系统
|
|
12
|
+
const isWindows = process.platform === 'win32';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 执行打包
|
|
16
|
+
*/
|
|
17
|
+
function runBuild() {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
console.log('\n🔨 正在执行打包...\n');
|
|
20
|
+
console.log('🔧 调试信息:');
|
|
21
|
+
console.log(' 操作系统:', process.platform);
|
|
22
|
+
console.log(' Windows 模式:', isWindows);
|
|
23
|
+
console.log(' 工作目录:', path.resolve(__dirname, '..'));
|
|
24
|
+
console.log('');
|
|
25
|
+
|
|
26
|
+
const buildProcess = spawn('pnpm', ['run', 'build:app'], {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
shell: isWindows, // Windows 下需要 shell: true
|
|
29
|
+
cwd: path.resolve(__dirname, '..'),
|
|
30
|
+
env: {
|
|
31
|
+
...process.env,
|
|
32
|
+
NODE_OPTIONS: '--max-old-space-size=16384'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
buildProcess.on('close', (code) => {
|
|
37
|
+
if (code === 0) {
|
|
38
|
+
console.log('\n✅ 打包完成!');
|
|
39
|
+
console.log('📁 输出目录: dist-app/');
|
|
40
|
+
resolve();
|
|
41
|
+
} else {
|
|
42
|
+
console.error(`\n❌ 打包失败 (退出码: ${code})`);
|
|
43
|
+
reject(new Error(`打包失败,退出码: ${code}`));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
buildProcess.on('error', (error) => {
|
|
48
|
+
console.error('❌ 执行打包失败:', error);
|
|
49
|
+
reject(error);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 处理进程退出信号
|
|
53
|
+
process.on('SIGINT', () => {
|
|
54
|
+
console.log('\n🔄 正在取消打包...');
|
|
55
|
+
buildProcess.kill('SIGINT');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
process.on('SIGTERM', () => {
|
|
59
|
+
console.log('\n🔄 正在取消打包...');
|
|
60
|
+
buildProcess.kill('SIGTERM');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 启动预览服务
|
|
67
|
+
*/
|
|
68
|
+
function startPreviewServer() {
|
|
69
|
+
console.log('\n🚀 正在启动预览服务器...\n');
|
|
70
|
+
console.log('🔧 调试信息:');
|
|
71
|
+
console.log(' 操作系统:', process.platform);
|
|
72
|
+
console.log(' Windows 模式:', isWindows);
|
|
73
|
+
console.log(' 工作目录:', path.resolve(__dirname, '..'));
|
|
74
|
+
console.log('');
|
|
75
|
+
|
|
76
|
+
const previewProcess = spawn('pnpm', ['run', 'preview:app'], {
|
|
77
|
+
stdio: 'inherit',
|
|
78
|
+
shell: isWindows, // Windows 下需要 shell: true
|
|
79
|
+
cwd: path.resolve(__dirname, '..')
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
previewProcess.on('close', (code) => {
|
|
83
|
+
console.log(`\n🔄 预览服务器已关闭 (退出码: ${code})`);
|
|
84
|
+
restoreMainFile();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
previewProcess.on('error', (error) => {
|
|
88
|
+
console.error('❌ 启动预览服务器失败:', error);
|
|
89
|
+
restoreMainFile();
|
|
90
|
+
process.exit(1);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// 处理进程退出信号
|
|
94
|
+
process.on('SIGINT', () => {
|
|
95
|
+
console.log('\n🔄 正在关闭预览服务器...');
|
|
96
|
+
previewProcess.kill('SIGINT');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
process.on('SIGTERM', () => {
|
|
100
|
+
console.log('\n🔄 正在关闭预览服务器...');
|
|
101
|
+
previewProcess.kill('SIGTERM');
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 主函数
|
|
107
|
+
*/
|
|
108
|
+
async function runPreviewDemo() {
|
|
109
|
+
try {
|
|
110
|
+
// 先选择示例
|
|
111
|
+
await main();
|
|
112
|
+
|
|
113
|
+
// 执行打包
|
|
114
|
+
await runBuild();
|
|
115
|
+
|
|
116
|
+
// 启动预览服务
|
|
117
|
+
startPreviewServer();
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error('❌ 预览模式启动失败:', error);
|
|
120
|
+
restoreMainFile();
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 如果直接运行此脚本
|
|
126
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
127
|
+
runPreviewDemo();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { runPreviewDemo };
|
package/scripts/run-demo.bat
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
REM Windows 批处理文件用于运行演示脚本
|
|
3
|
-
REM 使用方法: run-demo.bat [dev-demo|build-demo|preview-demo]
|
|
4
|
-
|
|
5
|
-
set NODE_OPTIONS=--max-old-space-size=16384
|
|
6
|
-
|
|
7
|
-
if "%1"=="" (
|
|
8
|
-
echo 请指定要运行的脚本:
|
|
9
|
-
echo run-demo.bat dev-demo
|
|
10
|
-
echo run-demo.bat build-demo
|
|
11
|
-
echo run-demo.bat preview-demo
|
|
12
|
-
exit /b 1
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
echo 🔧 调试信息:
|
|
16
|
-
echo Node.js 版本:
|
|
17
|
-
node --version
|
|
18
|
-
echo 操作系统: Windows
|
|
19
|
-
echo 当前目录: %CD%
|
|
20
|
-
echo 脚本参数: %1
|
|
21
|
-
echo.
|
|
22
|
-
|
|
23
|
-
node scripts\%1.js
|
|
24
|
-
|
|
25
|
-
if %ERRORLEVEL% neq 0 (
|
|
26
|
-
echo.
|
|
27
|
-
echo ❌ 脚本执行失败,错误代码: %ERRORLEVEL%
|
|
28
|
-
pause
|
|
29
|
-
exit /b %ERRORLEVEL%
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
echo.
|
|
33
|
-
echo ✅ 脚本执行完成
|
|
34
|
-
pause
|
|
1
|
+
@echo off
|
|
2
|
+
REM Windows 批处理文件用于运行演示脚本
|
|
3
|
+
REM 使用方法: run-demo.bat [dev-demo|build-demo|preview-demo]
|
|
4
|
+
|
|
5
|
+
set NODE_OPTIONS=--max-old-space-size=16384
|
|
6
|
+
|
|
7
|
+
if "%1"=="" (
|
|
8
|
+
echo 请指定要运行的脚本:
|
|
9
|
+
echo run-demo.bat dev-demo
|
|
10
|
+
echo run-demo.bat build-demo
|
|
11
|
+
echo run-demo.bat preview-demo
|
|
12
|
+
exit /b 1
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
echo 🔧 调试信息:
|
|
16
|
+
echo Node.js 版本:
|
|
17
|
+
node --version
|
|
18
|
+
echo 操作系统: Windows
|
|
19
|
+
echo 当前目录: %CD%
|
|
20
|
+
echo 脚本参数: %1
|
|
21
|
+
echo.
|
|
22
|
+
|
|
23
|
+
node scripts\%1.js
|
|
24
|
+
|
|
25
|
+
if %ERRORLEVEL% neq 0 (
|
|
26
|
+
echo.
|
|
27
|
+
echo ❌ 脚本执行失败,错误代码: %ERRORLEVEL%
|
|
28
|
+
pause
|
|
29
|
+
exit /b %ERRORLEVEL%
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
echo.
|
|
33
|
+
echo ✅ 脚本执行完成
|
|
34
|
+
pause
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/assets/img/pdf.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -89,14 +89,16 @@ export default function Preview() {
|
|
|
89
89
|
},
|
|
90
90
|
};
|
|
91
91
|
return (
|
|
92
|
-
<div className="w-screen h-screen relative">
|
|
92
|
+
<div className="w-screen h-screen relative overflow-hidden">
|
|
93
|
+
{/* 演示:侧栏折叠/展开开关(调用层触发全局事件) */}
|
|
94
|
+
|
|
93
95
|
<GientechChat
|
|
94
96
|
token={token}
|
|
95
97
|
// sidebar={[]}
|
|
96
98
|
CustomComponents={{
|
|
97
99
|
LogoBox: null,
|
|
98
100
|
}}
|
|
99
|
-
senderConfig={mockSenderConfig}
|
|
101
|
+
//senderConfig={mockSenderConfig}
|
|
100
102
|
appLoadingConfig={{
|
|
101
103
|
// title: '"睿思"智能会话助手',
|
|
102
104
|
subtitle: '让智能对话更简单',
|
|
@@ -104,7 +106,7 @@ export default function Preview() {
|
|
|
104
106
|
url={url}
|
|
105
107
|
styles={parsedStyles}
|
|
106
108
|
eventsEmit={(eventName, data) => {
|
|
107
|
-
console.log('事件触发:',
|
|
109
|
+
console.log('事件触发:', eventName, data);
|
|
108
110
|
setCurFileInfo(data);
|
|
109
111
|
setOpen(true);
|
|
110
112
|
return;
|
|
@@ -146,32 +148,6 @@ export default function Preview() {
|
|
|
146
148
|
productLogo={Logo as unknown as string}
|
|
147
149
|
scrollOld={false}
|
|
148
150
|
/>
|
|
149
|
-
<ConfigProvider
|
|
150
|
-
drawer={{
|
|
151
|
-
styles: {
|
|
152
|
-
body: { padding: 0 },
|
|
153
|
-
header: { display: 'none' },
|
|
154
|
-
},
|
|
155
|
-
}}
|
|
156
|
-
>
|
|
157
|
-
<Drawer
|
|
158
|
-
autoFocus={false}
|
|
159
|
-
onClose={() => setOpen(false)}
|
|
160
|
-
open={open}
|
|
161
|
-
width={600}
|
|
162
|
-
className="overflow-x-hidden"
|
|
163
|
-
destroyOnClose
|
|
164
|
-
afterOpenChange={open => {
|
|
165
|
-
if (!open) {
|
|
166
|
-
setCurFileInfo(null);
|
|
167
|
-
}
|
|
168
|
-
}}
|
|
169
|
-
>
|
|
170
|
-
{drawerType === 'graphPreview' && (
|
|
171
|
-
<DrawerGraphPreview curFileInfo={curFileInfo as any} onClose={() => setOpen(false)} />
|
|
172
|
-
)}
|
|
173
|
-
</Drawer>
|
|
174
|
-
</ConfigProvider>
|
|
175
151
|
</div>
|
|
176
152
|
);
|
|
177
153
|
}
|
package/src/main.tsx.backup
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom/client';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
ReactDOM.createRoot(document.getElementById('root')!).render(<
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import Chat from './examples/chat/index';
|
|
4
|
+
|
|
5
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(<Chat />);
|