DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-siyuan-export

d

dsh-siyuan-export

Manifest valid

Exports a single dsh assistant reply into a SiYuan notebook as a structured Markdown note, with sections split by heading, icon-tagged bullet points and code blocks kept as-is. A button on every assis

UI (client)hasBundlePatch

dsh-siyuan-export · 导出到思源

在 dsh(DeepSeek Harness)对话中,把单条助手回复一键导出为结构清晰、带小图标的思源笔记。

  • 每条助手回复的操作栏都有「导出到思源」按钮(官方 slot conversation.chat.assistant-actions)
  • 左侧栏带 biji.svg 图标、名为 Siyuan Export 的入口:打开设置面板,配置默认存放路径与「导出时显示弹窗」开关(默认开启,修改即时保存)
  • 关闭开关后点击导出不再弹窗:Host 后台生成并写入(默认路径 → 上次路径 → 第一本未关闭笔记本根目录),按钮显示旋转进度并保持加载态,不阻塞对话
  • 导出结果以右下角非阻塞 toast 提示:成功显示落点并约 6s 自动消失;失败常驻显示原因并可「重试」或「打开设置」
  • 点击弹窗:主题名由大模型基于该条回复生成(可编辑,不带任何对话上下文,省 token);存放位置在弹窗内的文档树中逐层选择(记住上次成功路径)
  • 导出内容为结构化 Markdown:二级标题分节、要点带小图标(✅ 📌 ⚠️ 💡)、代码块与列表原样保留,文末附来源元数据
  • 失败可恢复:明确原因 + 分类引导文案 + 重试(复用已生成内容,不重调模型)

适用范围

