feat: implement task management store with IPC integration

- Added a new task store in `src-react/stores/task.ts` to manage tasks and their statuses.
- Implemented functions for creating, executing, and retrying tasks, along with handling task progress and completion.
- Introduced persistence for tasks using IPC.
- Created utility functions for normalizing room types and building subtasks.
- Added a new CSS file for global styles in `src-react/styles.css`.
- Created runtime types in `src-react/types/runtime.ts` and exported them.
- Updated the main entry points for Vue and React applications to support dynamic framework loading.
- Refactored chat model interfaces and utility functions into `src/shared/chat-model.ts`.
- Updated TypeScript configuration to include paths for React components and types.
- Enhanced Vite configuration to support both Vue and React frameworks.
This commit is contained in:
duanshuwen
2026-04-17 07:09:56 +08:00
parent d233b94b2a
commit b1dea9a5c2
68 changed files with 5910 additions and 397 deletions

View File

@@ -3,6 +3,7 @@ import { resolve } from 'path';
import electron from 'vite-plugin-electron';
import renderer from 'vite-plugin-electron-renderer';
import vue from '@vitejs/plugin-vue';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import autoImport from 'unplugin-auto-import/vite';
import electronBytecode from './plugins/bytenode/vite-plugin-electron-encrypt';
@@ -33,6 +34,8 @@ function isMainProcessExternal(id: string): boolean {
export default defineConfig(({ mode, command }) => {
// Determine if we're in development mode
const isDev = mode === 'development';
const uiFramework = process.env.VITE_UI_FRAMEWORK ?? 'react';
const isVueUI = uiFramework === 'vue';
// Development server URL - in dev mode, this will be the Vite dev server URL
// In production, this should be undefined
@@ -49,11 +52,11 @@ export default defineConfig(({ mode, command }) => {
plugins: [
vue(),
tailwindcss(),
autoImport({
...(isVueUI ? [autoImport({
imports: ['vue', 'vue-router', 'pinia', 'vue-i18n', '@vueuse/core'],
dts: 'src/auto-imports.d.ts'
}),
})] : [react()]),
tailwindcss(),
electron([
{
// Main process entry file
@@ -77,16 +80,6 @@ export default defineConfig(({ mode, command }) => {
exclude: ['**/electron/scripts/**', '**/scripts.meta.json'],
},
},
resolve: {
alias: {
"@electron": resolve(__dirname, "./electron"),
"@lib": resolve(__dirname, "./src/lib"),
"@src": resolve(__dirname, "./src"),
"@locales": resolve(__dirname, "./src/i18n/locales"),
"@service": resolve(__dirname, "./electron/service"),
"@utils": resolve(__dirname, "./electron/utils"),
},
},
},
},
{
@@ -129,6 +122,7 @@ export default defineConfig(({ mode, command }) => {
resolve: {
alias: {
"@src": resolve(__dirname, "./src"),
"@src-react": resolve(__dirname, "./src-react"),
"@api": resolve(__dirname, "./src/api"),
"@assets": resolve(__dirname, "./src/assets"),
"@lib": resolve(__dirname, "./src/lib"),
@@ -162,4 +156,4 @@ export default defineConfig(({ mode, command }) => {
emptyOutDir: true,
},
}
});
});