feat: add new stores for cron, locale, providers, script, shared data, skills, and user info

- Implemented `cron` store to manage scheduled tasks with CRUD operations.
- Created `locale` store for language settings with persistence and system language detection.
- Added `providers` store to handle provider accounts and configurations with API interactions.
- Developed `script` store for managing automation scripts, including recording and execution.
- Introduced `sharedStore` for managing shared data across components.
- Established `skills` store for fetching, installing, and managing skills from a marketplace.
- Created `userinfo` store for user authentication and session management.

chore: update path aliases from `@store` to `@stores` in TypeScript configuration and Vite config
This commit is contained in:
duanshuwen
2026-04-15 21:49:25 +08:00
parent 364db041eb
commit e77c815a86
32 changed files with 192 additions and 128 deletions

View File

@@ -1,2 +1,7 @@
require('bytenode') "use strict";
require('./main.jsc') require("electron");
require("./main-D4EDpIiu.js");
require("electron-squirrel-startup");
require("electron-log");
require("bytenode");
require("axios");

View File

@@ -1 +1,118 @@
"use strict";const i=require("electron");var n=(e=>(e.EXTERNAL_OPEN="external-open",e.APP_SET_FRAMELESS="app:set-frameless",e.APP_LOAD_PAGE="app:load-page",e.TAB_CREATE="tab:create",e.TAB_LIST="tab:list",e.TAB_NAVIGATE="tab:navigate",e.TAB_RELOAD="tab:reload",e.TAB_BACK="tab:back",e.TAB_FORWARD="tab:forward",e.TAB_SWITCH="tab:switch",e.TAB_CLOSE="tab:close",e.LOG_TO_MAIN="log-to-main",e.READ_FILE="read-file",e.INVOKE="ipc:invoke",e.INVOKE_ASYNC="ipc:invokeAsync",e.APP_MINIMIZE="app:minimize",e.APP_MAXIMIZE="app:maximize",e.APP_QUIT="app:quit",e.FILE_READ="file:read",e.FILE_WRITE="file:write",e.GET_WINDOW_ID="get-window-id",e.CUSTOM_EVENT="custom:event",e.TIME_UPDATE="time:update",e.RENDERER_IS_READY="renderer-ready",e.SHOW_CONTEXT_MENU="show-context-menu",e.START_A_DIALOGUE="start-a-dialogue",e.OPEN_WINDOW="open-window",e.LOG_DEBUG="log-debug",e.LOG_INFO="log-info",e.LOG_WARN="log-warn",e.LOG_ERROR="log-error",e.CONFIG_UPDATED="config-updated",e.SET_CONFIG="set-config",e.GET_CONFIG="get-config",e.UPDATE_CONFIG="update-config",e.SET_THEME_MODE="set-theme-mode",e.GET_THEME_MODE="get-theme-mode",e.IS_DARK_THEME="is-dark-theme",e.THEME_MODE_UPDATED="theme-mode-updated",e.EXECUTE_SCRIPT="execute-script",e.OPEN_CHANNEL="open-channel",e.SCRIPT_LIST="script:list",e.SCRIPT_GET="script:get",e.SCRIPT_SAVE="script:save",e.SCRIPT_DELETE="script:delete",e.SCRIPT_TOGGLE="script:toggle",e.SCRIPT_RUN="script:run",e.SCRIPT_RECORD_START="script:record-start",e.SCRIPT_RECORD_STOP="script:record-stop",e.SCRIPT_CODEGEN="script:codegen",e.GATEWAY_RPC="gateway:rpc",e.GATEWAY_EVENT="gateway:event",e.UPDATE_CHECK="update:check",e.UPDATE_DOWNLOAD="update:download",e.UPDATE_INSTALL="update:install",e.UPDATE_VERSION="update:version",e.UPDATE_STATUS_CHANGED="update:status-changed",e))(n||{});const t={versions:process.versions,external:{open:e=>i.ipcRenderer.invoke("external-open",e)},platform:process.platform,windowMinimize:()=>i.ipcRenderer.invoke("window:minimize"),windowMaximize:()=>i.ipcRenderer.invoke("window:maximize"),windowClose:()=>i.ipcRenderer.invoke("window:close"),windowIsMaximized:()=>i.ipcRenderer.invoke("window:isMaximized"),viewIsReady:()=>i.ipcRenderer.send(n.RENDERER_IS_READY),app:{setFrameless:e=>i.ipcRenderer.invoke(n.APP_SET_FRAMELESS,e),loadPage:e=>i.ipcRenderer.invoke(n.APP_LOAD_PAGE,e)},readFile:e=>i.ipcRenderer.invoke(n.READ_FILE,e),invoke:(e,...r)=>i.ipcRenderer.invoke(e,...r),invokeAsync:(e,...r)=>i.ipcRenderer.invoke(e,...r),on:(e,r)=>{const o=(d,...R)=>r(...R);return i.ipcRenderer.on(e,o),()=>i.ipcRenderer.removeListener(e,o)},send:(e,...r)=>i.ipcRenderer.send(e,...r),getCurrentWindowId:()=>i.ipcRenderer.sendSync(n.GET_WINDOW_ID),logger:{debug:(e,...r)=>i.ipcRenderer.send(n.LOG_DEBUG,e,...r),info:(e,...r)=>i.ipcRenderer.send(n.LOG_INFO,e,...r),warn:(e,...r)=>i.ipcRenderer.send(n.LOG_WARN,e,...r),error:(e,...r)=>i.ipcRenderer.send(n.LOG_ERROR,e,...r)},executeScript:e=>i.ipcRenderer.invoke(n.EXECUTE_SCRIPT,e),openChannel:e=>i.ipcRenderer.invoke(n.OPEN_CHANNEL,e),scriptApi:{list:()=>i.ipcRenderer.invoke(n.SCRIPT_LIST),get:e=>i.ipcRenderer.invoke(n.SCRIPT_GET,e),save:e=>i.ipcRenderer.invoke(n.SCRIPT_SAVE,e),delete:e=>i.ipcRenderer.invoke(n.SCRIPT_DELETE,e),toggle:(e,r)=>i.ipcRenderer.invoke(n.SCRIPT_TOGGLE,e,r),run:e=>i.ipcRenderer.invoke(n.SCRIPT_RUN,e),startRecording:e=>i.ipcRenderer.invoke(n.SCRIPT_RECORD_START,e),stopRecording:()=>i.ipcRenderer.invoke(n.SCRIPT_RECORD_STOP),codegen:(e,r)=>i.ipcRenderer.invoke(n.SCRIPT_CODEGEN,e,r)}};i.contextBridge.exposeInMainWorld("api",t); "use strict";
const electron = require("electron");
var IPC_EVENTS = /* @__PURE__ */ ((IPC_EVENTS2) => {
IPC_EVENTS2["EXTERNAL_OPEN"] = "external-open";
IPC_EVENTS2["APP_SET_FRAMELESS"] = "app:set-frameless";
IPC_EVENTS2["APP_LOAD_PAGE"] = "app:load-page";
IPC_EVENTS2["TAB_CREATE"] = "tab:create";
IPC_EVENTS2["TAB_LIST"] = "tab:list";
IPC_EVENTS2["TAB_NAVIGATE"] = "tab:navigate";
IPC_EVENTS2["TAB_RELOAD"] = "tab:reload";
IPC_EVENTS2["TAB_BACK"] = "tab:back";
IPC_EVENTS2["TAB_FORWARD"] = "tab:forward";
IPC_EVENTS2["TAB_SWITCH"] = "tab:switch";
IPC_EVENTS2["TAB_CLOSE"] = "tab:close";
IPC_EVENTS2["LOG_TO_MAIN"] = "log-to-main";
IPC_EVENTS2["READ_FILE"] = "read-file";
IPC_EVENTS2["INVOKE"] = "ipc:invoke";
IPC_EVENTS2["INVOKE_ASYNC"] = "ipc:invokeAsync";
IPC_EVENTS2["APP_MINIMIZE"] = "app:minimize";
IPC_EVENTS2["APP_MAXIMIZE"] = "app:maximize";
IPC_EVENTS2["APP_QUIT"] = "app:quit";
IPC_EVENTS2["FILE_READ"] = "file:read";
IPC_EVENTS2["FILE_WRITE"] = "file:write";
IPC_EVENTS2["GET_WINDOW_ID"] = "get-window-id";
IPC_EVENTS2["CUSTOM_EVENT"] = "custom:event";
IPC_EVENTS2["TIME_UPDATE"] = "time:update";
IPC_EVENTS2["RENDERER_IS_READY"] = "renderer-ready";
IPC_EVENTS2["SHOW_CONTEXT_MENU"] = "show-context-menu";
IPC_EVENTS2["START_A_DIALOGUE"] = "start-a-dialogue";
IPC_EVENTS2["OPEN_WINDOW"] = "open-window";
IPC_EVENTS2["LOG_DEBUG"] = "log-debug";
IPC_EVENTS2["LOG_INFO"] = "log-info";
IPC_EVENTS2["LOG_WARN"] = "log-warn";
IPC_EVENTS2["LOG_ERROR"] = "log-error";
IPC_EVENTS2["CONFIG_UPDATED"] = "config-updated";
IPC_EVENTS2["SET_CONFIG"] = "set-config";
IPC_EVENTS2["GET_CONFIG"] = "get-config";
IPC_EVENTS2["UPDATE_CONFIG"] = "update-config";
IPC_EVENTS2["SET_THEME_MODE"] = "set-theme-mode";
IPC_EVENTS2["GET_THEME_MODE"] = "get-theme-mode";
IPC_EVENTS2["IS_DARK_THEME"] = "is-dark-theme";
IPC_EVENTS2["THEME_MODE_UPDATED"] = "theme-mode-updated";
IPC_EVENTS2["EXECUTE_SCRIPT"] = "execute-script";
IPC_EVENTS2["OPEN_CHANNEL"] = "open-channel";
IPC_EVENTS2["SCRIPT_LIST"] = "script:list";
IPC_EVENTS2["SCRIPT_GET"] = "script:get";
IPC_EVENTS2["SCRIPT_SAVE"] = "script:save";
IPC_EVENTS2["SCRIPT_DELETE"] = "script:delete";
IPC_EVENTS2["SCRIPT_TOGGLE"] = "script:toggle";
IPC_EVENTS2["SCRIPT_RUN"] = "script:run";
IPC_EVENTS2["SCRIPT_RECORD_START"] = "script:record-start";
IPC_EVENTS2["SCRIPT_RECORD_STOP"] = "script:record-stop";
IPC_EVENTS2["SCRIPT_CODEGEN"] = "script:codegen";
IPC_EVENTS2["GATEWAY_RPC"] = "gateway:rpc";
IPC_EVENTS2["GATEWAY_EVENT"] = "gateway:event";
IPC_EVENTS2["UPDATE_CHECK"] = "update:check";
IPC_EVENTS2["UPDATE_DOWNLOAD"] = "update:download";
IPC_EVENTS2["UPDATE_INSTALL"] = "update:install";
IPC_EVENTS2["UPDATE_VERSION"] = "update:version";
IPC_EVENTS2["UPDATE_STATUS_CHANGED"] = "update:status-changed";
return IPC_EVENTS2;
})(IPC_EVENTS || {});
const api = {
versions: process.versions,
external: {
open: (url) => electron.ipcRenderer.invoke("external-open", url)
},
platform: process.platform,
windowMinimize: () => electron.ipcRenderer.invoke("window:minimize"),
windowMaximize: () => electron.ipcRenderer.invoke("window:maximize"),
windowClose: () => electron.ipcRenderer.invoke("window:close"),
windowIsMaximized: () => electron.ipcRenderer.invoke("window:isMaximized"),
viewIsReady: () => electron.ipcRenderer.send(IPC_EVENTS.RENDERER_IS_READY),
app: {
setFrameless: (route) => electron.ipcRenderer.invoke(IPC_EVENTS.APP_SET_FRAMELESS, route),
loadPage: (page) => electron.ipcRenderer.invoke(IPC_EVENTS.APP_LOAD_PAGE, page)
},
// 通过 IPC 调用主进程
readFile: (filePath) => electron.ipcRenderer.invoke(IPC_EVENTS.READ_FILE, filePath),
// 异步调用(映射为 electron 的 invoke)
invoke: (channel, ...args) => electron.ipcRenderer.invoke(channel, ...args),
// 异步调用(为了兼容老代码)
invokeAsync: (channel, ...args) => electron.ipcRenderer.invoke(channel, ...args),
// 监听主进程消息
on: (event, callback) => {
const subscription = (_event, ...args) => callback(...args);
electron.ipcRenderer.on(event, subscription);
return () => electron.ipcRenderer.removeListener(event, subscription);
},
// 发送消息到主进程
send: (channel, ...args) => electron.ipcRenderer.send(channel, ...args),
// 获取窗口ID
getCurrentWindowId: () => electron.ipcRenderer.sendSync(IPC_EVENTS.GET_WINDOW_ID),
// 发送日志
logger: {
debug: (message, ...meta) => electron.ipcRenderer.send(IPC_EVENTS.LOG_DEBUG, message, ...meta),
info: (message, ...meta) => electron.ipcRenderer.send(IPC_EVENTS.LOG_INFO, message, ...meta),
warn: (message, ...meta) => electron.ipcRenderer.send(IPC_EVENTS.LOG_WARN, message, ...meta),
error: (message, ...meta) => electron.ipcRenderer.send(IPC_EVENTS.LOG_ERROR, message, ...meta)
},
// 执行脚本
executeScript: (params) => electron.ipcRenderer.invoke(IPC_EVENTS.EXECUTE_SCRIPT, params),
// 打开渠道
openChannel: (channels) => electron.ipcRenderer.invoke(IPC_EVENTS.OPEN_CHANNEL, channels),
// 脚本管理
scriptApi: {
list: () => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_LIST),
get: (id) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_GET, id),
save: (input) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_SAVE, input),
delete: (id) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_DELETE, id),
toggle: (id, enabled) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_TOGGLE, id, enabled),
run: (id) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_RUN, id),
startRecording: (url) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_RECORD_START, url),
stopRecording: () => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_RECORD_STOP),
codegen: (id, url) => electron.ipcRenderer.invoke(IPC_EVENTS.SCRIPT_CODEGEN, id, url)
}
};
electron.contextBridge.exposeInMainWorld("api", api);