本插件只做一件事:把 dsh 对话里的单条助手回复导出成思源笔记。

  • 只支持思源笔记(SiYuan),不支持 Notion、Obsidian、语雀等其他笔记应用,也没有适配层或插件市场
  • 只做「dsh → 思源」单向导出:不读取思源笔记内容、不做双向同步、不监听思源内的修改
  • 只导出你点的那一条助手回复:不导出整段会话、不自动批量导出历史消息
  • 写入走思源 HTTP API,要求思源在 endpoint 可达(默认 http://127.0.0.1:6806);不直接读写 .sy 数据目录

安装

# 构建并打包(prepack 自动执行 typecheck + host/client 构建)
npm run build
npm pack                       # 产出 dsh-siyuan-export-<version>.tgz

# 安装到 dsh profile(隔离验证建议先用独立 DSH_HOME)
node "<dsh-repo>\apps\cli\lib\bin.js" plugin --profile web add "<此仓库>\dsh-siyuan-export-<version>.tgz"
node "<dsh-repo>\apps\cli\lib\bin.js" --profile web --dump-config   # 确认 # == dsh-siyuan-export 入选
# 重启 dsh Web 宿主

配置

在插件配置中设置(Standard Schema 校验,均有默认值):

字段默认说明
endpointhttp://127.0.0.1:6806思源本地 API 地址
token空思源 设置 → 鉴权 → API token;未开鉴权的服务可留空
dataDirplugins/siyuan-export插件偏好数据子目录(相对 $DSH_HOME)

Token 只经 Config 传入,不写日志、审计、状态文件或 RPC 响应(tests/unit/secret-scan.test.ts 守护)。

不需要填写思源工作空间路径:文档树读取与写入都走 HTTP API,插件不读本机 .sy 数据目录,因此换一台电脑只需改 endpoint / token。dataDir 只是插件自己的偏好目录,与本机思源安装位置无关,可按需自定义。

使用

  1. 左侧栏点击「Siyuan Export」→ 选择默认存放路径、按需关闭「导出时显示弹窗」(即时保存,无全局保存按钮)
  2. 等待助手回复完成 → hover 消息行 → 点击「导出到思源」
  3. 弹窗模式:标题自动生成中(用户已编辑则不覆盖);文档树逐层展开选择存放位置 → 「导出」→ 成功显示落点;失败显示原因 + 分类引导 + 「重试」(保留已填内容)
  4. 静默模式(开关关闭):无弹窗,按钮显示旋转进度并防止重复点击;对话可继续。成功后右下角 toast 显示落点,约 6s 消失;失败 toast 常驻,可「重试」或「打开设置」

开发

npm run typecheck   # tsc --noEmit
npm run lint        # eslint .
npm test            # vitest run(单元 + 集成 + client + 真实思源 E2E)
npm run build       # typecheck + host + client handoff
node scripts/pack-check.mjs   # 打包内容核对
  • 红→绿→重构逐任务循环;测试替身:tests/integration/fake-siyuan.ts(内存端口)与 fake-llm.ts(四模式)
  • 真实思源 E2E:tests/e2e/siyuan-real.test.ts(思源未运行时整体 skip,不假绿;写入后自动清理测试目录)
  • 隔离环境:scripts/setup-isolated-env.ps1 → 启动 → scripts/teardown-isolated-env.ps1(junction 安全清理)

未验证边界(诚实清单)

已由用户在真实宿主手工核验(2026-11-11,构建 c247b5e,含 Phase 12 修复):真实 dsh 安装/重启、真实思源写入、浏览器中消息行按钮/弹窗/文档树渲染、侧栏入口与设置面板渲染及键盘操作、静默模式与 V8–V12 手工项(含重启后偏好保留与失败 toast「打开设置」路由)。

以下项仍缺少可归档证据(见 quickstart.md 执行记录):

  • 静默模式的 20 次计时样本与录屏(未达到 SC-008 的统计口径记录)
  • 真实模型链路的独立小请求记录与 SC-001/002/003/004 计时、抽样评估
  • 思源「目标路径被删除后重选」的真实场景(错误分类已单测覆盖)
  • 数万字长回复的真实导出(结构保留已单测覆盖)
  • V8/V9 的界面截图归档

设计文档

Comments

Loading…

Similar plugins

dsh-siyuan-archive

by YYK0402

Archives DSH conversation output into SiYuan notes: a single siyuan_archive call files content under `<archive path>/<year-month>/<type>/<date>_<time>_<topic>_<content>` with a metadata table and auto

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 30, 2026

dsh plugin --profile web add dsh-siyuan-archive

by yoursc

SiYuan (思源笔记) notes integration: 17 siyuan_* host tools covering notebook and document listing, full-text search, SQL query, reading documents and blocks, creating and appending content, moving and re

Tools & CapabilitiesManifest valid

★ 4

↓ 509/wk

MIT

JavaScript

Nov 9, 2026

dsh plugin --profile web add @yoursc/dsh-siyuan

by zhxnix

WYSIWYG Markdown notes editor in the DSH right sidebar, with tabbed documents, table editing, chat integration, assistant read/write tools, and local file export.

UI & ExperienceManifest valid

★ 0

MIT

JavaScript

Nov 1, 2026

dsh plugin --profile web add dsh-madedown

by ruiyuxuanyan

把任意一条回复变成能拿给人看的文档:干净的 Markdown、单文件 HTML 或 JSON。可以只导最近 N 轮,工具调用整轮折进一个附录,正文是真 Markdown 结构还带目录,密钥默认脱敏——全程只读会话日志,不改动它。

Manifest valid

★ 0

MIT

JavaScript

Nov 4, 2026

dsh plugin --profile web add dsh-transcript-export

by xinming-chenniang

Editable quick-action buttons beside the DSH composer: send 「继续」 or your own saved text, resend your last message, and hide or restore either preset. Text-only: sends text, runs no host commands, and

UI & ExperienceManifest valid

★ 0

MIT

JavaScript

Nov 14, 2026

dsh plugin --profile web add dsh-button

by liqiGeGe

Adds an Execution graph conversation-view tab that renders each turn's prompts, replies, and tool calls/results as a foldable timeline with a detail panel and PNG export.

Tools & CapabilitiesUI & ExperienceManifest valid

★ 21

↓ 225/wk

Apache-2.0

TypeScript

Nov 9, 2026

dsh plugin --profile web add dsh-plugin-execution-graph