dsh-obsidian-notes 0.5.0 → 0.5.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 +16 -13
- package/README.zh.md +16 -13
- package/lib/client.js +24 -10
- package/package.json +4 -4
- package/src/client.js +24 -10
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
**A local Obsidian-style notes pane for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) web UI.** Point it at a folder of Markdown files, then read, edit, search and cite them next to the conversation — without opening Obsidian, without importing anything, and without your notes leaving the machine.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
|
-
[](https://github.com/revive123456/dsh-obsidian-
|
|
7
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
English | [中文](https://github.com/revive123456/dsh-obsidian-
|
|
11
|
+
English | [中文](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.zh.md)
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -40,13 +40,13 @@ to a chat:
|
|
|
40
40
|
|
|
41
41
|
| Notes tree + docked preview | Callouts, line numbers, badges |
|
|
42
42
|
| --- | --- |
|
|
43
|
-
|  |  |
|
|
44
44
|
|
|
45
45
|
| Real tables and fenced code | Edit with a line-numbered source view |
|
|
46
46
|
| --- | --- |
|
|
47
|
-
|  |  |
|
|
48
48
|
|
|
49
|
-

|
|
50
50
|
|
|
51
51
|
## Install
|
|
52
52
|
|
|
@@ -79,8 +79,8 @@ dsh web
|
|
|
79
79
|
### 3. From source (works before the npm release)
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
git clone https://github.com/revive123456/dsh-obsidian-
|
|
83
|
-
cd dsh-obsidian-
|
|
82
|
+
git clone https://github.com/revive123456/dsh-obsidian-notes.git
|
|
83
|
+
cd dsh-obsidian-notes
|
|
84
84
|
npm i # runs build.mjs via prepare → lib/client.js
|
|
85
85
|
dsh plugin --profile web add "$(pwd)" # PowerShell: "$PWD"
|
|
86
86
|
# restart `dsh web`
|
|
@@ -97,7 +97,7 @@ boot.
|
|
|
97
97
|
|
|
98
98
|
**Uninstall:** `dsh plugin --profile web remove dsh-obsidian-notes`, then restart.
|
|
99
99
|
If you installed it the old way (manual `cordis.patch.yml` row), see
|
|
100
|
-
[docs/legacy-install.md](https://github.com/revive123456/dsh-obsidian-
|
|
100
|
+
[docs/legacy-install.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/docs/legacy-install.md).
|
|
101
101
|
|
|
102
102
|
### First run
|
|
103
103
|
|
|
@@ -271,13 +271,16 @@ Repository layout:
|
|
|
271
271
|
| `src/session-store.js` | Session log discovery and deletion |
|
|
272
272
|
| `lib/client.js` | Build artifact (gitignored; produced by `npm run build`) |
|
|
273
273
|
| `cordis.patch.yml` | The bundle layer inserted by `dsh plugin add` |
|
|
274
|
-
| `tools/demo/` | Isolated demo environment + headless-Chrome asset pipeline (see [tools/demo/README.md](https://github.com/revive123456/dsh-obsidian-
|
|
274
|
+
| `tools/demo/` | Isolated demo environment + headless-Chrome asset pipeline (see [tools/demo/README.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/tools/demo/README.md)) |
|
|
275
275
|
| `docs/assets/` | The screenshots and GIF used above |
|
|
276
276
|
|
|
277
277
|
The plugin never modifies the DSH installation: it only contributes a bundle
|
|
278
278
|
layer plus host/client plugin modules.
|
|
279
279
|
|
|
280
|
+
Contributions are welcome through pull requests — `main` is protected and only
|
|
281
|
+
the maintainer can push to it. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
282
|
+
|
|
280
283
|
## License
|
|
281
284
|
|
|
282
|
-
[MIT](https://github.com/revive123456/dsh-obsidian-
|
|
283
|
-
[docs/troubleshooting.md](https://github.com/revive123456/dsh-obsidian-
|
|
285
|
+
[MIT](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE). See [README.zh.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.zh.md) for the Chinese version and
|
|
286
|
+
[docs/troubleshooting.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/docs/troubleshooting.md) for troubleshooting.
|
package/README.zh.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
**DeepSeek Harness Web 的本地 Obsidian 风格笔记面板。** 指向一个 Markdown 文件夹,就能在对话旁边浏览、编辑、搜索、引用笔记 —— 不用装 Obsidian、不用导入,笔记也不会离开这台机器。
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
|
-
[](https://github.com/revive123456/dsh-obsidian-
|
|
7
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
[English](https://github.com/revive123456/dsh-obsidian-
|
|
11
|
+
[English](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.md) | 中文
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -28,13 +28,13 @@ DSH 生态里已经有一个 Obsidian 方向的插件
|
|
|
28
28
|
|
|
29
29
|
| 侧边栏笔记树 + 右侧预览 | Callout、行号、类型徽标 |
|
|
30
30
|
| --- | --- |
|
|
31
|
-
|  |  |
|
|
32
32
|
|
|
33
33
|
| 真表格与围栏代码 | 带行号的源码编辑视图 |
|
|
34
34
|
| --- | --- |
|
|
35
|
-
|  |  |
|
|
36
36
|
|
|
37
|
-

|
|
38
38
|
|
|
39
39
|
## 安装
|
|
40
40
|
|
|
@@ -62,8 +62,8 @@ dsh web
|
|
|
62
62
|
### 3. 从源码安装(npm 发布前也能用)
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
git clone https://github.com/revive123456/dsh-obsidian-
|
|
66
|
-
cd dsh-obsidian-
|
|
65
|
+
git clone https://github.com/revive123456/dsh-obsidian-notes.git
|
|
66
|
+
cd dsh-obsidian-notes
|
|
67
67
|
npm i # 通过 prepare 跑 build.mjs → 生成 lib/client.js
|
|
68
68
|
dsh plugin --profile web add "$(pwd)" # PowerShell 用 "$PWD"
|
|
69
69
|
# 重启 `dsh web`
|
|
@@ -77,7 +77,7 @@ dsh plugin --profile web add "$(pwd)" # PowerShell 用 "$PWD"
|
|
|
77
77
|
> clone + `npm i` + 安装本地路径。
|
|
78
78
|
|
|
79
79
|
**卸载:** `dsh plugin --profile web remove dsh-obsidian-notes`,然后重启。若当年是手工改
|
|
80
|
-
`cordis.patch.yml` 装的,见 [docs/legacy-install.md](https://github.com/revive123456/dsh-obsidian-
|
|
80
|
+
`cordis.patch.yml` 装的,见 [docs/legacy-install.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/docs/legacy-install.md)。
|
|
81
81
|
|
|
82
82
|
### 首次使用
|
|
83
83
|
|
|
@@ -187,12 +187,15 @@ npm run check:bundle # bundle 清单一致性(patch 文件、module id、fil
|
|
|
187
187
|
| `src/session-store.js` | 会话日志发现与删除 |
|
|
188
188
|
| `lib/client.js` | 构建产物(gitignore;由 `npm run build` 生成) |
|
|
189
189
|
| `cordis.patch.yml` | `dsh plugin add` 安装后生效的 bundle 层 |
|
|
190
|
-
| `tools/demo/` | 隔离 demo 环境 + 无头 Chrome 资产生成流程(见 [tools/demo/README.md](https://github.com/revive123456/dsh-obsidian-
|
|
190
|
+
| `tools/demo/` | 隔离 demo 环境 + 无头 Chrome 资产生成流程(见 [tools/demo/README.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/tools/demo/README.md)) |
|
|
191
191
|
| `docs/assets/` | 上面用到的截图与 GIF |
|
|
192
192
|
|
|
193
193
|
插件不修改 DSH 安装本身:只贡献一个 bundle 层和 host/client 插件模块。
|
|
194
194
|
|
|
195
|
+
欢迎通过 PR 贡献 —— `main` 已开启分支保护,只有维护者能直接 push。见
|
|
196
|
+
[CONTRIBUTING.md](CONTRIBUTING.md)。
|
|
197
|
+
|
|
195
198
|
## 许可
|
|
196
199
|
|
|
197
|
-
[MIT](https://github.com/revive123456/dsh-obsidian-
|
|
198
|
-
[docs/troubleshooting.zh.md](https://github.com/revive123456/dsh-obsidian-
|
|
200
|
+
[MIT](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)。英文版见 [README.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/README.md),排障见
|
|
201
|
+
[docs/troubleshooting.zh.md](https://github.com/revive123456/dsh-obsidian-notes/blob/main/docs/troubleshooting.zh.md)。
|
package/lib/client.js
CHANGED
|
@@ -1218,6 +1218,13 @@ window.__ModuleLoader__.load({
|
|
|
1218
1218
|
askSend: "发送",
|
|
1219
1219
|
askCancel: "Esc 取消",
|
|
1220
1220
|
askCap: "针对选中内容提问…({n} 字符)",
|
|
1221
|
+
askChars: "{n} 字符",
|
|
1222
|
+
askCited: "已引用选中片段({n} 字符)",
|
|
1223
|
+
promptLine: "第 {a} 行",
|
|
1224
|
+
promptLines: "第 {a}–{b} 行",
|
|
1225
|
+
promptDefaultQ: "请解释这段内容",
|
|
1226
|
+
promptLong: "(片段较长,共 {n} 字符,请阅读 @文件 第 {a}–{b} 行)",
|
|
1227
|
+
promptQuestion: "【问题】",
|
|
1221
1228
|
rename: "重命名",
|
|
1222
1229
|
delete: "删除",
|
|
1223
1230
|
deleteConfirm: "确认删除该笔记?此操作不可恢复。",
|
|
@@ -1348,6 +1355,13 @@ window.__ModuleLoader__.load({
|
|
|
1348
1355
|
askSend: "Send",
|
|
1349
1356
|
askCancel: "Esc to cancel",
|
|
1350
1357
|
askCap: "Ask about the selection…({n} chars)",
|
|
1358
|
+
askChars: "{n} chars",
|
|
1359
|
+
askCited: "Cited the selected passage ({n} chars)",
|
|
1360
|
+
promptLine: "Line {a}",
|
|
1361
|
+
promptLines: "Lines {a}–{b}",
|
|
1362
|
+
promptDefaultQ: "Please explain this passage",
|
|
1363
|
+
promptLong: "(long selection: {n} chars; read @file lines {a}–{b})",
|
|
1364
|
+
promptQuestion: "Question:",
|
|
1351
1365
|
rename: "Rename",
|
|
1352
1366
|
delete: "Delete",
|
|
1353
1367
|
deleteConfirm: "Delete this note? This cannot be undone.",
|
|
@@ -1640,19 +1654,19 @@ window.__ModuleLoader__.load({
|
|
|
1640
1654
|
return line;
|
|
1641
1655
|
}
|
|
1642
1656
|
|
|
1643
|
-
/** 生成「@路径 + 行数 + > 选中内容 +
|
|
1644
|
-
function buildPrompt(absPath, content, span, question) {
|
|
1657
|
+
/** 生成「@路径 + 行数 + > 选中内容 + 问题标签」的注入 prompt(无多余空行)。 */
|
|
1658
|
+
function buildPrompt(t, absPath, content, span, question) {
|
|
1645
1659
|
const lineA = offsetToLine(content, span.start);
|
|
1646
1660
|
const lineB = offsetToLine(content, span.end - 1);
|
|
1647
|
-
const range = lineA === lineB ?
|
|
1648
|
-
const q = (question || "").trim() || "
|
|
1661
|
+
const range = lineA === lineB ? t("promptLine", { a: lineA }) : t("promptLines", { a: lineA, b: lineB });
|
|
1662
|
+
const q = (question || "").trim() || t("promptDefaultQ");
|
|
1649
1663
|
const lines = [`@${absPath}`, range];
|
|
1650
1664
|
if (span.text.length <= SEL_CHAR_LIMIT) {
|
|
1651
1665
|
for (const l of span.text.split("\n")) lines.push(`> ${l}`);
|
|
1652
1666
|
} else {
|
|
1653
|
-
lines.push(`>
|
|
1667
|
+
lines.push(`> ${t("promptLong", { n: span.text.length, a: lineA, b: lineB })}`);
|
|
1654
1668
|
}
|
|
1655
|
-
lines.push(
|
|
1669
|
+
lines.push(`${t("promptQuestion")} ${q}`);
|
|
1656
1670
|
return lines.join("\n");
|
|
1657
1671
|
}
|
|
1658
1672
|
|
|
@@ -3759,9 +3773,9 @@ window.__ModuleLoader__.load({
|
|
|
3759
3773
|
|
|
3760
3774
|
const submitAsk = useCallback((question) => {
|
|
3761
3775
|
if (!ask) return;
|
|
3762
|
-
const prompt = buildPrompt(ask.basePath, ask.content, ask.span, question);
|
|
3776
|
+
const prompt = buildPrompt(t, ask.basePath, ask.content, ask.span, question);
|
|
3763
3777
|
if (injectPrompt(prompt)) {
|
|
3764
|
-
showToast(
|
|
3778
|
+
showToast(t("askCited", { n: ask.span.text.length }));
|
|
3765
3779
|
} else {
|
|
3766
3780
|
try {
|
|
3767
3781
|
if (typeof navigator !== "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText === "function") {
|
|
@@ -4064,8 +4078,8 @@ window.__ModuleLoader__.load({
|
|
|
4064
4078
|
)
|
|
4065
4079
|
: createElement("div", { className: "dsh-obs-askbar" },
|
|
4066
4080
|
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => { setAskOpen(true); setDraftQ(""); } }, `💬 ${t("ask")}`),
|
|
4067
|
-
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => submitAsk("
|
|
4068
|
-
createElement("span", { className: "dsh-obs-asklen" },
|
|
4081
|
+
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => submitAsk(t("promptDefaultQ")) }, `⚡ ${t("explain")}`),
|
|
4082
|
+
createElement("span", { className: "dsh-obs-asklen" }, t("askChars", { n: ask.span.text.length })),
|
|
4069
4083
|
),
|
|
4070
4084
|
),
|
|
4071
4085
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-obsidian-notes",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Obsidian-style notes panel for DeepSeek Harness Web: vault directory tree, Markdown preview/edit/save, cite-to-chat, batch archive/delete of sessions and workspaces. DSH 内嵌 Obsidian 风格笔记面板:目录树 + Markdown 预览/编辑/保存 + 引用到对话 + 会话/工作区批量操作。",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^22.19 || >=24"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
],
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/revive123456/dsh-obsidian-
|
|
29
|
+
"url": "git+https://github.com/revive123456/dsh-obsidian-notes.git"
|
|
30
30
|
},
|
|
31
|
-
"homepage": "https://github.com/revive123456/dsh-obsidian-
|
|
31
|
+
"homepage": "https://github.com/revive123456/dsh-obsidian-notes#readme",
|
|
32
32
|
"bugs": {
|
|
33
|
-
"url": "https://github.com/revive123456/dsh-obsidian-
|
|
33
|
+
"url": "https://github.com/revive123456/dsh-obsidian-notes/issues"
|
|
34
34
|
},
|
|
35
35
|
"dsh": {
|
|
36
36
|
"bundle": {
|
package/src/client.js
CHANGED
|
@@ -121,6 +121,13 @@
|
|
|
121
121
|
askSend: "发送",
|
|
122
122
|
askCancel: "Esc 取消",
|
|
123
123
|
askCap: "针对选中内容提问…({n} 字符)",
|
|
124
|
+
askChars: "{n} 字符",
|
|
125
|
+
askCited: "已引用选中片段({n} 字符)",
|
|
126
|
+
promptLine: "第 {a} 行",
|
|
127
|
+
promptLines: "第 {a}–{b} 行",
|
|
128
|
+
promptDefaultQ: "请解释这段内容",
|
|
129
|
+
promptLong: "(片段较长,共 {n} 字符,请阅读 @文件 第 {a}–{b} 行)",
|
|
130
|
+
promptQuestion: "【问题】",
|
|
124
131
|
rename: "重命名",
|
|
125
132
|
delete: "删除",
|
|
126
133
|
deleteConfirm: "确认删除该笔记?此操作不可恢复。",
|
|
@@ -251,6 +258,13 @@
|
|
|
251
258
|
askSend: "Send",
|
|
252
259
|
askCancel: "Esc to cancel",
|
|
253
260
|
askCap: "Ask about the selection…({n} chars)",
|
|
261
|
+
askChars: "{n} chars",
|
|
262
|
+
askCited: "Cited the selected passage ({n} chars)",
|
|
263
|
+
promptLine: "Line {a}",
|
|
264
|
+
promptLines: "Lines {a}–{b}",
|
|
265
|
+
promptDefaultQ: "Please explain this passage",
|
|
266
|
+
promptLong: "(long selection: {n} chars; read @file lines {a}–{b})",
|
|
267
|
+
promptQuestion: "Question:",
|
|
254
268
|
rename: "Rename",
|
|
255
269
|
delete: "Delete",
|
|
256
270
|
deleteConfirm: "Delete this note? This cannot be undone.",
|
|
@@ -543,19 +557,19 @@
|
|
|
543
557
|
return line;
|
|
544
558
|
}
|
|
545
559
|
|
|
546
|
-
/** 生成「@路径 + 行数 + > 选中内容 +
|
|
547
|
-
function buildPrompt(absPath, content, span, question) {
|
|
560
|
+
/** 生成「@路径 + 行数 + > 选中内容 + 问题标签」的注入 prompt(无多余空行)。 */
|
|
561
|
+
function buildPrompt(t, absPath, content, span, question) {
|
|
548
562
|
const lineA = offsetToLine(content, span.start);
|
|
549
563
|
const lineB = offsetToLine(content, span.end - 1);
|
|
550
|
-
const range = lineA === lineB ?
|
|
551
|
-
const q = (question || "").trim() || "
|
|
564
|
+
const range = lineA === lineB ? t("promptLine", { a: lineA }) : t("promptLines", { a: lineA, b: lineB });
|
|
565
|
+
const q = (question || "").trim() || t("promptDefaultQ");
|
|
552
566
|
const lines = [`@${absPath}`, range];
|
|
553
567
|
if (span.text.length <= SEL_CHAR_LIMIT) {
|
|
554
568
|
for (const l of span.text.split("\n")) lines.push(`> ${l}`);
|
|
555
569
|
} else {
|
|
556
|
-
lines.push(`>
|
|
570
|
+
lines.push(`> ${t("promptLong", { n: span.text.length, a: lineA, b: lineB })}`);
|
|
557
571
|
}
|
|
558
|
-
lines.push(
|
|
572
|
+
lines.push(`${t("promptQuestion")} ${q}`);
|
|
559
573
|
return lines.join("\n");
|
|
560
574
|
}
|
|
561
575
|
|
|
@@ -2662,9 +2676,9 @@
|
|
|
2662
2676
|
|
|
2663
2677
|
const submitAsk = useCallback((question) => {
|
|
2664
2678
|
if (!ask) return;
|
|
2665
|
-
const prompt = buildPrompt(ask.basePath, ask.content, ask.span, question);
|
|
2679
|
+
const prompt = buildPrompt(t, ask.basePath, ask.content, ask.span, question);
|
|
2666
2680
|
if (injectPrompt(prompt)) {
|
|
2667
|
-
showToast(
|
|
2681
|
+
showToast(t("askCited", { n: ask.span.text.length }));
|
|
2668
2682
|
} else {
|
|
2669
2683
|
try {
|
|
2670
2684
|
if (typeof navigator !== "undefined" && navigator.clipboard && typeof navigator.clipboard.writeText === "function") {
|
|
@@ -2967,8 +2981,8 @@
|
|
|
2967
2981
|
)
|
|
2968
2982
|
: createElement("div", { className: "dsh-obs-askbar" },
|
|
2969
2983
|
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => { setAskOpen(true); setDraftQ(""); } }, `💬 ${t("ask")}`),
|
|
2970
|
-
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => submitAsk("
|
|
2971
|
-
createElement("span", { className: "dsh-obs-asklen" },
|
|
2984
|
+
createElement("button", { onMouseDown: (e) => e.preventDefault(), onClick: () => submitAsk(t("promptDefaultQ")) }, `⚡ ${t("explain")}`),
|
|
2985
|
+
createElement("span", { className: "dsh-obs-asklen" }, t("askChars", { n: ask.span.text.length })),
|
|
2972
2986
|
),
|
|
2973
2987
|
),
|
|
2974
2988
|
);
|