Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

feat(dsh-tauri-ui): 接入 dsh-im 侧边栏 IM 面板

hairyfc4f9e3e35d28
diff --git a/README.en.md b/README.en.md
index 793e044a..420306f5 100644
--- a/README.en.md
+++ b/README.en.md
@@ -57,6 +57,7 @@ Plugins offered in the first-run wizard; select what you need and install on dem
- [DSH Market](https://github.com/dsh-market/dsh-market) — browse, search, and one-click install community plugins (Recommended)
- [DSH Better Sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) — a VSCode-like right sidebar, isolated per session (Recommended)
- [DSH Rewind](https://github.com/SiriLee/dsh-rewind) — in-window conversation rewind that never forks a new session, plus a lightweight workspace backup that restores files along with the rewind (Recommended)
+- [DSH-IM](https://github.com/xmanrui/dsh-im) — connect WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, iMessage and more to your local Harness, managed from an "IM" sidebar panel (Recommended)
> The preset list is maintained by the desktop project. To request a new or updated preset, open an issue in [deepseek-harness-desktop](https://github.com/dsh-tauri/deepseek-harness-desktop/issues).
diff --git a/README.md b/README.md
index 0e1cd332..80e48174 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,7 @@
- [DSH Market](https://github.com/dsh-market/dsh-market) — 浏览、搜索并一键安装社区插件(推荐)
- [DSH Better Sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) — 类 VSCode 右侧栏,按会话隔离(推荐)
- [DSH Rewind](https://github.com/SiriLee/dsh-rewind) — 同窗口内对话回退,从不新建会话分支;自带轻量工作区备份,回退时可一并还原文件(推荐)
+- [DSH-IM](https://github.com/xmanrui/dsh-im) — 让微信、飞书、钉钉、企业微信、QQ、Slack、Telegram、Discord、WhatsApp、iMessage 等渠道接入本机 Harness,并在左侧栏「IM」面板中统一管理(推荐)
> 预设插件清单由桌面端维护。为避免不稳定的预设插件导致软件异常,如需新增或更新预设,请在 [deepseek-harness-desktop/issues](https://github.com/dsh-tauri/deepseek-harness-desktop/issues) 提起请求。
diff --git a/packages/dsh-tauri-ui/src/client/components/icons.tsx b/packages/dsh-tauri-ui/src/client/components/icons.tsx
index 9014a153..28ddf300 100644
--- a/packages/dsh-tauri-ui/src/client/components/icons.tsx
+++ b/packages/dsh-tauri-ui/src/client/components/icons.tsx
@@ -18,6 +18,7 @@ export { default as CircleTree } from '@gravity-ui/icons/CircleTree'
export { default as CircleXmark } from '@gravity-ui/icons/CircleXmark'
export { default as Clock } from '@gravity-ui/icons/Clock'
export { default as CommentPlus } from '@gravity-ui/icons/CommentPlus'
+export { default as Comments } from '@gravity-ui/icons/Comments'
export { default as Ellipsis } from '@gravity-ui/icons/Ellipsis'
export { default as EllipsisVertical } from '@gravity-ui/icons/EllipsisVertical'
export { default as FilePlus } from '@gravity-ui/icons/FilePlus'
diff --git a/packages/dsh-tauri-ui/src/client/components/im-panel.cssr.ts b/packages/dsh-tauri-ui/src/client/components/im-panel.cssr.ts
new file mode 100644
index 00000000..cf63a7e9
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/im-panel.cssr.ts
@@ -0,0 +1,14 @@
+import { cssr } from '../utils/cssr'
+
+const { bem: { b } } = cssr
+
+/**
+ * dsh-im 面板容器几何:dsh-im 自身不持有容器的高度、留白与滚动,
+ * 由宿主(这里)承担,见 dsh-im `docs/client-integration.md`。
+ */
+export default b('im-panel', {
+ boxSizing: 'border-box',
+ height: '100%',
+ padding: '24px',
+ overflow: 'auto',
+})
diff --git a/packages/dsh-tauri-ui/src/client/components/im-panel.tsx b/packages/dsh-tauri-ui/src/client/components/im-panel.tsx
new file mode 100644
index 00000000..82d591a2
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/im-panel.tsx
@@ -0,0 +1,10 @@
+import type { ReactElement, ReactNode } from 'react'
+import { useMountStyle } from '../hooks/use-mount-style'
+import imPanelStyle from './im-panel.cssr'
+
+const IM_PANEL_STYLE_ID = 'dsh-tauri-ui-im-panel-styles'
+
+export function ImPanel({ render }: { render: () => ReactNode }): ReactElement {
+ useMountStyle(imPanelStyle, IM_PANEL_STYLE_ID)
+ return <div className="dshp-im-panel">{render()}</div>
+}
diff --git a/packages/dsh-tauri-ui/src/client/constants/index.ts b/packages/dsh-tauri-ui/src/client/constants/index.ts
index 32d373b2..7819eb7b 100644
--- a/packages/dsh-tauri-ui/src/client/constants/index.ts
+++ b/packages/dsh-tauri-ui/src/client/constants/index.ts
@@ -18,12 +18,16 @@ export const MENU_SELECT_STYLE_ID = 'dsh-tauri-ui-menu-select-styles'
export const TURN_NAVIGATION_STYLE_ID = 'dsh-tauri-ui-turn-navigation-styles'
export const GLOBAL_STYLE_ID = 'dsh-tauri-ui-global-styles'
+/** dsh-im 客户端插件经 `ctx.provide` 发布的反射服务名(4.22.0 起)。 */
+export const DSH_IM_CLIENT_SERVICE = 'dshImClient'
+
export const STYLES_EFFECT = `${PLUGIN_ID}: styles`
export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`
export const SEAT_EFFECT = `${PLUGIN_ID}: shell.overlay seat`
export const SECTIONS_EFFECT = `${PLUGIN_ID}: settings sections projection`
export const SETTINGS_EFFECT = `${PLUGIN_ID}: settings panel`
export const OBSTRUCTIONS_EFFECT = `${PLUGIN_ID}: settings obstructions`
+export const IM_PANEL_EFFECT = `${PLUGIN_ID}: im panel`
export const TURN_NAVIGATION_LABEL_ZH = '轮次导航'
export const TURN_NAVIGATION_LABEL_EN = 'Turn navigation'
diff --git a/packages/dsh-tauri-ui/src/client/index.ts b/packages/dsh-tauri-ui/src/client/index.ts
index d144f069..08130958 100644
--- a/packages/dsh-tauri-ui/src/client/index.ts
+++ b/packages/dsh-tauri-ui/src/client/index.ts
@@ -1,9 +1,10 @@
import type {} from '@deepseek-ai/dsh-client-ui-layout/client'
import type { ClientContext } from 'dsh-tauri/client'
import { PLUGIN_ID } from '../shared/constants'
-import { LOCALE_EFFECT, OBSTRUCTIONS_EFFECT, SEAT_EFFECT, SECTIONS_EFFECT, SETTINGS_EFFECT, STYLES_EFFECT } from './constants'
+import { IM_PANEL_EFFECT, LOCALE_EFFECT, OBSTRUCTIONS_EFFECT, SEAT_EFFECT, SECTIONS_EFFECT, SETTINGS_EFFECT, STYLES_EFFECT } from './constants'
import { locale } from './locales'
import { composerResumeFeature } from './register/composer-resume'
+import { registerImPanel } from './register/im-panel'
import { registerSettingsObstructions } from './register/obstructions'
import { registerShellSeat } from './register/seat'
import { registerSettingsSections } from './register/sections'
@@ -36,4 +37,5 @@ export function apply(ctx: ClientContext): void {
ctx.effect(registerSettings, SETTINGS_EFFECT)
ctx.effect(registerSettingsObstructions, OBSTRUCTIONS_EFFECT)
ctx.effect(composerResumeFeature, COMPOSER_RESUME_EFFECT)
+ ctx.effect(registerImPanel, IM_PANEL_EFFECT)
}
diff --git a/packages/dsh-tauri-ui/src/client/locales/index.ts b/packages/dsh-tauri-ui/src/client/locales/index.ts
index baa79146..8c17b743 100644
--- a/packages/dsh-tauri-ui/src/client/locales/index.ts
+++ b/packages/dsh-tauri-ui/src/client/locales/index.ts
@@ -8,6 +8,7 @@ export const locale = defineLocale(PLUGIN_ID, {
settings: '设置',
noResults: '没有匹配的设置项',
resumeTask: '继续任务',
+ im: 'IM',
},
en: {
back: 'Back to app',
@@ -15,5 +16,6 @@ export const locale = defineLocale(PLUGIN_ID, {
settings: 'Settings',
noResults: 'No matching settings',
resumeTask: 'Resume task',
+ im: 'IM',
},
})
diff --git a/packages/dsh-tauri-ui/src/client/register/im-panel.tsx b/packages/dsh-tauri-ui/src/client/register/im-panel.tsx
new file mode 100644
index 00000000..7f3ffea3
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/register/im-panel.tsx
@@ -0,0 +1,42 @@
+import type { ClientContext } from 'dsh-tauri/client'
+import { definePanel, defineRegister } from 'dsh-tauri/client'
+import { Icon } from '../components/icon'
+import { Comments } from '../components/icons'
+import { ImPanel } from '../components/im-panel'
+import { DSH_IM_CLIENT_SERVICE } from '../constants'
+import { locale } from '../locales'
+import { readDshImClient } from '../service/dsh-im'
+
+/** 带插件前缀:dsh-im 源码仓库另有一个手动安装的同名接入(id `dsh-im`),同 id 会撞槽位。 */
+const IM_PANEL_ID = 'dsh-tauri-ui-im'
+/** 排在定时任务(30)之后。 */
+const IM_PANEL_ORDER = 40
+
+export const registerImPanel = defineRegister<ClientContext>((_controller, ctx) => {
+ // 同一 profile 也服务普通浏览器标签:只有桌面 iframe 接管,浏览器保留设置页入口。
+ if (typeof window === 'undefined' || window.parent === window)
+ return
+
+ // 服务由 dsh-im 客户端插件发布,apply 顺序不保证,旧版 dsh-im 也没有它:
+ // inject 只在服务到位时激活本接入,缺席时不注册面板、不动设置页。
+ // 交由返回的 disposer(而非 effect)回收:服务被撤下时同样要恢复设置页入口。
+ ctx.inject([DSH_IM_CLIENT_SERVICE], () => {
+ const im = readDshImClient(ctx)
+ if (im === undefined)
+ return
+
+ const panel = definePanel(ctx, {
+ id: IM_PANEL_ID,
+ order: IM_PANEL_ORDER,
+ label: () => locale.text('im'),
+ icon: props => <Icon as={Comments} size={props.size} />,
+ render: () => <ImPanel render={() => im.render()} />,
+ })
+ im.setSettingsVisible(false)
+
+ return () => {
+ im.setSettingsVisible(true)
+ panel.dispose()
+ }
+ })
+})
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts
new file mode 100644
index 00000000..df435844
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts
@@ -0,0 +1,40 @@
+import type { ClientContext } from 'dsh-tauri/client'
+import type { DshImClient } from './dsh-im.types'
+import { describe, expect, it } from 'vitest'
+import { DSH_IM_CLIENT_SERVICE } from '../constants'
+import { readDshImClient } from './dsh-im'
+
+const VALID: DshImClient = {
+ version: 1,
+ render: () => null,
+ setSettingsVisible: () => {},
+ settingsVisible: () => true,
+}
+
+function contextReflecting(get: (name: string) => unknown): ClientContext {
+ return { reflect: { get } } as unknown as ClientContext
+}
+
+describe('readDshImClient', () => {
+ it('reads the published v1 face', () => {
+ const ctx = contextReflecting(name => name === DSH_IM_CLIENT_SERVICE ? VALID : undefined)
+ expect(readDshImClient(ctx)).toBe(VALID)
+ })
+
+ it('rejects an unknown interface version', () => {
+ const ctx = contextReflecting(() => ({ ...VALID, version: 2 }))
+ expect(readDshImClient(ctx)).toBeUndefined()
+ })
+
+ it('rejects a face without render', () => {
+ const ctx = contextReflecting(() => ({ ...VALID, render: undefined }))
+ expect(readDshImClient(ctx)).toBeUndefined()
+ })
+
+ it('treats an absent service and a throwing registry as unavailable', () => {
+ expect(readDshImClient(contextReflecting(() => undefined))).toBeUndefined()
+ expect(readDshImClient(contextReflecting(() => {
+ throw new Error('registry disposed')
+ }))).toBeUndefined()
+ })
+})
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.ts
new file mode 100644
index 00000000..157e9387
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/service/dsh-im.ts
@@ -0,0 +1,27 @@
+import type { ClientContext } from 'dsh-tauri/client'
+import type { DshImClient } from './dsh-im.types'
+import { DSH_IM_CLIENT_SERVICE } from '../constants'
+
+/**
+ * client/service/dsh-im.ts — 读 dsh-im 客户端服务(能力探测,不做版本嗅探)。
+ *
+ * 服务由另一个客户端插件发布、apply 顺序不保证,且旧版 dsh-im 根本没有它:
+ * 在注册回调内即时读取,`version !== 1`、缺少可调用的 `render` 或注册表异常
+ * 一律按「没有该能力」处理——只失去这个控制面,不影响本插件自身。
+ */
+export function readDshImClient(ctx: ClientContext): DshImClient | undefined {
+ const reflect = ctx?.reflect
+ if (reflect === undefined || typeof reflect.get !== 'function')
+ return undefined
+ let service: unknown
+ try {
+ service = reflect.get(DSH_IM_CLIENT_SERVICE)
+ }
+ catch {
+ return undefined
+ }
+ if (service === null || service === undefined)
+ return undefined
+ const face = service as DshImClient
+ return face.version === 1 && typeof face.render === 'function' ? face : undefined
+}
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts
new file mode 100644
index 00000000..61f08723
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts
@@ -0,0 +1,14 @@
+import type { ReactNode } from 'react'
+
+/**
+ * dsh-im 客户端反射服务(4.22.0 起经 `ctx.provide('dshImClient', ...)` 发布)。
+ *
+ * `render()` 每次返回新 element(完整管理面板,含语言刷新与局部错误保护),
+ * `setSettingsVisible()` 只影响当前客户端内存中的「设置 → IM机器人」入口。
+ */
+export interface DshImClient {
+ readonly version: number
+ render: (props?: { preferredSectionId?: string }) => ReactNode
+ setSettingsVisible: (visible: boolean) => void
+ settingsVisible: () => boolean
+}
diff --git a/src-tauri/resources/preset-plugins.json b/src-tauri/resources/preset-plugins.json
index 52eb0d6a..b47b78fd 100644
--- a/src-tauri/resources/preset-plugins.json
+++ b/src-tauri/resources/preset-plugins.json
@@ -23,5 +23,13 @@
"description": "In-window conversation rewind that never forks a new session, with a lightweight workspace backup that restores files together with the rewind.",
"repoUrl": "https://github.com/SiriLee/dsh-rewind",
"recommended": true
+ },
+ {
+ "id": "@xmanrui/dsh-im",
+ "spec": "@xmanrui/dsh-im",
+ "name": "DSH-IM",
+ "description": "Connect eleven IM channels (WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, iMessage) and a public AI Office to a local DeepSeek Harness, with bot management in the desktop sidebar.",
+ "repoUrl": "https://github.com/xmanrui/dsh-im",
+ "recommended": true
}
]