dsh-yanfield 0.1.2 → 0.1.4

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.en.md CHANGED
@@ -9,7 +9,7 @@
9
9
  Manuscript, outline, world notes and an AI assistant on one desk.<br>
10
10
  Your book stays local, the model is the DeepSeek you already configured, and every AI edit is reviewed by you.
11
11
 
12
- [![DSH version](https://img.shields.io/badge/DSH-%E2%89%A5%200.2.1--rc.5%20%3C%200.3.0-4f7864?style=flat-square)](#install)
12
+ [![DSH version](https://img.shields.io/badge/DSH-%E2%89%A5%200.2.1--rc.5-4f7864?style=flat-square)](#install)
13
13
  [![Node for builds](https://img.shields.io/badge/Node-%E2%89%A5%2022.19-4f7864?style=flat-square)](https://nodejs.org)
14
14
  [![Version](https://img.shields.io/github/v/release/ZzimaR/dsh-yanfield?label=version&style=flat-square)](https://github.com/ZzimaR/dsh-yanfield/releases/latest)
15
15
  [![license](https://img.shields.io/badge/license-PolyForm%20Noncommercial-a97f2b?style=flat-square)](LICENSE)
@@ -19,26 +19,27 @@ Your book stays local, the model is the DeepSeek you already configured, and eve
19
19
  </div>
20
20
 
21
21
  > [!NOTE]
22
- > Yanfield is still being polished; UI and behavior will keep changing. Bugs and ideas are welcome in [Issues](https://github.com/ZzimaR/dsh-yanfield/issues) — the Bug report / Feature request forms (with environment and steps) get fixed faster. Pull requests are welcome too.
22
+ > Yanfield is still being polished; UI and behavior will keep changing. Bugs and ideas are welcome in [Issues](https://github.com/ZzimaR/dsh-yanfield/issues/new/choose) — the Bug report / Feature request forms (with environment and steps) get fixed faster. Pull requests are welcome too.
23
23
 
24
- [![Yanfield inside DeepSeek Harness: open the bookshelf from the host sidebar, switch between outline and notes, preview AI context, and review a prose edit](docs/screenshots/yanfield-in-dsh.gif)](docs/screenshots/yanfield-in-dsh.gif)
24
+ [![Yanfield inside DeepSeek Harness: chapters on the left, prose in the middle, AI assistant on the right](docs/screenshots/en-editor.png)](docs/screenshots/en-editor.png)
25
25
 
26
- 24-second walkthrough of a sample novel in DSH. The review uses a prepared example edit. The interface and captions are in Chinese.
26
+ The three-pane writing desk in DeepSeek Harness — chapter tree, prose, and the AI assistant side by side. All UI labels in these screenshots are English; the manuscripts shown are the bundled Chinese demo books (create a new book to write in English).
27
27
 
28
28
  <p align="center"><sub>Three-column writing desk · sample manuscript · click for full size</sub></p>
29
29
 
30
30
  ## What this plugin is
31
31
 
32
- Yanfield is a **DeepSeek Harness plugin**, not a standalone app. After installation a 「砚田」 entry appears in the Harness sidebar; opening it gives you a long-form writing desk rendered inside the panel.
32
+ Yanfield is a **DeepSeek Harness plugin**, not a standalone app. After installation a **Yanfield** entry (「砚田」 when the interface is Chinese) appears in the Harness sidebar; opening it gives you a long-form writing desk rendered inside the panel.
33
33
 
34
34
  - **Writing desk** — novels / volumes / chapters, three columns (outline · prose · AI), autosave, word counts, focus mode, adjustable typography, and two themes (rice-paper light, night-sail dark).
35
35
  - **Notes at hand** — chapter blueprints, characters, world settings, foreshadowing and story archives live in the left rail, edited in place without leaving the page.
36
36
  - **AI proposes, you decide** — the assistant reads your notes, works in several steps, and proposes prose and note changes; prose is reviewed paragraph by paragraph (green insertions, red deletions) and only what you keep is written into the manuscript.
37
- - **Local first** — manuscript, notes and conversations live in a local SQLite file; the model comes from the DeepSeek service you already configured in Harness, so there is no second API key to manage.
37
+ - **Local first** — manuscript, notes and conversations live in a local SQLite file; the model comes from the DeepSeek service you already configured in Harness, so there is no second API key to manage. The bundled sample books are Chinese demo manuscripts, included to show the workflow; create a new book to write in English.
38
+ - **English and Chinese** — the interface follows the Harness language (`Settings → General → Language`): the sidebar entry and every screen switch between 砚田 and Yanfield. Manuscripts are never translated, and the AI replies in the language you write in.
38
39
 
39
40
  ## Install
40
41
 
41
- Requires DeepSeek Harness `>=0.2.1-rc.5 <0.3.0`. Choose the command for your profile to install the prebuilt package from [npm](https://www.npmjs.com/package/dsh-yanfield).
42
+ Requires DeepSeek Harness `>=0.2.1-rc.5`. Choose the command for your profile to install the prebuilt package from [npm](https://www.npmjs.com/package/dsh-yanfield).
42
43
 
43
44
  ```bash
44
45
  # Web
@@ -54,14 +55,14 @@ For offline installation, download `dsh-yanfield.tgz` from [GitHub Releases](htt
54
55
 
55
56
  How to confirm it worked:
56
57
 
57
- 1. a 「砚田」 entry appears in the left sidebar;
58
- 2. Check the version and build time in `砚田 → Settings → About`. The build time comes from the bundle.
58
+ 1. a **Yanfield** entry appears in the left sidebar;
59
+ 2. Check the version and build time in `Yanfield → Settings → About`. The build time comes from the bundle.
59
60
 
60
61
  To update, run `dsh plugin --profile <profile> add dsh-yanfield@latest` in the same profile and restart Harness. To roll back, replace `@latest` with the desired version, such as `@0.1.1`. This also switches an existing GitHub install to npm.
61
62
 
62
63
  ## First run
63
64
 
64
- 1. Open 「砚田」 from the sidebar and click **New novel** on the shelf (title, genre, cover color, one-line pitch).
65
+ 1. Open **Yanfield** from the sidebar and click **New book** on the shelf (title, genre, cover color, one-line pitch).
65
66
  2. Open the novel and click **Write** to enter the three-column desk.
66
67
  3. Type into the AI box on the right, e.g. "make the first paragraph more vivid, only the first paragraph", "draft a blueprint for the next chapter", "create a character card for Zhou Wan".
67
68
  4. Prose edits open in a review view: keep or revert each paragraph, then press **Confirm review** — only kept paragraphs are written. Note changes are confirmed item by item in the task card.
@@ -78,7 +79,7 @@ Both real routes can be switched in Settings; an unavailable route explains why
78
79
 
79
80
  ## Features
80
81
 
81
- ![Shelf](docs/screenshots/library.png)
82
+ ![Shelf](docs/screenshots/en-library.png)
82
83
 
83
84
  **Writing**
84
85
 
@@ -104,35 +105,35 @@ Both real routes can be switched in Settings; an unavailable route explains why
104
105
  - After writing, the assistant proposes note candidates backed by the text — it only fills blanks, never overwrites your facts
105
106
  - Save frequently used instructions as prompt presets; the toolbar AI menu collects quick tasks
106
107
 
107
- ![Reviewing prose: green insertions, red deletions, keep or revert paragraph by paragraph](docs/screenshots/review-light.png)
108
108
 
109
109
  ## AI and cost
110
110
 
111
111
  - **Models** — by default the DeepSeek account already signed in to Harness; you can switch to an official API key. Both routes live in `Settings → Model services` with availability and reasons.
112
- - **Catalogue** — `deepseek-flash` (DeepSeek-V4.1-Flash, text and images) and `deepseek-v4-pro` (DeepSeek-V4-Pro, text only), roughly 1M tokens of context each; new models registered in Harness are synced automatically.
113
- - **Balance** — the 「余额」 button under the composer queries the signed-in DSH account, no key needed.
112
+ - **Catalog** — `deepseek-flash` (DeepSeek-V4.1-Flash, text and images) and `deepseek-v4-pro` (DeepSeek-V4-Pro, text only), roughly 1M tokens of context each; new models registered in Harness are synced automatically.
113
+ - **Balance** — the **Balance** button under the composer queries the signed-in DSH account, no key needed.
114
114
  - **Cost** — the footer shows *today's* cumulative estimate, not a single task. Unit prices come from a built-in DeepSeek price table and switch between peak and off-peak by Beijing time (peak: weekdays 09:00–12:00 and 14:00–18:00; everything else, including weekends and public holidays, is off-peak at half price). **Estimates only — the DeepSeek bill is authoritative.**
115
- - **Built-in thrift** — decision rounds skip deep thinking, short polishes drop a tier, small edits skip the note-organising pass, and oversized tool results are truncated with paging hints. A single-paragraph polish usually costs a few cents of a yuan; a blueprint task about a dime.
115
+ - **Built-in thrift** — decision rounds skip deep thinking, short polishes drop a tier, small edits skip the note-organizing pass, and oversized tool results are truncated with paging hints. A single-paragraph polish usually costs well under a cent; a blueprint task costs a few cents.
116
116
 
117
117
  ## Screenshots
118
118
 
119
- | Shelf | Dark writing desk |
119
+ | Bookshelf (English UI) | Writing desk (English UI) |
120
120
  | --- | --- |
121
- | [![Shelf: novel cards with cover colors](docs/screenshots/library.png)](docs/screenshots/library.png) | [![Writing desk in the night-sail theme](docs/screenshots/workspace-dark.png)](docs/screenshots/workspace-dark.png) |
121
+ | [![Shelf: book cards with cover colors](docs/screenshots/en-library.png)](docs/screenshots/en-library.png) | [![Three-column writing desk with the AI panel](docs/screenshots/en-editor.png)](docs/screenshots/en-editor.png) |
122
122
 
123
- More: [model services](docs/screenshots/settings-models.png) · [screenshot notes](docs/screenshots/README.md)
123
+ More: [model services](docs/screenshots/en-settings.png) · [Chinese screenshots](docs/screenshots/library.png) · [screenshot notes](docs/screenshots/README.md)
124
124
 
125
125
  ## Data and backup
126
126
 
127
127
  - Manuscripts live in `$DSH_HOME/yanfield/yanfield.db` (plus `-wal` / `-shm`). `Settings → Data` shows the real path and can open the folder.
128
128
  - Set `YANFIELD_DB_PATH` to select a database file. If the profile's `cordis.patch.yml` sets the plugin's `dataDir`, its `yanfield.db` takes precedence.
129
129
  - Backup: quit Harness first, then copy the whole directory (copying SQLite while it runs can give an inconsistent snapshot).
130
+ - Before upgrading the database schema, Yanfield creates a full snapshot in the same folder. If the backup fails, the upgrade stops. After a successful upgrade, Yanfield keeps the three most recent automatic upgrade backups.
130
131
  - Removing the plugin does not delete your manuscript; the database stays where it is.
131
132
 
132
133
  ## Troubleshooting
133
134
 
134
135
  <details>
135
- <summary>No 「砚田」 entry in the sidebar</summary>
136
+ <summary>No **Yanfield** entry in the sidebar</summary>
136
137
 
137
138
  Make sure you fully quit and restarted Harness (a page refresh is not enough), then check `Settings → Plugins` that `dsh-yanfield` is enabled and at the version you just installed.
138
139
  </details>
@@ -140,19 +141,19 @@ Make sure you fully quit and restarted Harness (a page refresh is not enough), t
140
141
  <details>
141
142
  <summary>"no API key" / model unavailable</summary>
142
143
 
143
- The active route is the official API key route but no key is stored. Switch the route back to "DeepSeek account" in `砚田 → Settings → Model services`, or store `DEEPSEEK_API_KEY` on Harness' model page.
144
+ The active route is the official API key route but no key is stored. Switch the route back to "DeepSeek account" in `Yanfield → Settings → Model services`, or store `DEEPSEEK_API_KEY` on Harness' model page.
144
145
  </details>
145
146
 
146
147
  <details>
147
148
  <summary>Balance shows a dash or says not signed in</summary>
148
149
 
149
- Balance comes from the DeepSeek account signed in to Harness. Sign in there first, then press "Query balance" again.
150
+ Balance comes from the DeepSeek account signed in to Harness. Sign in there first, then press **Balance** again.
150
151
  </details>
151
152
 
152
153
  <details>
153
154
  <summary>Cost always says unknown</summary>
154
155
 
155
- That request returned no usage (for example it was interrupted), or the model is not in the built-in price table and no unit price is configured in `Settings → AI and context`. Fill in the three prices to get an estimate.
156
+ That request returned no usage (for example it was interrupted), or the model is not in the built-in price table and no unit price is configured in `Settings → AI & context`. Fill in the three prices to get an estimate.
156
157
  </details>
157
158
 
158
159
  <details>
@@ -183,7 +184,7 @@ npm test # build dist/, check the manifest and run smoke tests
183
184
  ```bash
184
185
  client/ plugin half: Shadow DOM mount, slot registration, style entry
185
186
  src/host.ts host half: REST/SSE routes under /yanfield, model and account bridge
186
- vendor/yanfield/ the desk itself (React components, domain logic, SQLite access)
187
+ src/yanfield/ the desk itself (React components, domain logic, SQLite access)
187
188
  scripts/ build, check, smoke, reinstall
188
189
  docs/ features, AI and cost, architecture, development, FAQ
189
190
  ```
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  正文、大纲、设定与 AI 助手,在同一张书桌上。<br>
10
10
  书稿留在本地,模型用你已配好的 DeepSeek,AI 的改动由你逐段审阅。
11
11
 
12
- [![DSH 版本](https://img.shields.io/badge/DSH-%E2%89%A5%200.2.1--rc.5%20%3C%200.3.0-4f7864?style=flat-square)](#安装)
12
+ [![DSH 版本](https://img.shields.io/badge/DSH-%E2%89%A5%200.2.1--rc.5-4f7864?style=flat-square)](#安装)
13
13
  [![构建用 Node](https://img.shields.io/badge/Node-%E2%89%A5%2022.19-4f7864?style=flat-square)](https://nodejs.org)
14
14
  [![版本](https://img.shields.io/github/v/release/ZzimaR/dsh-yanfield?label=version&style=flat-square)](https://github.com/ZzimaR/dsh-yanfield/releases/latest)
15
15
  [![许可](https://img.shields.io/badge/license-PolyForm%20Noncommercial-a97f2b?style=flat-square)](LICENSE)
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
 
21
21
  > [!NOTE]
22
- > 砚田还在打磨中,界面与行为会继续调整。遇到问题、有想法,欢迎在 [Issues](https://github.com/ZzimaR/dsh-yanfield/issues) 里说——用「Bug 报告 / 功能建议」模板带上环境与复现步骤会快很多;也欢迎直接提 PR。
22
+ > 砚田还在打磨中,界面与行为会继续调整。遇到问题、有想法,欢迎在 [Issues](https://github.com/ZzimaR/dsh-yanfield/issues/new/choose) 里说——用「Bug 报告 / 功能建议」模板带上环境与复现步骤会快很多;也欢迎直接提 PR。目前项目由我一人维护,难免有疏漏,感谢你的理解与包涵~ 也欢迎随时反馈问题。
23
23
 
24
24
  [![砚田在 DeepSeek Harness 中的操作演示:从宿主侧栏进入书架,切换章纲与档案,预览 AI 上下文并审阅正文改动](docs/screenshots/yanfield-in-dsh.gif)](docs/screenshots/yanfield-in-dsh.gif)
25
25
 
@@ -31,6 +31,8 @@
31
31
 
32
32
  砚田是一个 **DeepSeek Harness 插件**,不是独立应用:安装后 Harness 左侧导航会出现「砚田」,点开就是一个跑在面板里的长篇写作台。
33
33
 
34
+ 界面跟随 DSH 的语言设置(设置 → 通用 → 语言):DSH 用英文时,侧栏显示 **Yanfield**,工作台、AI 面板与设置页也全部切换为英文;中文界面保持原样。书稿内容不会被翻译,AI 用你写作的语言回复。
35
+
34
36
  - **写作台**:作品 / 卷 / 章三级结构,三栏布局(目录 · 正文 · AI),自动保存、字数统计、专注模式、排版可调、宣纸 / 夜航双主题。
35
37
  - **资料随写随查**:章纲、设定、角色、伏笔、故事档案都在左栏,浮窗就地编辑,不离开正文。
36
38
  - **AI 改稿,作者做主**:AI 读资料、多步执行,提出正文与资料改动;正文逐段对比(绿色新增、红色删除),你决定保留哪几段,确认后才写进书稿。
@@ -38,7 +40,7 @@
38
40
 
39
41
  ## 安装
40
42
 
41
- 需要 DeepSeek Harness `>=0.2.1-rc.5 <0.3.0`。按你启动的 profile 选择下面一条命令,安装 [npm](https://www.npmjs.com/package/dsh-yanfield) 上的预构建包。
43
+ 需要 DeepSeek Harness `>=0.2.1-rc.5`。按你启动的 profile 选择下面一条命令,安装 [npm](https://www.npmjs.com/package/dsh-yanfield) 上的预构建包。
42
44
 
43
45
  ```bash
44
46
  # Web 版
@@ -127,6 +129,7 @@ dsh plugin --profile desktop add dsh-yanfield
127
129
  - 书稿默认在 `$DSH_HOME/yanfield/yanfield.db`(含 `-wal` / `-shm` 附属文件)。`设置 → 数据` 会显示实际路径并能一键打开所在文件夹。
128
130
  - 用环境变量 `YANFIELD_DB_PATH` 可指定数据库文件。若 profile 的 `cordis.patch.yml` 配置了插件的 `dataDir`,优先使用该目录里的 `yanfield.db`。
129
131
  - 备份:先退出 Harness,再复制整个目录(运行中直接复制 SQLite 可能拿到不一致的快照)。
132
+ - 数据库结构升级前,砚田会在同一目录创建整库快照。备份失败时会停止升级。升级成功后保留最近三份自动升级备份。
130
133
  - 卸载插件不会删除书稿;数据库仍在上面那个路径里。
131
134
 
132
135
  ## 排障
@@ -183,7 +186,7 @@ npm test # 构建 dist/,再运行清单检查与冒烟测试
183
186
  ```bash
184
187
  client/ 插件半区:Shadow DOM 挂载、插槽注册、样式入口
185
188
  src/host.ts 宿主半区:/yanfield 下的 REST/SSE 路由、模型与账号桥接
186
- vendor/yanfield/ 写作台本体(React 组件、领域逻辑、SQLite 访问)
189
+ src/yanfield/ 写作台本体(React 组件、领域逻辑、SQLite 访问)
187
190
  scripts/ 构建、自检、冒烟、重装
188
191
  docs/ 功能、AI 与费用、架构、开发、常见问题
189
192
  ```