dsh-obsidian-notes 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -49
- package/README.zh.md +30 -28
- package/lib/client.js +1649 -78
- package/package.json +1 -1
- package/src/client.js +990 -64
- package/src/graph.js +348 -0
- package/src/index.js +234 -2
- package/src/markdown.js +102 -14
- package/src/mindmap.js +207 -0
package/README.md
CHANGED
|
@@ -7,34 +7,35 @@
|
|
|
7
7
|
[](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
|
|
8
8
|
[](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
|
|
9
9
|

|
|
10
|
+
[](https://dshbase.com/zh/plugins/dsh-obsidian-notes/)
|
|
11
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/stargazers)
|
|
10
12
|
|
|
11
13
|
English | [中文](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.zh.md)
|
|
12
14
|
|
|
13
15
|
---
|
|
14
16
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
> spelled out below.
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
A local-first Markdown notes panel that sits in the DSH sidebar and hands notes
|
|
20
|
+
to the chat without copy-paste:
|
|
21
|
+
|
|
22
|
+
1. **Your notes stay beside the conversation.** Point it at a folder of Markdown
|
|
23
|
+
files and you get the vault tree, a line-numbered Obsidian-flavoured preview,
|
|
24
|
+
edit/save, and search across titles and bodies — no import, no sync, no cloud.
|
|
25
|
+
2. **The handoff is the feature.** Cite a whole note as an `@path` mention, or
|
|
26
|
+
select a passage and press **Ask** — the prompt in the composer carries the
|
|
27
|
+
absolute path, the line range and the quoted text, so the model can refer to
|
|
28
|
+
exactly what you read.
|
|
29
|
+
3. **Screenshots become part of the vault.** Paste an image while editing and it
|
|
30
|
+
is saved into the attachment folder as an Obsidian-native
|
|
31
|
+
`![[Pasted image …]]` embed; moving that folder later rewrites the embeds.
|
|
32
|
+
4. **Two ways to see the shape of a vault.** Turn a note into a **mind map**
|
|
33
|
+
built from its headings and list items, or open the **relation graph**
|
|
34
|
+
computed from `[[links]]` and `#tags` — vault-wide, or locally around the open
|
|
35
|
+
note with 1–5 hops.
|
|
36
|
+
|
|
37
|
+
Everything runs on your machine: the plugin reads and writes only the folder you
|
|
38
|
+
choose, and the client talks to the host over its own loopback routes.
|
|
38
39
|
|
|
39
40
|
## Screenshots
|
|
40
41
|
|
|
@@ -46,6 +47,10 @@ to a chat:
|
|
|
46
47
|
| --- | --- |
|
|
47
48
|
|  |  |
|
|
48
49
|
|
|
50
|
+
| Mind map from headings + lists | Vault-wide graph view (notes, links, tags) |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
|  |  |
|
|
53
|
+
|
|
49
54
|

|
|
50
55
|
|
|
51
56
|
## Install
|
|
@@ -58,13 +63,23 @@ A plugin that ships a bundle layer is only composed at startup, so **restart the
|
|
|
58
63
|
DSH host after installing** (desktop: quit and reopen). Refreshing the page is
|
|
59
64
|
not enough.
|
|
60
65
|
|
|
66
|
+
### Already installed? Upgrading
|
|
67
|
+
|
|
68
|
+
Replacing the package and refreshing the page is enough for new UI features: the
|
|
69
|
+
client asks the host which capabilities it has (`/obsidian/root` → `features`)
|
|
70
|
+
and, when the running host is still the previous version, builds data it needs
|
|
71
|
+
from the existing routes instead of erroring. The relation graph, for example,
|
|
72
|
+
falls back to walking the vault with the old tree/note endpoints — no restart
|
|
73
|
+
and no "version mismatch" dialog. Restart the host when you want the faster
|
|
74
|
+
host-side route.
|
|
75
|
+
|
|
61
76
|
### 1. Desktop app (after the npm release)
|
|
62
77
|
|
|
63
78
|
1. Open **Settings → Plugins**.
|
|
64
79
|
2. Search for **`dsh-obsidian-notes`** and install it.
|
|
65
80
|
3. Restart DeepSeek Harness.
|
|
66
81
|
|
|
67
|
-
> This path requires the package to be published on npm
|
|
82
|
+
> This path requires the package to be published on npm.
|
|
68
83
|
> If search shows nothing, use one of the two paths below.
|
|
69
84
|
|
|
70
85
|
### 2. CLI (after the npm release)
|
|
@@ -110,6 +125,18 @@ configured, choose one:
|
|
|
110
125
|
The default vault is `$DSH_WORKSPACE/obsidian_vault`, falling back to
|
|
111
126
|
`./obsidian_vault` under the directory you started `dsh web` from.
|
|
112
127
|
|
|
128
|
+
### Typical workflow
|
|
129
|
+
|
|
130
|
+
1. Open **📚 Notes** and pick a vault (above).
|
|
131
|
+
2. Click a note to read the line-numbered preview; **Edit** to change it, then
|
|
132
|
+
**Save** or <kbd>Ctrl/Cmd+S</kbd>.
|
|
133
|
+
3. To bring a note into the chat, press **⤴ Cite to chat** for the whole note, or
|
|
134
|
+
select text and press **Ask** to attach a question to that passage.
|
|
135
|
+
4. Paste a screenshot while editing to store it in the vault.
|
|
136
|
+
5. Switch the dock to **🧠 Mind map** to explore the note's structure, or open
|
|
137
|
+
**🕸 Graph view** above the tree to see the vault as a graph (**Local** = around
|
|
138
|
+
the open note, **Depth 1–5**).
|
|
139
|
+
|
|
113
140
|
## Features
|
|
114
141
|
|
|
115
142
|
- **Vault sidebar** — lazy directory tree; open a note with one click, create,
|
|
@@ -118,7 +145,21 @@ The default vault is `$DSH_WORKSPACE/obsidian_vault`, falling back to
|
|
|
118
145
|
- **Line-numbered Obsidian preview** — every source line keeps its line number.
|
|
119
146
|
Real tables with alignment, fenced code with language labels, nested lists and
|
|
120
147
|
task lists, all heading levels, setext headings, horizontal rules, and
|
|
121
|
-
clickable `[[wikilinks]]` (aliases and `#sections` included).
|
|
148
|
+
clickable `[[wikilinks]]` (aliases and `#sections` included). Inline Obsidian
|
|
149
|
+
styles render too: `==highlight==`, `~~strikethrough~~`, backslash escapes,
|
|
150
|
+
hidden `%%comments%%`, and `<https://…>` / bare URLs as links.
|
|
151
|
+
- **Graph view** — a vault-wide relation graph built from every note's `[[links]]`
|
|
152
|
+
and `#tags` (no graph file, no export step: it is computed from your Markdown on
|
|
153
|
+
the fly, like Obsidian's own graph). A vault-level entry above the note tree
|
|
154
|
+
opens it as its own view; scroll to zoom, drag to pan, hover to highlight
|
|
155
|
+
neighbours, click a note to open it in the dock. **Local** shows the
|
|
156
|
+
neighbourhood of the note that is currently open; the depth is adjustable
|
|
157
|
+
from 1 to 5 hops (same range as Obsidian's local graph depth slider, default
|
|
158
|
+
1), and **Focus current note** jumps from the vault view straight to it.
|
|
159
|
+
- **Mind map view** — toggle the preview into a horizontal mind map built from the
|
|
160
|
+
note's headings and list items. Scroll to zoom, drag to pan; select a node to
|
|
161
|
+
jump to its source line, or insert that whole branch (node + descendants) into
|
|
162
|
+
the chat as context. Rendering only — the Markdown file is untouched.
|
|
122
163
|
- **Callouts** — `> [!type] title` blocks render with type colours, icons and
|
|
123
164
|
badges. 13 canonical types (`note`, `abstract`, `info`, `todo`, `tip`,
|
|
124
165
|
`success`, `question`, `warning`, `failure`, `danger`, `bug`, `example`,
|
|
@@ -153,26 +194,6 @@ The default vault is `$DSH_WORKSPACE/obsidian_vault`, falling back to
|
|
|
153
194
|
The UI is bilingual (English / Chinese) and uses DSH theme tokens, so it follows
|
|
154
195
|
the app's light and dark themes.
|
|
155
196
|
|
|
156
|
-
## Comparison
|
|
157
|
-
|
|
158
|
-
| | This plugin | [DedsecLemon/dsh-obsidian](https://github.com/DedsecLemon/dsh-obsidian) |
|
|
159
|
-
| --- | --- | --- |
|
|
160
|
-
| Vault tree, search | ✅ tree, title + body search | ✅ tree, whole-vault matching-line search |
|
|
161
|
-
| Obsidian callouts | ✅ 13 types + 15 aliases, line-numbered spine | ✅ rendered, fold state kept |
|
|
162
|
-
| Tables, fenced code, setext headings | ✅ | ✅ |
|
|
163
|
-
| Frontmatter | ✅ preserved on save | ✅ shown as properties |
|
|
164
|
-
| Paste screenshots + attachment folder moves | ✅ | — |
|
|
165
|
-
| Cite a note / ask about a selection | ✅ | — |
|
|
166
|
-
| Session & workspace housekeeping | ✅ | — |
|
|
167
|
-
| Backlinks | ❌ | ✅ |
|
|
168
|
-
| Outline pane | ❌ | ✅ |
|
|
169
|
-
| `==highlight==` | ❌ | ✅ |
|
|
170
|
-
|
|
171
|
-
The point is not "more features" — it is a different trade-off. If you need
|
|
172
|
-
outline and backlinks, use the other plugin (or Obsidian itself); if you want a
|
|
173
|
-
faithful Obsidian reading/editing experience with a clean hand-off into the chat,
|
|
174
|
-
this one is built for that.
|
|
175
|
-
|
|
176
197
|
## Configuration
|
|
177
198
|
|
|
178
199
|
Everything lives inside the notes pane; there is no YAML to edit.
|
|
@@ -246,10 +267,10 @@ Settings are persisted in `$DSH_HOME/dsh-obsidian-vault.json`
|
|
|
246
267
|
- **Node.js:** `^22.19 || >=24` (needed only when running the host from source).
|
|
247
268
|
- **OS:** paths are handled with the platform separator; session paths use
|
|
248
269
|
`$DSH_HOME`. The screenshots above were captured on macOS.
|
|
249
|
-
- **Not rendered** (kept as source text): math, mermaid, footnotes,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
270
|
+
- **Not rendered** (kept as source text): math, mermaid, footnotes, tags, raw
|
|
271
|
+
HTML, note transclusion, audio/PDF embeds, block refs (`^id`), callout
|
|
272
|
+
folding/unknown types/nested callouts, and some inline emphasis edge cases
|
|
273
|
+
(`***bold italic***`, nested emphasis, `_` next to text).
|
|
253
274
|
|
|
254
275
|
## Development
|
|
255
276
|
|
package/README.zh.md
CHANGED
|
@@ -7,22 +7,23 @@
|
|
|
7
7
|
[](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
|
|
8
8
|
[](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
|
|
9
9
|

|
|
10
|
+
[](https://dshbase.com/zh/plugins/dsh-obsidian-notes/)
|
|
11
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/stargazers)
|
|
10
12
|
|
|
11
13
|
[English](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.md) | 中文
|
|
12
14
|
|
|
13
15
|
---
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## 它能做什么
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
([DedsecLemon/dsh-obsidian](https://github.com/DedsecLemon/dsh-obsidian)),
|
|
19
|
-
它适合需要大纲、反链和高亮的人。本插件押的是另外三件事 —— 如果你习惯「一边写笔记、一边和模型讨论」,这三件更重要:
|
|
19
|
+
一个本地优先的 Markdown 笔记面板:在 DSH 侧边栏里读笔记,并把笔记顺手递进对话,不用复制粘贴。
|
|
20
20
|
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
21
|
+
1. **笔记就在对话旁边。** 指向一个 Markdown 文件夹,就有目录树、带行号的 Obsidian 风格预览、编辑保存,以及标题和正文搜索——不导入、不同步、不上云。
|
|
22
|
+
2. **「递进对话」本身就是功能。** 整篇引用为 `@绝对路径`;选中一段点 **Ask**,输入框里的 prompt 带着绝对路径、行号区间和原文,模型能准确引用你正在看的这一段。
|
|
23
|
+
3. **截图直接进笔记库。** 编辑时粘贴图片会存进附件目录,并写成 Obsidian 原生的 `![[Pasted image …]]`;以后迁移附件目录,全库引用会一起改写。
|
|
24
|
+
4. **两种看结构的方式。** 把笔记切换成由标题和列表生成的**思维导图**;或打开由 `[[双链]]` 和 `#标签` 现算的**关系图谱**——全库视角,或聚焦当前笔记的 1–5 跳局部视角。
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
全部在本机运行:插件只读写你选择的文件夹,客户端只走宿主自己的 loopback 路由。
|
|
26
27
|
|
|
27
28
|
## 截图
|
|
28
29
|
|
|
@@ -34,6 +35,10 @@ DSH 生态里已经有一个 Obsidian 方向的插件
|
|
|
34
35
|
| --- | --- |
|
|
35
36
|
|  |  |
|
|
36
37
|
|
|
38
|
+
| 由标题 + 列表生成的思维导图 | 全库关系图谱(笔记、双链、标签) |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
|  |  |
|
|
41
|
+
|
|
37
42
|

|
|
38
43
|
|
|
39
44
|
## 安装
|
|
@@ -42,13 +47,17 @@ DSH 生态里已经有一个 Obsidian 方向的插件
|
|
|
42
47
|
|
|
43
48
|
带 bundle 的插件只在启动时装配,所以**安装后必须重启 DSH host**(桌面版:退出再打开)。只刷新页面不够。
|
|
44
49
|
|
|
50
|
+
### 已经装过?升级说明
|
|
51
|
+
|
|
52
|
+
换掉包、刷新页面就能用上新界面能力:客户端会先问 host 支持哪些能力(`/obsidian/root` → `features`),如果运行中的 host 还是旧版,就用**已有接口在浏览器里自建**需要的数据,而不是弹「版本不匹配」错误。比如关系图谱在旧 host 上会回退成用旧的 tree/note 接口遍历 vault 构建——不用重启、也不会看到报错。想要更快的 host 侧路径时再重启一次即可。
|
|
53
|
+
|
|
45
54
|
### 1. 桌面版(npm 发布后)
|
|
46
55
|
|
|
47
56
|
1. 打开 **Settings → Plugins**;
|
|
48
57
|
2. 搜索 **`dsh-obsidian-notes`** 并安装;
|
|
49
58
|
3. 重启 DeepSeek Harness。
|
|
50
59
|
|
|
51
|
-
> 这条路径要求 npm
|
|
60
|
+
> 这条路径要求 npm 上已有该包。搜不到时用下面两种方式。
|
|
52
61
|
|
|
53
62
|
### 2. CLI(npm 发布后)
|
|
54
63
|
|
|
@@ -89,10 +98,20 @@ dsh plugin --profile web add "$(pwd)" # PowerShell 用 "$PWD"
|
|
|
89
98
|
默认 Vault 为 `$DSH_WORKSPACE/obsidian_vault`,缺省回落到启动 `dsh web` 目录下的
|
|
90
99
|
`./obsidian_vault`。
|
|
91
100
|
|
|
101
|
+
### 典型用法
|
|
102
|
+
|
|
103
|
+
1. 打开 **📚 笔记**,先选一个 Vault(见上)。
|
|
104
|
+
2. 点击笔记读带行号的预览;点 **编辑** 修改,再点 **保存** 或 <kbd>Ctrl/Cmd+S</kbd>。
|
|
105
|
+
3. 把笔记带进对话:整篇点 **⤴ 引用到对话**;选中一段点 **Ask**,把问题附着在那段文字上。
|
|
106
|
+
4. 编辑时粘贴截图,会存进 Vault 的附件目录。
|
|
107
|
+
5. 把 Dock 切成 **🧠 思维导图** 看笔记结构;或点笔记树上方的 **🕸 关系图谱** 看全库图(**局部** = 当前笔记周围,**跳数 1–5**)。
|
|
108
|
+
|
|
92
109
|
## 功能
|
|
93
110
|
|
|
94
111
|
- **Vault 侧边栏**:按需加载的目录树;单击打开笔记,新建 / 重命名 / 删除笔记与文件夹,按标题**和正文**搜索,显示笔记数徽标。
|
|
95
|
-
- **带行号的 Obsidian 预览**:一行源码对应一行渲染并带行号。真表格(支持 `:---` / `:---:` / `---:` 对齐)、带语言标签的围栏代码、嵌套列表与任务列表、`#`~`######` 标题、setext 标题、分隔线、可点击的 `[[双链]]`(含别名与
|
|
112
|
+
- **带行号的 Obsidian 预览**:一行源码对应一行渲染并带行号。真表格(支持 `:---` / `:---:` / `---:` 对齐)、带语言标签的围栏代码、嵌套列表与任务列表、`#`~`######` 标题、setext 标题、分隔线、可点击的 `[[双链]]`(含别名与 `#章节`);行内也支持 `==高亮==`、`~~删除线~~`、反斜杠转义、隐藏的 `%%注释%%`,以及 `<https://…>` / 裸 URL 自动成链。
|
|
113
|
+
- **关系图谱**:全库关系图,节点/连线直接由每篇笔记的 `[[双链]]` 与 `#标签` 现算(没有额外图谱文件,也不导出——和 Obsidian 自己的图谱一样从 Markdown 推导)。入口在笔记树上方的 vault 级「🕸 关系图谱」行,点击后在独立视图里显示;滚轮缩放、拖动平移、悬停高亮邻居、点笔记节点在 Dock 里打开。切到「局部」可看当前打开笔记的邻居,跳数可在 1–5 之间调(与 Obsidian 局部图谱的 depth 范围一致,默认 1);「聚焦当前笔记」可从全库一键切到该视角。
|
|
114
|
+
- **思维导图视图**:把预览切换成由标题 + 列表生成的横向思维导图。滚轮缩放、拖动平移;选中节点可跳到对应源码行,或把「该分支(节点 + 全部后代)」作为上下文插入对话。纯渲染,不改动 Markdown 文件。
|
|
96
115
|
- **Callout**:`> [!type] 标题` 按类型渲染颜色、图标与徽标。13 种规范类型(`note`、`abstract`、`info`、`todo`、`tip`、`success`、`question`、`warning`、`failure`、`danger`、`bug`、`example`、`quote`)+ 15 个 Obsidian 别名(`summary`、`tldr`、`hint`、`important`、`check`、`done`、`help`、`faq`、`caution`、`attention`、`fail`、`missing`、`error`、`cite`、`none`)。
|
|
97
116
|
- **编辑与保存**:带行号的源码编辑器,点 `保存` 或按 <kbd>Ctrl/Cmd+S</kbd>。YAML frontmatter 不进编辑器,保存时原样拼回;外部对 YAML 的改动不会被覆盖。
|
|
98
117
|
- **粘贴截图**:编辑时 <kbd>Ctrl/Cmd+V</kbd> 把剪贴板图片写入附件目录,并在光标处插入 Obsidian 原生写法 `![[Pasted image <时间戳>.png]]`(单张上限 20 MB),写进 `.md` 的内容可被真实 Obsidian 识别。
|
|
@@ -103,23 +122,6 @@ dsh plugin --profile web add "$(pwd)" # PowerShell 用 "$PWD"
|
|
|
103
122
|
|
|
104
123
|
界面中英双语,使用 DSH 主题变量,跟随应用的浅色 / 深色主题。
|
|
105
124
|
|
|
106
|
-
## 对比
|
|
107
|
-
|
|
108
|
-
| | 本插件 | [DedsecLemon/dsh-obsidian](https://github.com/DedsecLemon/dsh-obsidian) |
|
|
109
|
-
| --- | --- | --- |
|
|
110
|
-
| Vault 目录树、搜索 | ✅ 目录树 + 标题/正文搜索 | ✅ 目录树 + 全库命中行搜索 |
|
|
111
|
-
| Obsidian callout | ✅ 13 种类型 + 15 别名,逐行渲染 | ✅ 渲染,保留折叠状态 |
|
|
112
|
-
| 表格、围栏代码、setext 标题 | ✅ | ✅ |
|
|
113
|
-
| frontmatter | ✅ 保存时原样拼回 | ✅ 以属性区展示 |
|
|
114
|
-
| 粘贴截图 + 附件目录迁移 | ✅ | — |
|
|
115
|
-
| 整篇引用 / 选中片段提问 | ✅ | — |
|
|
116
|
-
| 会话与工作区整理 | ✅ | — |
|
|
117
|
-
| 反链 | ❌ | ✅ |
|
|
118
|
-
| 大纲面板 | ❌ | ✅ |
|
|
119
|
-
| `==高亮==` | ❌ | ✅ |
|
|
120
|
-
|
|
121
|
-
比的不是「功能多少」,而是取舍:需要大纲和反链,用另一个插件(或真 Obsidian);想要忠实的 Obsidian 阅读/编辑体验、并顺手把笔记递进对话,这个插件就是为此写的。
|
|
122
|
-
|
|
123
125
|
## 配置
|
|
124
126
|
|
|
125
127
|
所有配置都在笔记面板里完成,不用手改 YAML。
|
|
@@ -165,7 +167,7 @@ dsh plugin --profile web add "$(pwd)" # PowerShell 用 "$PWD"
|
|
|
165
167
|
- **DSH:** 已对照 **0.2.1-rc.5** 验证(Web UI、桌面版外壳)。composer 集成面向 DSH 0.2 的 Lexical 输入框,并保留 0.1.x textarea 的降级路径。
|
|
166
168
|
- **Node.js:** `^22.19 || >=24`(仅从源码运行 host 时需要)。
|
|
167
169
|
- **系统:** 路径按平台分隔符处理,会话路径基于 `$DSH_HOME`。上面的截图在 macOS 上录制。
|
|
168
|
-
- **不渲染(保持原文显示)**:数学公式、mermaid
|
|
170
|
+
- **不渲染(保持原文显示)**:数学公式、mermaid、脚注、标签、裸 HTML、笔记 transclusion、音频/PDF 嵌入、块引用 `^id`、callout 折叠/未知类型/嵌套,以及部分行内强调边界(`***粗斜体***`、嵌套强调、`_` 相邻文本)。
|
|
169
171
|
|
|
170
172
|
## 开发
|
|
171
173
|
|