dsh模块、快捷键调整

This commit is contained in:
zhongluofeng committed 2026-09-28 18:05:29 +08:00
1 parent ff1d5cd517
commit 7e65825d3e
54 files changed
+7082 -109

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
import type { ModuleConfig } from '@/types/module'
import type { SearchIndexItem } from '@/stores/searchIndex'
const searchItems: SearchIndexItem[] = [
{
title: 'DeepSeek Harness',
description: '安装、更新与启动 dsh,管理 Node 运行环境与 AI 通道',
keywords: ['dsh', 'deepseek', 'harness', 'agent', '智能体', '外壳', '安装'],
tab: 'setup'
},
{
title: '安装 dsh 环境',
description: '按步骤引导安装 Node 运行环境与 dsh 本体',
keywords: ['安装', 'install', 'node', '环境', '引导', 'stepper', '更新'],
tab: 'setup'
},
{
title: 'dsh 设置',
description: '端口、工作区、Node 来源、镜像源与自动启动',
keywords: ['设置', 'setting', '端口', 'port', '工作区', 'workspace', '镜像'],
tab: 'settings'
},
{
title: 'dsh AI 通道',
description: '把设置里的 AI 供应商(含 DeepSeek API Key)同步给 dsh',
keywords: ['ai', 'api key', 'deepseek', '供应商', 'provider', '模型', 'model'],
tab: 'settings'
},
{
title: 'dsh 运行日志',
description: '查看 dsh 服务的输出日志',
keywords: ['日志', 'log', '输出', '排查', 'debug'],
tab: 'logs'
}
]
export const moduleConfig: ModuleConfig = {
id: 'dsh',
name: 'DeepSeek Harness',
icon: 'dsh',
description: 'DeepSeek Harness(dsh)外壳:环境安装引导、版本更新与 Web 服务生命周期管理',
category: 'tool',
defaultEnabled: true,
loader: () => import('./DshModule.vue'),
searchItems,
lifecycle: {
// 模块启用:恢复全局快捷键(应用启动时由 main.ts 注册;这里覆盖「先禁用再启用」)
onEnable: async () => {
try {
const { useDshStore } = await import('@/stores/dshStore')
await useDshStore().registerShortcut()
} catch (e) {
console.error('[dsh] onEnable 注册快捷键失败:', e)
}
},
// 模块禁用:停服务 + 注销快捷键(服务停了快捷键也没意义,且组合键不该被占着)
onDisable: async () => {
// 动态导入避免 index.ts 直接依赖 store(会形成循环依赖,参见 terminal / music 的处理)
try {
const { useDshStore } = await import('@/stores/dshStore')
const store = useDshStore()
if (store.running) await store.stop()
await store.unregisterShortcut()
store.stopListeners()
} catch (e) {
console.error('[dsh] onDisable 停止服务失败:', e)
}
}
},
// 排在开发工具之后:音乐 / 代理 / 下载 / 终端 / 翻译 / 监控 / 截图 / 剪贴板 / 快捷面板 / 开发工具 / dsh
order: 110
}