2
global.d.ts vendored
View File

@@ -221,7 +221,7 @@ declare module "*.vue" {
export default component export default component
} }
declare module "@store/*"; declare module "@stores/*";
declare module "@service/*"; declare module "@service/*";
declare module "@utils/*"; declare module "@utils/*";
declare module "@assets/images/*"; declare module "@assets/images/*";

View File

@@ -9,7 +9,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted } from 'vue' import { onMounted } from 'vue'
import { useThemeStore } from '@src/stores/theme' import { useThemeStore } from '@src/stores/theme'
import { useLocaleStore } from '@src/store/locale' import { useLocaleStore } from '@src/stores/locale'
// 初始化主题和语言设置 // 初始化主题和语言设置
const themeStore = useThemeStore() const themeStore = useThemeStore()

View File

@@ -1,74 +0,0 @@
<template>
<div class="task p-[12px]">
<div class="flex border border-[#BEDBFF] dark:border-[#2a2a2d] h-[48px] p-[4px] rounded-[10px] bg-[#EFF6FF] dark:bg-[#1f1f22] task-tab">
<div v-for="item in tabs" :key="item.value" class="flex-1 flex text-center items-center h-full align-middle text" :class="active === item.value && 'active'" @click="changeTab(item.value)">
<div class="flex-1">{{ item.name }}<span v-if="item.total">{{`${item.total > 98 && item.total + '+' || item.total}`}}</span></div>
</div>
</div>
<div class="flex justify-between mt-[12px] mb-[12px] text-[14px]">
<div class="text-[#171717] dark:text-gray-100">今天</div>
<div class="text-[#99A0AE] dark:text-gray-500">02:32:05</div>
</div>
<div>
<TaskCard />
</div>
</div>
</template>
<script setup lang="ts">
import TaskCard from './Card.vue';
import { ref, reactive } from "vue";
const tabs = reactive([{
name: '待处理',
value: 1,
total: 10,
},{
name: '已处理',
value: 2,
total: 99,
}])
const active = ref(1);
const changeTab = (val:number) => {
active.value = val;
};
</script>
<style scoped>
.task-tab .text {
color: #525866;
font-size: 14px;
cursor: pointer;
}
:global(.dark) .task-tab .text {
color: #9ca3af;
}
.task-tab .active {
position: relative;
color: #2B7FFF;
background: #FFFFFF;
border-radius: 8px;
}
:global(.dark) .task-tab .active {
color: #2B7FFF;
background: #1f1f22;
}
.task-tab .active::after {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
content: '';
border-radius: 8px;
border: 1px solid #2B7FFF;
}
:global(.dark) .task-tab .active::after {
border: 1px solid #2B7FFF;
}
</style>

