dsh-marginalia
Manifest validMarginal notes for DSH. Mark assistant replies in the conversation and keep them as notes.
dsh-marginalia
在 DeepSeek Harness 的对话里,把值得留下的句子标出来,收成笔记,并就其中一句接着问。助手的回复和自己发出的内容都可以。问句开在旁边的侧栏里,主对话留在原来的页面。
Mark a sentence in a DeepSeek Harness conversation, keep it as a note, and ask about that sentence alone. This works on assistant replies and on messages you sent. The question opens in the side column. The main conversation stays where it is.
中文
这是 DeepSeek Harness 桌面版的一个插件。对话页上,「学习」和「对话」并列。空白的新对话不显示这排标签。
你留在对话里,选中助手写给你的一段话,或自己发出的一段话。光标右上方会出现一张白卡片,右键打开的是同一张。卡片上有五件事:
| 按钮 | 做什么 |
|---|---|
| 复制 | 把选中的这段放进剪贴板。 |
| 标记 / 取消标记 | 给这段加上或去掉颜色。点标记后,上方浮出红、蓝、黄;加号打开调色板。自己选的颜色会留下,一共最多 5 种。颜色只留在原文上,不会自动进笔记。 |
| 划线 / 取消划线 | 给这段加金色下划线,或把下划线去掉。下划线只留在原文上,不会自动进笔记。 |
| 加入笔记 / 移出笔记 | 把选中的整段收进「学习」。原文出现浅灰色虚线下划线。再选中同一段,可以移出。 |
| 提问 / 追问 | 就这段发问。已经问过的,接着问同一条。 |
思考过程不会出现这张卡片。
笔记
「加入笔记」收进的整段,以及提问和追问,都进「学习」页。标记和划线不会自动出现在这里。每一条都能改摘录、问题和批注,也能删除。摘录会记下原文里的加粗、斜体和代码。上面是预览,落在这段里的标记颜色和金色划线也会画在预览上,下面一格是 Markdown,改完会保存。复制选区和「复制笔记」带上的也是这份 Markdown。同一大段里如果拆成了好几张,改摘录就能收成你想留的那一张,多余的删掉。
「笔记 · 数量」旁边可以按类别筛选,类别可以自己添加。每条笔记选一个类别,没选的是未分类。勾选之后可以全选当前筛出来的笔记,一起改类别或删除。复制笔记时带上类别,并且只复制当前筛出来的这些。
笔记写在本机的 ~/.dsh/study-notes/(Windows 上是 %USERPROFILE%\.dsh\study-notes\),按工作区分开,里面是 index.json 和对应的 Markdown。不写进你正在打开的项目仓库。
再选中同一段,按钮变成「取消标记」「取消划线」或「移出笔记」。取消标记和取消划线只去掉原文上的颜色或金色下划线。移出笔记会从「学习」里拿走整段,并去掉虚线下划线。选区跟已有标注重叠,或去掉空白后是同一句,也算这一条。别处还有一句完全相同的文字时,会一起取消。
就一句话提问
选「提问」,写上例如「这段是什么」,也可以先选模型。
这句话不会被划线。问题和摘录记在「学习」里。这句话还在对话里时,句末出现一个小引用符号:
- 合上时,只有这个符号。
- 点开后,是贴在这句话旁边的便利贴,里面是你的问题和这条进程最新的一条回复。
- 回复还没写完时,便利贴上是「正在回答…」。
- 按 Esc,或点「合上」,便利贴收起。
提问不会把主对话换成另一页。回答写在侧栏里,不写到主对话下面。旁边的「任务管理」仍能看见这条进程。
一条进程可以一直问下去
一条笔记对应一条进程。不同的句子是并排的几条,互不套娃。
这条进程开在右侧栏,输入方式和主对话一样,新的一轮往下接在同一页。下面三种问法都进这一条,不会再套出「主进程 → 子进程 → 子进程」:
- 在侧栏里直接打字。
- 在主对话里对同一句再点「追问」。
- 在已经打开的这条进程里再选一段追问。
它记得自己前面的回答。更早那种问完即止、不能接着写的进程,需要回到主对话重新提问。
模型
三处可以选模型:选中文字后浮出的提问卡、「学习」页上的提问或追问、以及已经打开的子进程输入框上方。
- 「跟随当前对话」:新开的这条用你当前对话的模型。
- 「沿用当前模型」:这次追问不换。
- 点名一个模型:新进程从这一轮就用它;已经打开的进程,从下一条回复起用它。正在写的那一条不会中途换掉。
列表里先是 DeepSeek V4 Pro 和 DeepSeek Flash,然后是桌面配置 profiles/desktop/cordis.patch.yml 里写明的模型。没有的模型会提示「没有这个模型」。子进程页面上,软件自带的模型菜单不会出现,所以换模型用的是输入框上方这一处。
安装
从 npm 安装当前发布的版本。profile 名一般是 desktop。
dsh plugin --profile desktop add dsh-marginalia
要固定版本,把包名写成 dsh-marginalia@0.1.3。装好或更新后,把 DeepSeek Harness 完全退出,包括托盘图标,再打开。只关窗口不够。
也可以从本机目录安装。把路径换成这套插件所在的目录:
dsh plugin --profile desktop add ./path/to/dsh-marginalia
查看 npm 上的版本:
npm view dsh-marginalia version
包页面是 https://www.npmjs.com/package/dsh-marginalia 。
要求 Node.js 20 或更高,DeepSeek Harness >=0.2.1-rc.2 <0.3。这份 0.1.3 是按桌面版 0.2.1-rc.2 写的。
不要把本插件再写进 profile 自己的 cordis.patch.yml。命令行看到 package.json 里的 dsh.bundle.patch 后,会自己把 cordis.patch.yml 接上。写两遍会挂两次。
边界
- 一次标注最多 4000 字。一条对话最多 400 条。一条批注、一个问题最多 2000 字。
- 便利贴里的回复最多显示 20000 字。
- 还没有自动整理,也没有导出 PDF。
- 进程没在运行时,换模型会提示「这条进程没有在运行,换不了模型。」
本地检查:
node --test lib/model.test.js lib/quote.test.js
发布到 npm
同一版本只能发布一次。先改版本号,再发布。--no-git-tag-version 只改 package.json,不会自己做 Git 提交,因此不需要先设置 Git 作者。
npm login
npm whoami
npm version patch --no-git-tag-version
npm publish --access public
npm login 在 npm 11 里会打开网页确认。成功时 npm whoami 显示用户名,npm publish 的最后一行是 + dsh-marginalia@x.y.z。
如果发布返回 403,并写着需要 two-factor authentication 或 granular access token with bypass 2fa,网页登录留下的令牌不能用来发版。到 https://www.npmjs.com/settings/~/tokens 新建 Granular Access Token,权限选 Read and write,范围选 All packages,并勾选 Bypass two-factor authentication。然后在自己的终端执行 npm config set //registry.npmjs.org/:_authToken,后面接那枚新令牌,再重新 npm publish --access public。不要把令牌或验证码写进仓库、对话或截图。发完可以删掉这枚令牌。
English
dsh-marginalia is a desktop plugin for DeepSeek Harness. On the conversation page, a tab named 学习 sits beside 对话. A blank new chat hides that tab row.
Stay in the conversation and select part of an assistant reply, or part of a message you sent. A white card appears at the upper right of the caret. A right-click opens the same card.
| Button | What it does |
|---|---|
| 复制 | Copy the selection. |
| 标记 / 取消标记 | Color the span, or clear that mark. After 标记, a row floats above with red, blue, and yellow. + opens a palette. Chosen colors are kept, and there can be at most five. The color stays on the message and does not become a note by itself. |
| 划线 / 取消划线 | Underline the span in gold, or clear that underline. The underline stays on the message and does not become a note by itself. |
| 加入笔记 / 移出笔记 | Add the whole selection to 学习. The message gets a light gray dashed underline. Select that same passage again to remove the note. |
| 提问 / 追问 | Ask about this span. If you already asked, continue that same side conversation. |
The reasoning trace does not open this card.
Notes
Passages added with 加入笔记, plus questions and follow-ups, are listed on the 学习 page. A color mark or a gold underline does not appear there on its own. Each row can edit the excerpt, the question, and the comment, and each row can be deleted. The excerpt keeps bold, italics, and code from the original message. The card shows a preview, including mark colors and gold underlines that fall inside that passage, and the box under it is the Markdown you can change and save. Copying a selection, and 复制笔记, both carry that Markdown. If one passage was split into several notes, edit the excerpt so the one you want covers it, then delete the extras.
Beside the note count, the list can be filtered by category, and categories can be added freely. Each note can be given one; a note without one stays uncategorized. Checked notes can be selected together, then assigned a category or deleted. 复制笔记 includes the category and copies only the notes the filter is showing.
Notes are stored on this machine under ~/.dsh/study-notes/ (%USERPROFILE%\.dsh\study-notes\ on Windows), grouped by workspace, as index.json plus a Markdown file. They are not written into the project you have open.
Select the same span again and the button becomes 取消标记, 取消划线, or 移出笔记. Clearing a color or a gold underline leaves the notes list unchanged. 移出笔记 removes that passage from 学习 and clears the dashed underline. An overlapping selection, or the same words with different line breaks, counts as that mark. The same quote elsewhere is removed with it.
Ask about one sentence
Choose 提问 and type something like “这段是什么”. You can pick a model first.
The sentence is not underlined. The question and the excerpt are saved on the 学习 page. While that sentence is still in the conversation, a small citation mark sits at the end:
- Collapsed, only that mark is visible.
- Expanded, a sticky note beside the sentence shows your question and the latest reply.
- Until the reply is finished, the note says 正在回答….
- Esc, or 合上, closes it.
The question does not replace the main conversation. The reply is written in the side column, not under the main conversation. The side task list still shows this child.
One child keeps going
One note is one side conversation. Different sentences are parallel conversations. They do not nest inside each other.
The child opens in the right column. You type there the same way as in the main conversation, and the next turn extends downward on that page. These three actions all continue that same child:
- Type in the side column.
- Choose 追问 on the same sentence in the main conversation.
- Select text inside the open child and ask again.
The child keeps its own earlier answers. An older one-shot child cannot be continued. Ask again from the main conversation.
Models
You can choose a model in three places: the card that appears after a selection, the ask form on the 学习 page, and the control labeled 模型 above the input of an open child.
- 跟随当前对话 starts the new child with the model of the conversation you asked from.
- 沿用当前模型 leaves the current model in place for this follow-up.
- A named model is used from the first turn of a new child, or from the next reply of a child that is already open. A reply that is already being written is left as it is.
The list starts with DeepSeek V4 Pro and DeepSeek Flash, then the models declared in profiles/desktop/cordis.patch.yml. An unknown model is refused with 没有这个模型. The app's own model menu is absent on a child page, so the switch for that page is the 模型 control above its input.
Install
Install the current release from npm. The profile name is usually desktop.
dsh plugin --profile desktop add dsh-marginalia
Pin a version with dsh-marginalia@0.1.3. After installing or updating, quit DeepSeek Harness completely, including the tray icon, then open it again. Closing the window is not enough.
A local directory works too. Replace the path with the directory that contains this plugin:
dsh plugin --profile desktop add ./path/to/dsh-marginalia
Check the version on npm:
npm view dsh-marginalia version
The package page is https://www.npmjs.com/package/dsh-marginalia .
Requires Node.js 20 or newer, and DeepSeek Harness >=0.2.1-rc.2 <0.3. Version 0.1.3 was written against desktop 0.2.1-rc.2.
Do not also insert this plugin into the profile's own cordis.patch.yml. The CLI reads dsh.bundle.patch in package.json and appends cordis.patch.yml itself. Adding it twice mounts the plugin twice.
Limits
- One mark is at most 4000 characters. One conversation holds at most 400 marks. A comment or a question is at most 2000 characters.
- The sticky note shows at most 20000 characters of the reply.
- There is no automatic summary and no PDF export.
- If the child is not running, changing its model reports 这条进程没有在运行,换不了模型。
Check the package locally:
node --test lib/model.test.js lib/quote.test.js
Publish to npm
A version can be published only once. Change the version, then publish. --no-git-tag-version edits package.json and does not make a Git commit, so Git does not need an author name first.
npm login
npm whoami
npm version patch --no-git-tag-version
npm publish --access public
On npm 11, npm login asks you to confirm in a browser. npm whoami then prints the account name. A successful publish ends with + dsh-marginalia@x.y.z.
A 403 that mentions two-factor authentication or a granular access token with bypass 2fa means the token from the browser login cannot publish. Create a Granular Access Token at https://www.npmjs.com/settings/~/tokens with Read and write permission, All packages, and Bypass two-factor authentication checked. In your own terminal, run npm config set //registry.npmjs.org/:_authToken followed by that token, then npm publish --access public again. Do not put the token or a one-time code in the repository, a chat, or a screenshot. Delete the token after publishing.
License
MIT. Copyright (c) 2026 Angry.fish. See LICENSE.
Comments
Loading…