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 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
- ![The notes pane in action: open the vault tree, browse callouts, edit a note, save it, ask about a selected line](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/hero.gif)
5
+ ![The notes pane in action: open the vault tree, read a callout note, select a passage, ask about it — the composed prompt lands in the DSH composer, gets sent, and the answer comes back in the chat](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/hero.gif?v=2)
6
6
 
7
- [![CI](https://github.com/revive123456/dsh-obsidian-vault/actions/workflows/ci.yml/badge.svg)](https://github.com/revive123456/dsh-obsidian-vault/actions/workflows/ci.yml)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/revive123456/dsh-obsidian-vault/blob/main/LICENSE)
7
+ [![CI](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml/badge.svg)](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
9
9
  ![DSH 0.2.1+](https://img.shields.io/badge/DSH-0.2.1%2B-blueviolet)
10
10
 
11
- English | [中文](https://github.com/revive123456/dsh-obsidian-vault/blob/main/README.zh.md)
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
- | ![Sidebar notes tree with the preview dock open](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-sidebar.png) | ![Coloured Obsidian callouts with one source line per rendered line](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-callouts.png) |
43
+ | ![Sidebar notes tree with the preview dock open](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-sidebar.png) | ![Coloured Obsidian callouts with one source line per rendered line](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-callouts.png) |
44
44
 
45
45
  | Real tables and fenced code | Edit with a line-numbered source view |
46
46
  | --- | --- |
47
- | ![Table with column alignment and a TypeScript code fence](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-markdown.png) | ![Editor with line numbers and Save button](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-editing.png) |
47
+ | ![Table with column alignment and a TypeScript code fence](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-markdown.png) | ![Editor with line numbers and Save button](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-editing.png) |
48
48
 
49
- ![Select a passage and ask about it: path, line numbers and quote are sent with the question](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-ask.png)
49
+ ![Select a passage and ask about it: path, line numbers and quote are sent with the question](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-ask.png)
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-vault.git
83
- cd dsh-obsidian-vault
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-vault/blob/main/docs/legacy-install.md).
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-vault/blob/main/tools/demo/README.md)) |
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-vault/blob/main/LICENSE). See [README.zh.md](https://github.com/revive123456/dsh-obsidian-vault/blob/main/README.zh.md) for the Chinese version and
283
- [docs/troubleshooting.md](https://github.com/revive123456/dsh-obsidian-vault/blob/main/docs/troubleshooting.md) for troubleshooting.
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
- ![笔记面板演示:打开目录树、浏览 callout、编辑保存、选中一段文字提问](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/hero.gif)
5
+ ![笔记面板演示:打开目录树、阅读 callout 笔记、选中一段文字提问 —— 组合好的 prompt 进入 DSH 输入框、发送后回答出现在对话里](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/hero.gif?v=2)
6
6
 
7
- [![CI](https://github.com/revive123456/dsh-obsidian-vault/actions/workflows/ci.yml/badge.svg)](https://github.com/revive123456/dsh-obsidian-vault/actions/workflows/ci.yml)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/revive123456/dsh-obsidian-vault/blob/main/LICENSE)
7
+ [![CI](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml/badge.svg)](https://github.com/revive123456/dsh-obsidian-notes/actions/workflows/ci.yml)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/revive123456/dsh-obsidian-notes/blob/main/LICENSE)
9
9
  ![DSH 0.2.1+](https://img.shields.io/badge/DSH-0.2.1%2B-blueviolet)
10
10
 
11
- [English](https://github.com/revive123456/dsh-obsidian-vault/blob/main/README.md) | 中文
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
- | ![侧边栏笔记树与右侧预览](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-sidebar.png) | ![彩色 Obsidian callout,一行源码对应一行渲染](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-callouts.png) |
31
+ | ![侧边栏笔记树与右侧预览](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-sidebar.png) | ![彩色 Obsidian callout,一行源码对应一行渲染](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-callouts.png) |
32
32
 
33
33
  | 真表格与围栏代码 | 带行号的源码编辑视图 |
34
34
  | --- | --- |
35
- | ![带列对齐的表格与 TypeScript 代码块](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-markdown.png) | ![带行号的编辑器与保存按钮](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-editing.png) |
35
+ | ![带列对齐的表格与 TypeScript 代码块](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-markdown.png) | ![带行号的编辑器与保存按钮](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-editing.png) |
36
36
 
37
- ![选中一段文字提问:路径、行号与原文会随问题一起注入](https://raw.githubusercontent.com/revive123456/dsh-obsidian-vault/main/docs/assets/screenshot-ask.png)
37
+ ![选中一段文字提问:路径、行号与原文会随问题一起注入](https://raw.githubusercontent.com/revive123456/dsh-obsidian-notes/main/docs/assets/screenshot-ask.png)
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-vault.git
66
- cd dsh-obsidian-vault
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-vault/blob/main/docs/legacy-install.md)。
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-vault/blob/main/tools/demo/README.md)) |
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-vault/blob/main/LICENSE)。英文版见 [README.md](https://github.com/revive123456/dsh-obsidian-vault/blob/main/README.md),排障见
198
- [docs/troubleshooting.zh.md](https://github.com/revive123456/dsh-obsidian-vault/blob/main/docs/troubleshooting.zh.md)。
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
- /** 生成「@路径 + 行数 + > 选中内容 + 【问题】」的注入 prompt(无多余空行) */
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 ? `第 ${lineA} 行` : `第 ${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(`> (片段较长,共 ${span.text.length} 字符,请阅读 @文件 第 ${lineA}–${lineB} 行)`);
1667
+ lines.push(`> ${t("promptLong", { n: span.text.length, a: lineA, b: lineB })}`);
1654
1668
  }
1655
- lines.push(`【问题】${q}`);
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(`${t("cited")}:已引用选中片段(${ask.span.text.length} 字符)`);
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("请解释这段内容") }, `⚡ ${t("explain")}`),
4068
- createElement("span", { className: "dsh-obs-asklen" }, `${ask.span.text.length} 字符`),
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.0",
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-vault.git"
29
+ "url": "git+https://github.com/revive123456/dsh-obsidian-notes.git"
30
30
  },
31
- "homepage": "https://github.com/revive123456/dsh-obsidian-vault#readme",
31
+ "homepage": "https://github.com/revive123456/dsh-obsidian-notes#readme",
32
32
  "bugs": {
33
- "url": "https://github.com/revive123456/dsh-obsidian-vault/issues"
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
- /** 生成「@路径 + 行数 + > 选中内容 + 【问题】」的注入 prompt(无多余空行) */
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 ? `第 ${lineA} 行` : `第 ${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(`> (片段较长,共 ${span.text.length} 字符,请阅读 @文件 第 ${lineA}–${lineB} 行)`);
570
+ lines.push(`> ${t("promptLong", { n: span.text.length, a: lineA, b: lineB })}`);
557
571
  }
558
- lines.push(`【问题】${q}`);
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(`${t("cited")}:已引用选中片段(${ask.span.text.length} 字符)`);
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("请解释这段内容") }, `⚡ ${t("explain")}`),
2971
- createElement("span", { className: "dsh-obs-asklen" }, `${ask.span.text.length} 字符`),
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
  );