dsh-siyuan
Manifest valid★ 1把 DeepSeek Harness 的对话一键存入思源笔记(SiYuan)。支持单条/本轮/整窗口同步、AI 摘要、公式与 mermaid 图表原样保留。
dsh-siyuan
把 DeepSeek Harness 里值得留下的对话,挑出来沉淀成你自己的开发知识库。 右键选中,笔记就进了思源——公式和 mermaid 图表原样保留。
中文
为什么需要它
一次开发对话几千字,真正值得留下的可能就那么几段:一个想通的方案、一个踩了半天的坑、一组调出来的参数。剩下的推演和试错,过一周你也不会重读。
问题是这些碎片都埋在里面。整段存下来懒得翻,什么都不存下次重新踩一遍。
这个插件解决挑选:
- 你决定存什么——完整一轮,或只是某条讲清楚了问题的消息
- 存进来的部分能直接用——代码、公式、图表保持原样
- 慢慢长成知识库——几个月后搜一下「上次那个内存泄漏怎么定的」就有
思源在这里不是备份盘,是组织层:双链、大纲、标签、数据库视图都是现成的。
功能
- 三种同步粒度 —— 单条消息 / 本轮对话 / 整个窗口。助手消息的动作条上有「存」图标,Shift+点存整窗口
- 思源没开也不丢 —— 先进本地队列,每 30 秒探一次,思源启动后自动补写
- 写入前可改 —— 弹预览面板,标题和正文都能编辑
- 公式和图表 —— 行内公式、块级公式渲染成思源原生公式块;流程图、时序图、状态图、甘特图、饼图、类图都识别成图表
- 对话气泡 —— 用户蓝色、助手绿色,一眼分清谁说的
- 自动标签 —— 按内容打
#方案设计#、#问题排查#这类标签,方便聚合检索 - 回链 —— 每段末尾标明来源的会话、轮次和时间
- 重复检测 —— 同样的内容再同步会提示已存过
- AI 摘要 —— 整窗口同步时可调用当前模型生成结构化摘要,再连同全文一起存入
- 失败重试 —— 自动退避重试,面板里能看到失败原因
效果预览
下面全部是从 DeepSeek Harness 对话框右键同步过去之后,在思源笔记里的原始截图——没有手动排版,没有二次编辑。
对话里写什么,笔记里就是什么:Markdown 语法、LaTeX 公式、mermaid 图表、代码块、表格,全部按思源的块模型重新组织,而不是变成一堆纯文本。
兼容性一览:
| Harness 里的写法 | 同步后成为 | 是否丢格式 |
|---|---|---|
**粗体** *斜体* ~~删除线~~ | 思源对应的行内样式 | ✅ 完整保留 |
$E=mc^2$ | 思源行内公式 NodeMathInline | ✅ 可编辑 |
$$...$$ | 思源公式块 NodeMathBlock | ✅ 可编辑 |
| ```mermaid flowchart | 思源图表块(可缩放) | ✅ 可交互 |
| ```javascript | 思源代码块 + 语法高亮 | ✅ 语言标记都保留 |
| Markdown 表格 | 思源表格块 | ✅ 对齐方式保留 |
- [x] 任务 | 思源任务列表块 | ✅ 可勾选 |
| 无序/有序列表 | 思源列表块(含嵌套) | ✅ 层级保留 |
文本样式与标题 —— 对话里怎么写,笔记里就怎么显示。粗体、斜体、删除线、行内代码、超链接、中文标点全部原样保留,不是转成纯文本后重新加粗的
标题层级与文本样式
公式 —— 对话里写的 LaTeX 直接变成思源公式块,点一下就能继续编辑。行内、块级、多行对齐、矩阵都支持
公式渲染
流程图 —— 对话里是 ```mermaid 代码块,同步后思源自动识别并渲染成图形,不是一段代码
流程图
时序图 —— 多方交互和请求响应顺序,同步后保留全部结构
时序图
甘特图与饼图 —— 同一个对话里两种图都能识别,各按各的类型渲染
甘特图与饼图
思维导图 —— 对话里写的 mindmap 层级结构,同步后自动展开成树
思维导图
代码块 —— 语言标记(图里左上角的 javascript)都是同步时自动带过去的,缩进、注释、中文注释全部保留
代码块高亮
表格 —— Markdown 表格转成思源表格块,左中右对齐都能保留
表格与对齐
特殊符号 —— 箭头、数学符号、单位、Emoji、长字符串,同步过程不做任何转义或替换
特殊符号与 Emoji
怎么用
右键任意消息:
| 菜单项 | 作用 |
|---|---|
| 复制 | 复制这条消息的纯文本(插件接管右键后补回的原生功能) |
| 同步这条消息到思源 | 只存这一条 |
| 同步本轮对话 | 这一轮问答 |
| 同步整个窗口的全部对话 | 窗口里所有已加载的对话 |
| 思源笔记设置… | 打开控制面板 |
用成知识库的几个习惯
- 按主题建笔记本 —— 别堆在默认的
deepseek对话里,改成架构决策、问题排查、性能优化 - 按价值选粒度 —— 一句话结论存单条,讲清一个问题存本轮,长推演存整窗口 + 摘要
- 摘要当索引 —— 整窗口生成的摘要把结论和关键参数摘在前面,日常看摘要就够
- 标签和双链串联 —— 把「当时定的方案」和「后来踩的坑」连起来
- 定期整理 —— 散的合并成整篇,过时的删掉
安装
两种方式,任选其一。装完都要重启 Harness。
方式一:npm(推荐,最省事)
不依赖 Git,一条命令搞定:
dsh plugin --profile desktop add dsh-siyuan-sync
需要机器上已装 pnpm。如果提示
pnpm was not found,先装:npm i -g pnpm
方式二:从 GitHub 克隆
适合想改代码、或者 npm 装不上的情况。
macOS / Linux
git clone https://github.com/LuoX218/dsh-siyuan.git
cd dsh-siyuan
chmod +x install.sh
./install.sh
Windows(PowerShell)
git clone https://github.com/LuoX218/dsh-siyuan.git
cd dsh-siyuan
.\install.ps1
PowerShell 若提示「禁止运行脚本」,先执行一次:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Windows 脚本用目录联接(Junction)代替符号链接,不需要管理员权限。
安装脚本做了什么
三个改动,都在 ~/.dsh/profiles/desktop/ 下:
- 把插件目录链接到
node_modules/ - 写进
package.json的dependencies - 追加到
dsh.profile.bundles
第 2、3 步是插件能出现在「设置 → 插件 → 第三方插件」列表里的关键。脚本会自动备份 package.json。
其他 profile 用 --profile <名字> 指定(Windows 用 -Profile <名字>)。
装完确认
必须完全退出 DSH 再启动——托盘图标右键 → 退出。只关窗口只是缩到托盘,代码不会重新加载(Node 按 URL 缓存 ESM 模块,重载插件补丁不会重新 import)。
重启后:
- 设置 → 插件 → 第三方插件 里能看到
dsh-siyuan,可以启用/停用 - 右键任意对话消息,菜单里出现「同步这条消息到思源」
卸载
macOS / Linux
./uninstall.sh
Windows
.\uninstall.ps1
更新
npm 方式:
dsh plugin --profile desktop add dsh-siyuan-sync@latest
克隆方式:
cd dsh-siyuan
git pull
./uninstall.sh && ./install.sh
前置条件
思源必须开着——插件通过思源内核 API 写入,token 从 conf/conf.json 自动读取(macOS / Windows / Linux 路径都已适配)。
平台支持
| 系统 | 状态 | 说明 |
|---|---|---|
| macOS | ✅ | 已充分测试 |
| Windows | ✅ | 安装脚本已提供,代码路径全平台适配 |
| Linux | ✅ | 使用 ~/.config/siyuan/conf/conf.json |
代码只用 Node 内置模块,路径拼接统一走 path.join,不调用任何 shell 命令。
设置面板
入口:设置 → 插件 → 第三方插件 → dsh-siyuan,点「配置」。
面板顶部显示连接状态(思源是否可达、版本号),下面是四组设置。
存放规则
决定内容写到哪、怎么组织。
| 设置项 | 选项 | 说明 |
|---|---|---|
| 目标笔记本 | 任意名字 | 填不存在的名字会自动创建。想按主题分类就填 架构决策、问题排查 |
| 日期格式 | 2026-10-20 / 2026/10/20 / 2026年10月20日 | 只影响文档标题和存放路径 |
| 归类方式 | 同一天追加一篇 / 每次新建文档 | 前者适合日记式归档,后者适合每次同步都是独立主题 |
| 每段时间标题 | 不添加 / 二级 / 三级 / 四级 | 每段内容开头那个时间戳的标题级别。三级适中,不添加则不显示时间 |
面板里会实时显示「存放位置:xxx / xxx」,改完立刻能看到最终路径。
排版
控制同步过去的 Markdown 长什么样。
| 设置项 | 选项 | 说明 |
|---|---|---|
| 段落之间的分隔线 | 显示(推荐)/ 不显示 | 每次同步之间插一条 ---,多次同步视觉上分得开 |
| 每段显示时间戳 | 显示 / 不显示 | 关掉后只保留正文,适合连续记录同一主题 |
| 流程图 / 图表配色 | 跟随思源 / 强制浅色 / 强制深色 / 高对比 | mermaid 的配色方案。夜间看不清时改「强制深色」或「高对比」 |
| 自动标签 | 按内容自动加标签 / 不加标签 | 命中关键词时在正文前插 #方案设计# 这类标签 |
摘要
只在同步整个窗口时生效。
| 设置项 | 选项 / 说明 |
|---|---|
| 整窗口同步时 | 「先问是否提取摘要」会弹选择框;「直接存全文」跳过提问 |
| 提取摘要的提示词 | 多行文本框,可完全自定义。留空则用内置模板(概览 / 时间线 / 主要工作 / 关键信息 / 问题与解决 / 图文 / 后续,并要求配 gantt、flowchart、pie 等图表) |
提示词失焦自动保存。想强制某种输出格式,直接在里面写就行,比如「每次都要有饼图」。
行为
| 设置项 | 选项 | 说明 |
|---|---|---|
| 写入前预览 | 先预览再写入 / 直接写入 | 预览面板里可以改标题和正文,确认后才写。觉得多余就关掉 |
| 重复内容提醒 | 已存过时提示我 / 不检查直接存 | 按内容指纹判断,避免同一段内容反复堆积 |
队列管理
面板下半部分是待写入队列,每条显示标题、字数、相对时间、重试次数和失败原因。
- 重试 —— 单独补写这一条
- 删除 —— 不要了
- 立即写入 N 条 —— 队列整体补写
- 重新检测 —— 重新探测思源地址
失败原因分四类:offline(思源没开)、auth(token 失效)、missing(目标文档被删,会自动重建)、other(其他错误,附原始信息)。
已知限制
| 限制 | 原因 |
|---|---|
| 思源必须运行才能写入 | 写入只能走内核 API |
| 思维导图不能直接生成 | 思源的脑图是原生块,需从列表右键转换 |
| 已有内容不会自动更新 | 改了排版设置只影响新同步的内容 |
| 摘要需要先选模型 | 会话没选模型时无法生成 |
License
MIT
English
Pick out what's worth keeping from DeepSeek Harness and grow it into your own development knowledge base. Right-click to save into SiYuan; formulas and mermaid diagrams come through intact.
Why
A development conversation runs thousands of words. What's actually worth keeping might be a few paragraphs: a design that clicked, a bug that ate an afternoon, a set of tuned parameters. The rest you won't reread.
This plugin is about selection — you decide what's kept, what's kept stays usable, and it compounds into a searchable knowledge base.
SiYuan isn't a backup drive here; it's the organization layer: backlinks, outlining, tags, database views.
Features
- Three sync scopes — single message / current turn / whole window. Assistant rows carry a save icon; Shift+click saves the whole window
- Nothing lost when SiYuan is down — local queue, probed every 30s, flushed automatically
- Editable preview — tweak the title and body before writing
- Formulas and diagrams — inline and block math become native SiYuan math blocks; flowchart, sequence, state, gantt, pie, and class diagrams render as diagrams
- Speaker bubbles — user in blue, assistant in green
- Auto tags —
#design#,#troubleshooting#and friends, for aggregation - Backlinks — each segment notes its session, turn, and timestamp
- Duplicate detection — the same content prompts before being saved twice
- AI summary — for whole-window syncs, call your current model for a structured summary alongside the transcript
- Retry with backoff — failure reasons surface in the panel
Screenshots
Every image below is a raw screenshot of SiYuan after right-clicking sync in a DeepSeek Harness conversation — no manual formatting, no re-editing.
What you type in the chat is what lands in the note: Markdown, LaTeX, mermaid, code fences, tables — all rebuilt as SiYuan's native blocks instead of flattened into plain text.
| Written in Harness | Becomes in SiYuan | Fidelity |
|---|---|---|
**bold** *italic* ~~strike~~ | matching inline styles | ✅ |
$E=mc^2$ | inline math NodeMathInline | ✅ editable |
$$...$$ | math block NodeMathBlock | ✅ editable |
| ```mermaid flowchart | diagram block | ✅ interactive |
| ```javascript | code block with highlighting | ✅ language marker kept |
| Markdown table | table block | ✅ alignment kept |
- [x] task | task list block | ✅ checkable |
Inline and block formulas become native SiYuan math blocks
Mermaid flowcharts render as interactive diagrams
Gantt charts for schedules, pie charts for proportions
Tables keep their alignment and status markers
See the Chinese section for the full gallery.
Usage
Right-click any message:
| Item | What it does |
|---|---|
| Copy | Copies the message as plain text (the native action the plugin replaces) |
| Sync this message | Just this one |
| Sync this turn | The question-and-answer pair |
| Sync the whole window | Everything loaded |
| SiYuan settings… | Open the panel |
Install
Two options. Either way, restart Harness afterwards.
Option 1: npm (recommended)
No Git needed, one command:
dsh plugin --profile desktop add dsh-siyuan-sync
Requires pnpm. If you see
pnpm was not found, install it first:npm i -g pnpm
Option 2: clone from GitHub
For hacking on the code, or when npm isn't an option.
macOS / Linux
git clone https://github.com/LuoX218/dsh-siyuan.git
cd dsh-siyuan
chmod +x install.sh
./install.sh
Windows (PowerShell)
git clone https://github.com/LuoX218/dsh-siyuan.git
cd dsh-siyuan
.\install.ps1
If PowerShell refuses to run the script:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
The Windows script uses a directory junction instead of a symlink, so no admin rights are needed.
What the script does
Three changes, all under ~/.dsh/profiles/desktop/:
- Links the plugin directory into
node_modules/ - Adds it to
package.json→dependencies - Appends it to
dsh.profile.bundles
Steps 2 and 3 are what make the plugin show up under Settings → Plugins → Third-party plugins. Your package.json is backed up automatically.
For another profile, pass --profile <name> (Windows: -Profile <name>).
Verifying
After restarting Harness:
- The plugin appears under Settings → Plugins → Third-party plugins, with an enable/disable toggle
- Right-clicking any conversation message shows "Sync this message"
Uninstall
macOS / Linux
./uninstall.sh
Windows
.\uninstall.ps1
Updating
npm install:
dsh plugin --profile desktop add dsh-siyuan-sync@latest
Clone install:
cd dsh-siyuan
git pull
./uninstall.sh && ./install.sh
Requirement
SiYuan must be running — the plugin writes through its kernel API, reading the token from conf/conf.json (macOS / Windows / Linux paths all handled).
| Platform | Status | Notes |
|---|---|---|
| macOS | ✅ | Fully tested |
| Windows | ✅ | Install script provided; all code paths adapted |
| Linux | ✅ | Uses ~/.config/siyuan/conf/conf.json |
Settings
Open via Settings → Plugins → Third-party plugins → dsh-siyuan → Configure. The panel header shows connection status; four groups follow.
Storage — target notebook (created on demand), date format, grouping mode (one note per day vs. one per sync), timestamp heading level.
Layout — separator between segments, timestamp visibility, mermaid color scheme (follow theme / force light / force dark / high contrast), auto-tagging on or off.
Summary — whether whole-window syncs ask before summarizing, and a fully customizable summary prompt (leave empty for the built-in archival template).
Behavior — preview before writing, duplicate detection.
The queue section at the bottom lists pending entries with retry counts and failure reasons, each individually retryable or removable.
Known limitations
| Limitation | Reason |
|---|---|
| SiYuan must be running | Kernel API is the only write path |
| No direct mindmap generation | SiYuan mindmaps are native blocks; convert from a list |
| Existing content isn't updated | Layout changes only affect new syncs |
| Summary needs a selected model | Uses the current session's model |
License
MIT
Comments
Loading…
From the same category
by awesome-dsh-plugin
A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表
★ 19.6k
CC0-1.0
Python
Oct 19, 2026
by 0xsline
DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.
★ 1.2k
CC0-1.0
Python
Oct 16, 2026
by pax-beehive
Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub
★ 388
MIT
TypeScript
Oct 6, 2026
by xiajiajun516
DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.
★ 215
MIT
TypeScript
Oct 18, 2026
dsh plugin --profile web add dsh-config-managerby yjh051108
推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。
★ 166
TypeScript
Oct 16, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injectorby jigjoy-ai
A CLI that turns a goal into a pull request - and a sandbox for testing concurrent AI coding agents on the Mozaik runtime.
★ 124
MIT
TypeScript
Oct 13, 2026