View File

@@ -1,25 +1,38 @@
<template> <template>
<div class="task-list w-[392px] h-full rounded-[16px] bg-white dark:bg-[#1b1b1d]"> <div class="task p-3">
<slot> <div class="flex border border-[#BEDBFF] dark:border-[#2a2a2d] h-12 p-1 rounded-[10px] bg-[#EFF6FF] dark:bg-[#1f1f22] task-tab">
<TaskList /> <div v-for="item in tabs" :key="item.value" class="flex-1 flex text-center items-center h-full align-middle text" :class="active === item.value && 'active'" @click="changeTab(item.value)">
</slot> <div class="flex-1">{{ item.name }}<span v-if="item.total">{{`${item.total > 98 && item.total + '+' || item.total}`}}</span></div>
</div>
</div>
<div class="flex justify-between mt-3 mb-3 text-[14px]">
<div class="text-[#171717] dark:text-gray-100">今天</div>
<div class="text-[#99A0AE] dark:text-gray-500">02:32:05</div>
</div>
<div>
<Card />
</div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import TaskList from './List.vue'; import Card from './Card.vue';
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
const tabs = reactive([{
name: '待处理', const tabs = reactive([
value: 1, {
total: 10, name: '待处理',
}, { value: 1,
name: '已处理', total: 10,
value: 2, },
total: 99, {
}]) name: '已处理',
value: 2,
total: 99,
}
])
const active = ref(1); const active = ref(1);
const changeTab = (val: number) => { const changeTab = (val:number) => {
active.value = val; active.value = val;
}; };
</script> </script>

