DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
refactor(utils): refactoring tool modules and unifying all import paths
hairyf8e64c4f15567
diff --git a/docs/testing/checklist.md b/docs/testing/checklist.mdindex e94498e9..522da3df 100644--- a/docs/testing/checklist.md+++ b/docs/testing/checklist.md@@ -23,7 +23,7 @@- [ ] `service/cli`(Rust):`shim` 生成、`path` 注册、`core` 探测单测(含 `%`→`%%`、`'`→`'\''` 转义)。- [ ] `service/update` / `service/workflow`(Rust):自更新、进程生命周期、`status`、`utils` 单测。- [ ] `task/scheduler`(Rust):健康检查轮询逻辑单测。-- [ ] 前端 `utils`:`iframe-origin`、`logger`、`toast` 单测。+- [ ] 前端 `utils`:`iframe`、`logger`、`toast` 单测。- [ ] 前端 `config/client`:`invoke` 封装与命令参数单测。- 标签:`unit-test`、`backend-test`/`frontend-test`- 估算:每组件 0.5–1 点diff --git a/src/components/config-core.tsx b/src/components/config-core.tsxindex 37f961e8..1b644c34 100644--- a/src/components/config-core.tsx+++ b/src/components/config-core.tsx@@ -7,7 +7,7 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { useDshCores } from '../hooks/use-dsh-cores'import { DownloadCoreDialog } from './download-core-dialog'import { Empty } from './empty'diff --git a/src/components/config-debug.tsx b/src/components/config-debug.tsxindex 859a4990..5898dd73 100644--- a/src/components/config-debug.tsx+++ b/src/components/config-debug.tsx@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { useStore } from 'valtio-define'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { Info } from './info'export interface RuntimeInfo {diff --git a/src/components/config-plugin.tsx b/src/components/config-plugin.tsxindex b1e6de08..983bab7e 100644--- a/src/components/config-plugin.tsx+++ b/src/components/config-plugin.tsx@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { useStore } from 'valtio-define'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { useDshPlugins } from '../hooks/use-dsh-plugins'import { Ellipsis as TextEllipsis } from './ellipsis'import { Empty } from './empty'diff --git a/src/components/config-profile.tsx b/src/components/config-profile.tsxindex 2f94f643..5dfa7b45 100644--- a/src/components/config-profile.tsx+++ b/src/components/config-profile.tsx@@ -6,7 +6,7 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { useDshProfiles } from '../hooks/use-dsh-profiles'import { Ellipsis } from './ellipsis'import { Item } from './item'diff --git a/src/components/logs.tsx b/src/components/logs.tsxindex 213d9151..cbb28da9 100644--- a/src/components/logs.tsx+++ b/src/components/logs.tsx@@ -2,7 +2,7 @@ import type { ReactNode } from 'react'import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { cn } from 'tailwind-variants'-import { formatLogLine } from '@/utils/log-utils'+import { formatLogLine } from '@/utils/log'/*** 日志面板:带边框的「› + 行」日志容器 + 空日志占位。diff --git a/src/hooks/use-iframe-shim.ts b/src/hooks/use-iframe-shim.tsindex 17d75ed7..e4ec5602 100644--- a/src/hooks/use-iframe-shim.ts+++ b/src/hooks/use-iframe-shim.ts@@ -5,7 +5,7 @@ import { getCurrentWindow } from '@tauri-apps/api/window'import { useEffect } from 'react'import { useEvent, useInterval, useMountedState } from 'react-use'import { queryClient } from '@/config/client'-import { getIframeOrigin } from '@/utils/iframe-origin'+import { getIframeOrigin } from '@/utils/iframe'interface NativeNotificationMessage {source?: 'dsh-notification-bridge'diff --git a/src/hooks/use-iframe-tauri.ts b/src/hooks/use-iframe-tauri.tsindex ebc67849..2b0469a8 100644--- a/src/hooks/use-iframe-tauri.ts+++ b/src/hooks/use-iframe-tauri.ts@@ -1,7 +1,7 @@import type { RefObject } from 'react'import { useState } from 'react'import { useEvent } from 'react-use'-import { getIframeOrigin } from '@/utils/iframe-origin'+import { getIframeOrigin } from '@/utils/iframe'/*** 壳层导航桥(宿主侧):ShellNavBar 左侧三个控件的消息通道。diff --git a/src/layout/components/desktop-updater.tsx b/src/layout/components/desktop-updater.tsxindex 7b2ee31a..e87bb85d 100644--- a/src/layout/components/desktop-updater.tsx+++ b/src/layout/components/desktop-updater.tsx@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'import { useStore } from 'valtio-define'import { DesktopUpdateDialog } from '@/components/desktop-update-dialog'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'/** 桌面端自更新轮询间隔:Rust 侧不再缓存,改为低频轮询以免触发 GitHub 未认证限流(60 次/小时/IP) */const POLL_INTERVAL = 10 * 60_000diff --git a/src/layout/components/download-toast-trigger.tsx b/src/layout/components/download-toast-trigger.tsxindex 52247e87..4bef4a1e 100644--- a/src/layout/components/download-toast-trigger.tsx+++ b/src/layout/components/download-toast-trigger.tsx@@ -5,7 +5,7 @@ import { useRef } from 'react'import { useTranslation } from 'react-i18next'import { useStore } from 'valtio-define'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'export function DownloadToast() {const { t } = useTranslation()diff --git a/src/layout/components/navbar.tsx b/src/layout/components/navbar.tsxindex e7751a14..75bac12e 100644--- a/src/layout/components/navbar.tsx+++ b/src/layout/components/navbar.tsx@@ -23,7 +23,7 @@ import { DesktopUpdateDialog } from '@/components/desktop-update-dialog'import { useDshPlugins } from '@/hooks/use-dsh-plugins'import { useIframeTauri } from '@/hooks/use-iframe-tauri'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { useMacOSAppMenu } from './use-macos-app-menu'/**diff --git a/src/layout/components/preinstall-setup.tsx b/src/layout/components/preinstall-setup.tsxindex 5de72839..0c847e3b 100644--- a/src/layout/components/preinstall-setup.tsx+++ b/src/layout/components/preinstall-setup.tsx@@ -10,7 +10,7 @@ import { Empty } from '@/components/empty'import { Item } from '@/components/item'import { Logs } from '@/components/logs'import { store } from '@/store'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'/*** 预装插件引导页:首次安装(或老版本升级)后展示推荐插件列表,diff --git a/src/store/modules/desktop-updater/store.ts b/src/store/modules/desktop-updater/store.tsindex 3441fa51..03659315 100644--- a/src/store/modules/desktop-updater/store.ts+++ b/src/store/modules/desktop-updater/store.ts@@ -7,7 +7,7 @@ import { invoke } from '@tauri-apps/api/core'import { listen } from '@tauri-apps/api/event'import i18next from 'i18next'import { defineStore } from 'valtio-define'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'const DISMISS_KEY = 'desktop-update-dismissed-tag'diff --git a/src/store/modules/harness-updater/store.ts b/src/store/modules/harness-updater/store.tsindex c6f830f2..464fb1e9 100644--- a/src/store/modules/harness-updater/store.ts+++ b/src/store/modules/harness-updater/store.ts@@ -3,7 +3,7 @@ import type { DshUpdateInfo } from './types'import { invoke } from '@tauri-apps/api/core'import i18next, { t } from 'i18next'import { defineStore } from 'valtio-define'-import { toast } from '@/utils'+import { toast } from '@/utils/toast'import { harness } from '../harness'/**diff --git a/src/store/modules/harness/store.ts b/src/store/modules/harness/store.tsindex 30c53914..9992c296 100644--- a/src/store/modules/harness/store.ts+++ b/src/store/modules/harness/store.ts@@ -16,7 +16,7 @@ import { listen } from '@tauri-apps/api/event'import i18next from 'i18next'import { defineStore } from 'valtio-define'import { queryClient } from '@/config/client'-import { pickErrorLines } from '@/utils/log-utils'+import { pickErrorLines } from '@/utils/log'import { harnessUpdater } from '../harness-updater'const MAX_RETRIES = 8diff --git a/src/utils/iframe-origin.ts b/src/utils/iframe.tssimilarity index 100%rename from src/utils/iframe-origin.tsrename to src/utils/iframe.tsdiff --git a/src/utils/index.ts b/src/utils/index.tsdeleted file mode 100644index c33bec24..00000000--- a/src/utils/index.ts+++ /dev/null@@ -1 +0,0 @@-export { toast } from './toast'diff --git a/src/utils/log-utils.ts b/src/utils/log.tssimilarity index 92%rename from src/utils/log-utils.tsrename to src/utils/log.tsindex be33cca1..aa093843 100644--- a/src/utils/log-utils.ts+++ b/src/utils/log.ts@@ -1,5 +1,5 @@/** DSH 发行版 GitHub Release 下载 URL 前缀:日志展示时剥离,避免整段长 URL 占满一行 */-const DSH_RELEASE_URL_PREFIX = 'https://github.com/hairyf/deepseek-harness-pkg/releases/download/'+const DSH_RELEASE_URL_PREFIX = 'https://github.com/dsh-tauri-desk/deepseek-harness-pkg/releases/download/'/** ghfast.top 镜像透传包装前缀(与官方 URL 拼接),同样剥离 */const DSH_MIRROR_URL_PREFIX = 'https://ghfast.top/'