View File

@@ -1,5 +1,5 @@
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useLocaleStore } from '@src/store/locale'; import { useLocaleStore } from '@src/stores/locale';
import { SUPPORTED_LANGUAGES, type LanguageCode, type Namespace } from '@src/i18n/constants'; import { SUPPORTED_LANGUAGES, type LanguageCode, type Namespace } from '@src/i18n/constants';
/** /**

View File

@@ -192,7 +192,7 @@ import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { Plus, Loading, Check, Warning, Close, TopRight } from '@element-plus/icons-vue'; import { Plus, Loading, Check, Warning, Close, TopRight } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { useProviderStore } from '@src/store/providers'; import { useProviderStore } from '@src/stores/providers';
import { PROVIDER_TYPE_INFO, type ProviderTypeInfo } from '@lib/providers'; import { PROVIDER_TYPE_INFO, type ProviderTypeInfo } from '@lib/providers';
import type { ProviderListItem } from '@lib/provider-accounts'; import type { ProviderListItem } from '@lib/provider-accounts';

View File

@@ -115,7 +115,7 @@ import {
RiErrorWarningLine, RiErrorWarningLine,
RiTimeLine, RiTimeLine,
} from '@remixicon/vue'; } from '@remixicon/vue';
import { useCronStore } from '@src/store/cron'; import { useCronStore } from '@src/stores/cron';
import type { CronJob, CronJobCreateInput } from '@lib/cron-types'; import type { CronJob, CronJobCreateInput } from '@lib/cron-types';
import CronStats from './components/CronStats.vue'; import CronStats from './components/CronStats.vue';
import CronJobCard from './components/CronJobCard.vue'; import CronJobCard from './components/CronJobCard.vue';

View File

@@ -49,8 +49,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, nextTick, onMounted } from 'vue' import { ref, computed, watch, nextTick, onMounted } from 'vue'
import { useChatStore } from '@store/chat' import { useChatStore } from '@stores/chat'
import { stageBuffer } from '@store/chat' import { stageBuffer } from '@stores/chat'
import type { RawMessage, AttachedFileMeta } from './model/ChatModel' import type { RawMessage, AttachedFileMeta } from './model/ChatModel'
import { extractText, extractImages } from './model/ChatModel' import { extractText, extractImages } from './model/ChatModel'

View File

@@ -90,7 +90,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, onBeforeUnmount } from 'vue' import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
import { RiSideBarLine, RiSidebarFoldLine, RiAddLine } from '@remixicon/vue' import { RiSideBarLine, RiSidebarFoldLine, RiAddLine } from '@remixicon/vue'
import { useChatStore } from '@store/chat' import { useChatStore } from '@stores/chat'
const chatStore = useChatStore() const chatStore = useChatStore()

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="task p-[12px]"> <div class="task p-3">
<div class="flex border border-[#BEDBFF] dark:border-[#2a2a2d] h-[48px] p-[4px] rounded-[10px] bg-[#EFF6FF] dark:bg-[#222225] task-tab"> <div class="flex border border-[#BEDBFF] dark:border-[#2a2a2d] h-[48px] p-[4px] rounded-[10px] bg-[#EFF6FF] dark:bg-[#222225] task-tab">
<div v-for="item in tabs" :key="item.value" class="flex-1 flex text-center items-center h-full align-middle text" :class="active === item.value && 'active'" @click="changeTab(item.value)"> <div v-for="item in tabs" :key="item.value" class="flex-1 flex text-center items-center h-full align-middle text" :class="active === item.value && 'active'" @click="changeTab(item.value)">
<div class="flex-1">{{ item.name }}<span v-if="item.total">{{`${item.total > 98 && item.total + '+' || item.total}`}}</span></div> <div class="flex-1">{{ item.name }}<span v-if="item.total">{{`${item.total > 98 && item.total + '+' || item.total}`}}</span></div>
@@ -15,15 +15,18 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
const tabs = reactive([{ const tabs = reactive([
name: '待处理', {
value: 1, name: '待处理',
total: 10, value: 1,
},{ total: 10,
name: '已处理', },
value: 2, {
total: 99, name: '已处理',
}]) value: 2,
total: 99,
}
])
const active = ref(1); const active = ref(1);
const changeTab = (val:number) => { const changeTab = (val:number) => {
active.value = val; active.value = val;

View File

@@ -144,7 +144,7 @@ import {
extractToolUse, extractToolUse,
} from '../../model/ChatModel' } from '../../model/ChatModel'
import { useChatStore } from '@store/chat' import { useChatStore } from '@stores/chat'
import ChatAvatar from '../ChatAvatar.vue' import ChatAvatar from '../ChatAvatar.vue'
import ChatAttach from '../ChatAttach.vue' import ChatAttach from '../ChatAttach.vue'
import ChatAIMark from '../ChatAIMark.vue' import ChatAIMark from '../ChatAIMark.vue'

View File

@@ -6,7 +6,7 @@
<ChatBox class="flex-1" /> <ChatBox class="flex-1" />
<TaskCenter /> <TaskCenter />
</div> </div>
<Task class="w-[392px] h-full rounded-[16px] bg-white dark:bg-[#1b1b1d]" /> <TaskList class="w-98 h-full rounded-2xl bg-white dark:bg-[#1b1b1d]" />
</div> </div>
<TaskOperationDialog ref="taskOperationDialog" /> <TaskOperationDialog ref="taskOperationDialog" />
@@ -15,13 +15,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onBeforeUnmount } from 'vue' import { ref, onMounted, onBeforeUnmount } from 'vue'
import Task from './components/Task.vue' import TaskList from '../../components/TaskList/index.vue'
import TaskOperationDialog from './components/TaskOperationDialog.vue' import TaskOperationDialog from './components/TaskOperationDialog.vue'
import ChatHistory from './ChatHistory.vue' import ChatHistory from './ChatHistory.vue'
import ChatBox from './ChatBox.vue' import ChatBox from './ChatBox.vue'
import TaskCenter from './TaskCenter.vue' import TaskCenter from './TaskCenter.vue'
import { useChatStore } from '@store/chat' import { useChatStore } from '@stores/chat'
import { useProviderStore } from '@store/providers' import { useProviderStore } from '@stores/providers'
import emitter from '@src/utils/emitter' import emitter from '@src/utils/emitter'
const chatStore = useChatStore() const chatStore = useChatStore()

View File

@@ -45,7 +45,7 @@
<!-- 登录按钮 --> <!-- 登录按钮 -->
<button type="button" <button type="button"
class="w-full py-2 bg-blue-600 cursor-pointer text-white rounded-lg hover:bg-blue-700 disabled:bg-blue-300" class="w-full py-2 bg-blue-600 cursor-pointer text-white rounded-lg hover:bg-blue-700 disabled:bg-blue-300 mt-4"
:loading="loading" @click="onSubmit"> :loading="loading" @click="onSubmit">
{{ t('login.loginButton') }} {{ t('login.loginButton') }}
</button> </button>
@@ -65,7 +65,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, computed } from "vue" import { reactive, ref, onMounted, computed } from "vue"
import { useUserStore } from "../../store/userinfo" import { useUserStore } from "../../stores/userinfo"
import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue' import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue'
import { generateUUID } from "../../utils/generateUUID" import { generateUUID } from "../../utils/generateUUID"
import { rule } from '../../utils/validate' import { rule } from '../../utils/validate'

View File

@@ -149,7 +149,7 @@ import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript'; import { javascript } from '@codemirror/lang-javascript';
import { oneDark } from '@codemirror/theme-one-dark'; import { oneDark } from '@codemirror/theme-one-dark';
import type { AutomationScript, ScriptSaveInput } from '@lib/script-types'; import type { AutomationScript, ScriptSaveInput } from '@lib/script-types';
import { useScriptStore } from '@src/store/script'; import { useScriptStore } from '@src/stores/script';
import { channels } from '@constant/channel'; import { channels } from '@constant/channel';
const { t } = useI18n(); const { t } = useI18n();

View File

@@ -153,7 +153,7 @@ import {
RiErrorWarningLine, RiErrorWarningLine,
RiCodeLine, RiCodeLine,
} from '@remixicon/vue'; } from '@remixicon/vue';
import { useScriptStore } from '@src/store/script'; import { useScriptStore } from '@src/stores/script';
import type { AutomationScript, ScriptSaveInput } from '@lib/script-types'; import type { AutomationScript, ScriptSaveInput } from '@lib/script-types';
import ScriptCard from './components/ScriptCard.vue'; import ScriptCard from './components/ScriptCard.vue';
import ScriptEditorDialog from './components/ScriptEditorDialog.vue'; import ScriptEditorDialog from './components/ScriptEditorDialog.vue';

View File

@@ -158,7 +158,7 @@ import TitleSection from '@src/components/TitleSection/index.vue'
import { useThemeStore } from '@src/stores/theme' import { useThemeStore } from '@src/stores/theme'
import { useUpdateStore } from '@src/stores/update' import { useUpdateStore } from '@src/stores/update'
import { RiSunLine, RiMoonLine, RiComputerLine, RiRefreshLine } from '@remixicon/vue' import { RiSunLine, RiMoonLine, RiComputerLine, RiRefreshLine } from '@remixicon/vue'
import { useLocaleStore } from '@src/store/locale' import { useLocaleStore } from '@src/stores/locale'
import type { LanguageCode } from '@src/i18n/constants' import type { LanguageCode } from '@src/i18n/constants'
import { SUPPORTED_LANGUAGES } from '@src/i18n/constants' import { SUPPORTED_LANGUAGES } from '@src/i18n/constants'

View File

@@ -94,7 +94,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
import type { MarketplaceSkill, Skill } from '@src/lib/skills-types' import type { MarketplaceSkill, Skill } from '@src/lib/skills-types'
import { SEARCH_ERROR_CODES } from '@src/store/skills' import { SEARCH_ERROR_CODES } from '@src/stores/skills'
import { apiGetSkillsDir } from '@src/lib/skills-api' import { apiGetSkillsDir } from '@src/lib/skills-api'
import { RiSearchLine, RiCloseLine, RiErrorWarningLine, RiRefreshLine, RiDeleteBinLine, RiArchiveLine } from '@remixicon/vue' import { RiSearchLine, RiCloseLine, RiErrorWarningLine, RiRefreshLine, RiDeleteBinLine, RiArchiveLine } from '@remixicon/vue'

View File

@@ -129,7 +129,7 @@ import { resolveSkillSourceLabel } from '@src/lib/skills-utils'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { RiLockLine, RiKeyLine, RiFileCopyLine, RiFolderOpenLine, RiGlobalLine, RiFileCodeLine } from '@remixicon/vue' import { RiLockLine, RiKeyLine, RiFileCopyLine, RiFolderOpenLine, RiGlobalLine, RiFileCodeLine } from '@remixicon/vue'
import EnvVarManager from './EnvVarManager.vue' import EnvVarManager from './EnvVarManager.vue'
import { useSkillsStore } from '@src/store/skills' import { useSkillsStore } from '@src/stores/skills'
const props = defineProps<{ const props = defineProps<{
skill: Skill | null skill: Skill | null

View File

@@ -165,7 +165,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue' import { ref, computed, watch, onMounted } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useSkillsStore, FETCH_ERROR_CODES } from '@src/store/skills' import { useSkillsStore, FETCH_ERROR_CODES } from '@src/stores/skills'
import { MOCK_SKILLS, MOCK_MARKETPLACE } from '@src/lib/skills-api' import { MOCK_SKILLS, MOCK_MARKETPLACE } from '@src/lib/skills-api'
import type { Skill, MarketplaceSkill } from '@src/lib/skills-types' import type { Skill, MarketplaceSkill } from '@src/lib/skills-types'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'

View File

@@ -8,7 +8,7 @@ import type {
import { extractText, isToolOnlyMessage, isToolResultRole, isInternalMessage } from '@src/pages/home/model/ChatModel' import { extractText, isToolOnlyMessage, isToolResultRole, isInternalMessage } from '@src/pages/home/model/ChatModel'
import { hostApiFetch } from '@lib/host-api' import { hostApiFetch } from '@lib/host-api'
import { gatewayRpc, onGatewayEvent } from '@lib/gateway-client' import { gatewayRpc, onGatewayEvent } from '@lib/gateway-client'
import { useProviderStore } from '@store/providers' import { useProviderStore } from '@stores/providers'
// ── Constants ─────────────────────────────────────────────────── // ── Constants ───────────────────────────────────────────────────
const DEFAULT_SESSION_KEY = 'agent:main:main' const DEFAULT_SESSION_KEY = 'agent:main:main'

View File

@@ -29,7 +29,7 @@
"@src/*": ["src/*"], "@src/*": ["src/*"],
"@api/*": ["src/api/*"], "@api/*": ["src/api/*"],
"@shared/*": ["src/shared/*"], "@shared/*": ["src/shared/*"],
"@store/*": ["src/store/*"], "@stores/*": ["src/stores/*"],
"@constant/*": ["src/constant/*"], "@constant/*": ["src/constant/*"],
"@utils/*": ["src/utils/*"], "@utils/*": ["src/utils/*"],
"@lib/*": ["src/lib/*"], "@lib/*": ["src/lib/*"],

View File

@@ -10,7 +10,7 @@
"@src/*": ["src/*"], "@src/*": ["src/*"],
"@api/*": ["src/api/*"], "@api/*": ["src/api/*"],
"@shared/*": ["src/shared/*"], "@shared/*": ["src/shared/*"],
"@store/*": ["src/store/*"], "@stores/*": ["src/stores/*"],
"@constant/*": ["src/constant/*"], "@constant/*": ["src/constant/*"],
"@utils/*": ["src/utils/*"], "@utils/*": ["src/utils/*"],
"@lib/*": ["src/lib/*"], "@lib/*": ["src/lib/*"],

View File

@@ -14,7 +14,7 @@ function isMainProcessExternal(id: string): boolean {
// Project-specific aliases that should be bundled (not external) // Project-specific aliases that should be bundled (not external)
const internalAliases = [ const internalAliases = [
'@lib/', '@electron/', '@src/', '@locales/', '@service/', '@utils/', '@lib/', '@electron/', '@src/', '@locales/', '@service/', '@utils/',
'@assets/', '@api/', '@constant/', '@components/', '@hooks/', '@store/', '@shared/' '@assets/', '@api/', '@constant/', '@components/', '@hooks/', '@stores/', '@shared/'
]; ];
// Check if the ID starts with any internal alias // Check if the ID starts with any internal alias
@@ -135,7 +135,7 @@ export default defineConfig(({ mode, command }) => {
"@constant": resolve(__dirname, "./src/constant"), "@constant": resolve(__dirname, "./src/constant"),
"@components": resolve(__dirname, "./src/components"), "@components": resolve(__dirname, "./src/components"),
"@hooks": resolve(__dirname, "./src/hooks"), "@hooks": resolve(__dirname, "./src/hooks"),
"@store": resolve(__dirname, "./src/store"), "@stores": resolve(__dirname, "./src/stores"),
"@utils": resolve(__dirname, "./src/utils"), "@utils": resolve(__dirname, "./src/utils"),
"@shared": resolve(__dirname, "./src/shared"), "@shared": resolve(__dirname, "./src/shared"),
"@locales": resolve(__dirname, "./src/i18n/locales"), "@locales": resolve(__dirname, "./src/i18n/locales"),