dsh-yanfield 0.0.0-stage → 0.1.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/LICENSE +79 -0
- package/README.en.md +205 -0
- package/README.md +204 -2
- package/cordis.patch.yml +5 -0
- package/dist/client.js +411 -0
- package/dist/host.js +46562 -0
- package/icon.svg +10 -0
- package/package.json +90 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Copyright (c) 2026 ZzimaR
|
|
2
|
+
|
|
3
|
+
Required Notice: Copyright ZzimaR (https://github.com/ZzimaR/Yanfield)
|
|
4
|
+
|
|
5
|
+
# PolyForm Noncommercial License 1.0.0
|
|
6
|
+
|
|
7
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
8
|
+
|
|
9
|
+
## Acceptance
|
|
10
|
+
|
|
11
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
12
|
+
|
|
13
|
+
## Copyright License
|
|
14
|
+
|
|
15
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
16
|
+
|
|
17
|
+
## Distribution License
|
|
18
|
+
|
|
19
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
20
|
+
|
|
21
|
+
## Notices
|
|
22
|
+
|
|
23
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
24
|
+
|
|
25
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
26
|
+
|
|
27
|
+
## Changes and New Works License
|
|
28
|
+
|
|
29
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
30
|
+
|
|
31
|
+
## Patent License
|
|
32
|
+
|
|
33
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
34
|
+
|
|
35
|
+
## Noncommercial Purposes
|
|
36
|
+
|
|
37
|
+
Any noncommercial purpose is a permitted purpose.
|
|
38
|
+
|
|
39
|
+
## Personal Uses
|
|
40
|
+
|
|
41
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observation, without any anticipated commercial application, is use for a permitted purpose.
|
|
42
|
+
|
|
43
|
+
## Noncommercial Organizations
|
|
44
|
+
|
|
45
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
46
|
+
|
|
47
|
+
## Fair Use
|
|
48
|
+
|
|
49
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
54
|
+
|
|
55
|
+
## Patent Defense
|
|
56
|
+
|
|
57
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
58
|
+
|
|
59
|
+
## Violations
|
|
60
|
+
|
|
61
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
62
|
+
|
|
63
|
+
## No Liability
|
|
64
|
+
|
|
65
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
66
|
+
|
|
67
|
+
## Definitions
|
|
68
|
+
|
|
69
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
70
|
+
|
|
71
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
72
|
+
|
|
73
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
74
|
+
|
|
75
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
76
|
+
|
|
77
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
|
78
|
+
|
|
79
|
+
**Trademark** means trademarks, service marks, and similar rights.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="icon.svg" alt="Yanfield: a vermilion field grid and an ink drop on a rice-paper tile" width="88" height="88">
|
|
4
|
+
|
|
5
|
+
# Yanfield 砚田
|
|
6
|
+
|
|
7
|
+
**A long-form writing desk inside DeepSeek Harness.**
|
|
8
|
+
|
|
9
|
+
Manuscript, outline, world notes and an AI assistant on one desk.<br>
|
|
10
|
+
Your book stays local, the model is the DeepSeek you already configured, and every AI edit is reviewed by you.
|
|
11
|
+
|
|
12
|
+
[](#install)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](#roadmap)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
[Install](#install) · [First run](#first-run) · [Features](#features) · [AI and cost](#ai-and-cost) · [Screenshots](#screenshots) · [Data and backup](#data-and-backup) · [Troubleshooting](#troubleshooting) · [Development](#development) · [中文](README.md)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
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.
|
|
23
|
+
|
|
24
|
+
[](docs/screenshots/yanfield-in-dsh.gif)
|
|
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.
|
|
27
|
+
|
|
28
|
+
<p align="center"><sub>Three-column writing desk · sample manuscript · click for full size</sub></p>
|
|
29
|
+
|
|
30
|
+
## What this plugin is
|
|
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.
|
|
33
|
+
|
|
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
|
+
- **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
|
+
- **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.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
Requires DeepSeek Harness `>=0.2.1-rc.5 <0.3.0`. Choose the command for your profile to install the prebuilt package from [GitHub Releases](https://github.com/ZzimaR/dsh-yanfield/releases).
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Web
|
|
45
|
+
dsh plugin --profile web add https://github.com/ZzimaR/dsh-yanfield/releases/latest/download/dsh-yanfield.tgz
|
|
46
|
+
|
|
47
|
+
# Desktop
|
|
48
|
+
dsh plugin --profile desktop add https://github.com/ZzimaR/dsh-yanfield/releases/latest/download/dsh-yanfield.tgz
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then **quit Harness completely and start it again** — a page refresh is not enough, because the plugin ships host-side code.
|
|
52
|
+
|
|
53
|
+
How to confirm it worked:
|
|
54
|
+
|
|
55
|
+
1. a 「砚田」 entry appears in the left sidebar;
|
|
56
|
+
2. Check the version and build time in `砚田 → Settings → About`. The build time comes from the bundle.
|
|
57
|
+
|
|
58
|
+
To update or roll back, copy the version-specific `dsh-yanfield.tgz` link from Releases (for example, `releases/download/v0.1.1/dsh-yanfield.tgz`). Run `dsh plugin --profile <profile> add <link>` in the same profile and restart Harness. This also replaces an earlier install from the repository URL.
|
|
59
|
+
|
|
60
|
+
## First run
|
|
61
|
+
|
|
62
|
+
1. Open 「砚田」 from the sidebar and click **New novel** on the shelf (title, genre, cover color, one-line pitch).
|
|
63
|
+
2. Open the novel and click **Write** to enter the three-column desk.
|
|
64
|
+
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".
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
Where the model comes from (`Settings → Model services`):
|
|
68
|
+
|
|
69
|
+
| Route | What you need | Notes |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| DSH account sign-in | Signed in to DeepSeek inside Harness | Recommended, zero setup, balance readable |
|
|
72
|
+
| Official API key | `DEEPSEEK_API_KEY` | Pay per token; can also be stored on Harness' model page |
|
|
73
|
+
| Offline demo | Nothing | Template text only, for trying the UI; cannot really edit |
|
|
74
|
+
|
|
75
|
+
Both real routes can be switched in Settings; an unavailable route explains why (not signed in / no key).
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
**Writing**
|
|
82
|
+
|
|
83
|
+
- Novel / volume / chapter tree with word counts and status; create, reorder, navigate
|
|
84
|
+
- Autosave with adjustable delay plus manual save; live word, paragraph and reading-time stats
|
|
85
|
+
- Typography controls: serif or sans, size, weight, line height, letter spacing, paragraph spacing, margins, max line width
|
|
86
|
+
- Focus mode, typewriter mode, writing goal and daily target
|
|
87
|
+
- `Alt + 1` collapse the outline, `Alt + J` focus the AI box, `Ctrl / ⌘ + K` quick jump, `Ctrl / ⌘ + F` find in chapter
|
|
88
|
+
|
|
89
|
+
**Notes**
|
|
90
|
+
|
|
91
|
+
- Three-level outline: book / volume / chapter blueprints (goal, conflict, scene beats, hooks)
|
|
92
|
+
- Character cards, world settings, foreshadowing, story archive (chapter summary, character states, setting changes, timeline, unresolved conflicts)
|
|
93
|
+
- Settings stay hidden from the AI until their reveal chapter; turning off "AI visibility" hides them even from explicit `@` references
|
|
94
|
+
- TXT import (chapter titles detected, preview before writing), Markdown / TXT export
|
|
95
|
+
|
|
96
|
+
**AI assistant**
|
|
97
|
+
|
|
98
|
+
- One conversation handles continuation, rewriting, card creation, note edits and blueprint drafting, with skill presets, style presets and a customizable persona
|
|
99
|
+
- `@` to reference chapters, characters, settings, foreshadowing and archives; context budget and per-section preview
|
|
100
|
+
- Progress steps keep their order, the current step updates in place, and autoscroll pauses while you read back
|
|
101
|
+
- Prose changes are reviewed inline (green insertions, red deletions); note changes are compared field by field
|
|
102
|
+
- After writing, the assistant proposes note candidates backed by the text — it only fills blanks, never overwrites your facts
|
|
103
|
+
- Save frequently used instructions as prompt presets; the toolbar AI menu collects quick tasks
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
|
|
107
|
+
## AI and cost
|
|
108
|
+
|
|
109
|
+
- **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.
|
|
110
|
+
- **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.
|
|
111
|
+
- **Balance** — the 「余额」 button under the composer queries the signed-in DSH account, no key needed.
|
|
112
|
+
- **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.**
|
|
113
|
+
- **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.
|
|
114
|
+
|
|
115
|
+
## Screenshots
|
|
116
|
+
|
|
117
|
+
| Shelf | Dark writing desk |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| [](docs/screenshots/library.png) | [](docs/screenshots/workspace-dark.png) |
|
|
120
|
+
|
|
121
|
+
More: [model services](docs/screenshots/settings-models.png) · [screenshot notes](docs/screenshots/README.md)
|
|
122
|
+
|
|
123
|
+
## Data and backup
|
|
124
|
+
|
|
125
|
+
- Manuscripts live in `$DSH_HOME/yanfield/yanfield.db` (plus `-wal` / `-shm`). `Settings → Data` shows the real path and can open the folder.
|
|
126
|
+
- 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.
|
|
127
|
+
- Backup: quit Harness first, then copy the whole directory (copying SQLite while it runs can give an inconsistent snapshot).
|
|
128
|
+
- Removing the plugin does not delete your manuscript; the database stays where it is.
|
|
129
|
+
|
|
130
|
+
## Troubleshooting
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary>No 「砚田」 entry in the sidebar</summary>
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
</details>
|
|
137
|
+
|
|
138
|
+
<details>
|
|
139
|
+
<summary>"no API key" / model unavailable</summary>
|
|
140
|
+
|
|
141
|
+
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.
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
<details>
|
|
145
|
+
<summary>Balance shows a dash or says not signed in</summary>
|
|
146
|
+
|
|
147
|
+
Balance comes from the DeepSeek account signed in to Harness. Sign in there first, then press "Query balance" again.
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
<details>
|
|
151
|
+
<summary>Cost always says unknown</summary>
|
|
152
|
+
|
|
153
|
+
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.
|
|
154
|
+
</details>
|
|
155
|
+
|
|
156
|
+
<details>
|
|
157
|
+
<summary>Where is my manuscript / how do I move it</summary>
|
|
158
|
+
|
|
159
|
+
See "Data and backup" above. Copy the whole database directory to the new machine; if the path stays the same, nothing else is needed.
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary>Uninstall</summary>
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
dsh plugin --profile desktop remove dsh-yanfield
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Then restart Harness. Your manuscript is not deleted.
|
|
170
|
+
</details>
|
|
171
|
+
|
|
172
|
+
## Development
|
|
173
|
+
|
|
174
|
+
Requires Node.js ≥ 22.19 (build and checks only; the runtime comes from Harness).
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm ci # install build dependencies from package-lock.json
|
|
178
|
+
npm test # build dist/, check the manifest and run smoke tests
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
client/ plugin half: Shadow DOM mount, slot registration, style entry
|
|
183
|
+
src/host.ts host half: REST/SSE routes under /yanfield, model and account bridge
|
|
184
|
+
vendor/yanfield/ the desk itself (React components, domain logic, SQLite access)
|
|
185
|
+
scripts/ build, check, smoke, reinstall
|
|
186
|
+
docs/ features, AI and cost, architecture, development, FAQ
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
See [development](docs/en/development.md) for the build chain and local testing, [architecture](docs/en/architecture.md) for the data model, [features](docs/en/features.md) for the full list, [AI and cost](docs/en/ai-and-cost.md) for model details, and [FAQ](docs/en/faq.md) for troubleshooting.
|
|
190
|
+
|
|
191
|
+
中文文档:[README.md](README.md) · [docs/](docs/features.md)
|
|
192
|
+
|
|
193
|
+
## Roadmap
|
|
194
|
+
|
|
195
|
+
- **v0.1.x (current)**: writing desk, notes system, AI review and cost visibility;
|
|
196
|
+
- **Next**: chapter snapshots and rollback, EPUB export, richer writing stats;
|
|
197
|
+
- **Later**: knowledge-graph view, model comparison, collaborative review.
|
|
198
|
+
|
|
199
|
+
## Credits
|
|
200
|
+
|
|
201
|
+
The interface and domain logic come from [Yanfield](https://github.com/ZzimaR/Yanfield). This repository is its DeepSeek Harness plugin edition: models come from Harness, the theme follows the Harness light/dark setting, and multi-provider support is replaced by the two DeepSeek routes (DSH account / official API key).
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
[PolyForm Noncommercial 1.0.0](LICENSE): use, study, modify and share freely; no commercial use. Novels written with it belong to their author.
|
package/README.md
CHANGED
|
@@ -1,3 +1,205 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="icon.svg" alt="砚田:宣纸方块上的朱红田字格与一笔墨点" width="88" height="88">
|
|
4
|
+
|
|
5
|
+
# 砚田 Yanfield
|
|
6
|
+
|
|
7
|
+
**DeepSeek Harness 里的长篇写作台。**
|
|
8
|
+
|
|
9
|
+
正文、大纲、设定与 AI 助手,在同一张书桌上。<br>
|
|
10
|
+
书稿留在本地,模型用你已配好的 DeepSeek,AI 的改动由你逐段审阅。
|
|
11
|
+
|
|
12
|
+
[](#安装)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](#路线图)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
[安装](#安装) · [第一次使用](#第一次使用) · [功能](#功能) · [AI 与费用](#ai-与费用) · [截图](#截图) · [数据与备份](#数据与备份) · [排障](#排障) · [开发](#开发) · [English](README.en.md)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
> [!NOTE]
|
|
22
|
+
> 砚田还在打磨中,界面与行为会继续调整。遇到问题、有想法,欢迎在 [Issues](https://github.com/ZzimaR/dsh-yanfield/issues) 里说——用「Bug 报告 / 功能建议」模板带上环境与复现步骤会快很多;也欢迎直接提 PR。
|
|
23
|
+
|
|
24
|
+
[](docs/screenshots/yanfield-in-dsh.gif)
|
|
25
|
+
|
|
26
|
+
约 24 秒。画面来自 DSH 中的隔离示例作品,审阅环节使用预置的示例改动。
|
|
27
|
+
|
|
28
|
+
<p align="center"><sub>三栏写作台 · 示例书稿 · 点击图片查看原图</sub></p>
|
|
29
|
+
|
|
30
|
+
## 这个插件做什么
|
|
31
|
+
|
|
32
|
+
砚田是一个 **DeepSeek Harness 插件**,不是独立应用:安装后 Harness 左侧导航会出现「砚田」,点开就是一个跑在面板里的长篇写作台。
|
|
33
|
+
|
|
34
|
+
- **写作台**:作品 / 卷 / 章三级结构,三栏布局(目录 · 正文 · AI),自动保存、字数统计、专注模式、排版可调、宣纸 / 夜航双主题。
|
|
35
|
+
- **资料随写随查**:章纲、设定、角色、伏笔、故事档案都在左栏,浮窗就地编辑,不离开正文。
|
|
36
|
+
- **AI 改稿,作者做主**:AI 读资料、多步执行,提出正文与资料改动;正文逐段对比(绿色新增、红色删除),你决定保留哪几段,确认后才写进书稿。
|
|
37
|
+
- **本地优先**:书稿、设定、对话都在本机 SQLite 里;模型走 Harness 已经配好的 DeepSeek,不需要再填一遍 Key。
|
|
38
|
+
|
|
39
|
+
## 安装
|
|
40
|
+
|
|
41
|
+
需要 DeepSeek Harness `>=0.2.1-rc.5 <0.3.0`。按你启动的 profile 选择下面一条命令,安装 [GitHub Releases](https://github.com/ZzimaR/dsh-yanfield/releases) 提供的预构建包。
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Web 版
|
|
45
|
+
dsh plugin --profile web add https://github.com/ZzimaR/dsh-yanfield/releases/latest/download/dsh-yanfield.tgz
|
|
46
|
+
|
|
47
|
+
# 桌面版
|
|
48
|
+
dsh plugin --profile desktop add https://github.com/ZzimaR/dsh-yanfield/releases/latest/download/dsh-yanfield.tgz
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
安装完成后**完全退出 Harness 再重新打开**(只刷新页面不够:插件含宿主侧代码,需要重启进程)。
|
|
52
|
+
|
|
53
|
+
确认装好:
|
|
54
|
+
|
|
55
|
+
1. 左侧导航出现「砚田」;
|
|
56
|
+
2. 打开 `砚田 → 设置 → 关于`,核对版本和构建时间。构建时间是产物生成时间。
|
|
57
|
+
|
|
58
|
+
更新或回退时,从 Releases 复制目标版本的 `dsh-yanfield.tgz` 链接(形如 `releases/download/v0.1.1/dsh-yanfield.tgz`),用同一个 profile 执行 `dsh plugin --profile <profile> add <链接>`,然后重启 Harness。之前用仓库地址安装的用户也可以用这个方法切换到 Release 包。
|
|
59
|
+
|
|
60
|
+
## 第一次使用
|
|
61
|
+
|
|
62
|
+
1. 点左侧「砚田」,在书架页 **新建作品**(书名、类型、封面底色、一句话简介)。
|
|
63
|
+
2. 进入作品后点 **写作**,就来到三栏写作台:左栏目录 / 章纲 / 设定 / 档案,中间正文,右侧 AI 助手。
|
|
64
|
+
3. 右侧输入框直接说需求即可,例如「把第一段改得更有画面感,只改第一段」「为下一章写一份章纲」「给周晚建一张角色卡」。
|
|
65
|
+
4. AI 提出的正文改动会在正文区打开审阅:逐段「保留 / 还原」,点「确认审阅结果」后只写入保留的段落;资料改动在任务卡里逐项确认。
|
|
66
|
+
|
|
67
|
+
模型来源(`设置 → 模型服务`):
|
|
68
|
+
|
|
69
|
+
| 方式 | 需要什么 | 说明 |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| DSH 账号登录 | 在 Harness 里登录 DeepSeek | 推荐,零配置;余额可直接查 |
|
|
72
|
+
| 官方 API Key | `DEEPSEEK_API_KEY` | 按量计费;也可在 DSH 的模型服务页填写 |
|
|
73
|
+
| 离线演示 | 不需要 | 只有模板文本,用于试用界面,不能真正改稿 |
|
|
74
|
+
|
|
75
|
+
两种真实路由可以在设置页一键切换,未就绪的那条会写明原因(没登录 / 没填 Key)。
|
|
76
|
+
|
|
77
|
+
## 功能
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
**写作**
|
|
82
|
+
|
|
83
|
+
- 作品 / 卷 / 章三级结构;新建卷、新建章、拖拽排序,章节树显示字数与状态
|
|
84
|
+
- 正文自动保存(延迟可调)+ 手动保存;字数、段落、阅读时间实时统计
|
|
85
|
+
- 排版可调:衬线 / 黑体、字号、字重、行高、字间距、段落间距、页边距、最大行宽
|
|
86
|
+
- 专注模式(隐藏侧栏)、打字机模式(光标居中)、写作目标与每日字数
|
|
87
|
+
- `Alt + 1` 收起 / 打开目录,`Alt + J` 聚焦 AI 输入框,`Ctrl / ⌘ + K` 快速跳转,`Ctrl / ⌘ + F` 页内查找
|
|
88
|
+
|
|
89
|
+
**资料**
|
|
90
|
+
|
|
91
|
+
- 总纲 / 卷纲 / 章纲三级大纲(目标、冲突、场景节拍、钩子)
|
|
92
|
+
- 角色卡、世界观、伏笔、故事档案(本章摘要、人物状态、设定变动、时间线、待确认冲突)
|
|
93
|
+
- 设定在揭示章节前默认对 AI 隐藏;关掉「AI 可见性」后即使 `@` 引用也读不到
|
|
94
|
+
- TXT 导入(识别「第 N 章」等标题自动拆章,预览后写入)、Markdown / TXT 导出
|
|
95
|
+
|
|
96
|
+
**AI 助手**
|
|
97
|
+
|
|
98
|
+
- 一个对话里完成续写、改稿、建卡、改设定、理章纲;带技能预设、文风选择与可自定义人设
|
|
99
|
+
- `@` 引用章节、角色、设定、伏笔、档案;上下文预算与分节预览可调
|
|
100
|
+
- 关键进展按顺序保留,当前步骤原地更新;上翻阅读时暂停自动滚动
|
|
101
|
+
- 正文改动在正文区逐段审阅(绿色新增 / 红色删除),资料改动按字段对比
|
|
102
|
+
- 写完正文自动整理「有原文依据」的资料候选,只补空白、不覆盖你写的事实
|
|
103
|
+
- 支持把常用指令存成提示词预设;工具栏「AI 助手」菜单收纳快捷任务
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
|
|
107
|
+
## AI 与费用
|
|
108
|
+
|
|
109
|
+
- **模型**:默认用 Harness 里已登录的 DeepSeek 账号;也可以切到官方 API Key。两条路由都在 `设置 → 模型服务` 里,显示可用状态与未就绪原因。
|
|
110
|
+
- **模型目录**:`deepseek-flash`(DeepSeek-V4.1-Flash,支持文本与图像)与 `deepseek-v4-pro`(DeepSeek-V4-Pro,纯文本),上下文各约 100 万 token;Harness 新增模型时会自动同步进选择器。
|
|
111
|
+
- **余额**:输入框底部的「余额」直接查 DSH 已登录账号的余额,不需要填 Key。
|
|
112
|
+
- **费用**:底部「今日 N tok · 预估 ¥X」是**今日累计**的估算,不是单次任务;单价由插件内置的 DeepSeek 官方价目表提供,按北京时间自动区分高峰与空闲(高峰为工作日 9:00–12:00、14:00–18:00,其余时段与法定节假日按空闲计,空闲价是高峰价的一半)。**估算仅供参考,账单以 DeepSeek 官方为准。**
|
|
113
|
+
- **省费的默认行为**:决策轮不做深度思考;小段润色、选区改写自动降档;改动很小时不触发「资料整理」;工具回执超过一定长度会截断并提示分页。一次单段润色通常几分钱,章纲任务一毛上下。
|
|
114
|
+
|
|
115
|
+
## 截图
|
|
116
|
+
|
|
117
|
+
| 书架 | 深色写作台 |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| [](docs/screenshots/library.png) | [](docs/screenshots/workspace-dark.png) |
|
|
120
|
+
|
|
121
|
+
更多:[模型服务设置](docs/screenshots/settings-models.png) · [截图说明](docs/screenshots/README.md)
|
|
122
|
+
|
|
123
|
+
## 数据与备份
|
|
124
|
+
|
|
125
|
+
- 书稿默认在 `$DSH_HOME/yanfield/yanfield.db`(含 `-wal` / `-shm` 附属文件)。`设置 → 数据` 会显示实际路径并能一键打开所在文件夹。
|
|
126
|
+
- 用环境变量 `YANFIELD_DB_PATH` 可指定数据库文件。若 profile 的 `cordis.patch.yml` 配置了插件的 `dataDir`,优先使用该目录里的 `yanfield.db`。
|
|
127
|
+
- 备份:先退出 Harness,再复制整个目录(运行中直接复制 SQLite 可能拿到不一致的快照)。
|
|
128
|
+
- 卸载插件不会删除书稿;数据库仍在上面那个路径里。
|
|
129
|
+
|
|
130
|
+
## 排障
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary>左侧没有「砚田」</summary>
|
|
134
|
+
|
|
135
|
+
先确认是完全退出 Harness 后重开的(不是刷新页面),再看 `设置 → 插件` 里 `dsh-yanfield` 是否已启用、版本是否为刚装的那次。
|
|
136
|
+
</details>
|
|
137
|
+
|
|
138
|
+
<details>
|
|
139
|
+
<summary>发消息报 no API key / 模型不可用</summary>
|
|
140
|
+
|
|
141
|
+
当前路由选到了「官方 API Key」但还没有填 Key。到 `砚田 → 设置 → 模型服务` 把模型路由切回「DeepSeek 账号登录」,或在 Harness 的模型服务页填入 `DEEPSEEK_API_KEY`。
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
<details>
|
|
145
|
+
<summary>余额显示「—」或提示未登录</summary>
|
|
146
|
+
|
|
147
|
+
余额来自 DSH 已登录的 DeepSeek 账号。先在 Harness 里登录 DeepSeek 账号,再回来点一下「查询余额」。
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
<details>
|
|
151
|
+
<summary>费用一直是「费用未知」</summary>
|
|
152
|
+
|
|
153
|
+
说明这次调用没有返回 usage(比如请求中断),或者模型不在内置价目表里、你也没有在 `设置 → AI 与上下文` 里填单价。填上三档单价后会显示预估值。
|
|
154
|
+
</details>
|
|
155
|
+
|
|
156
|
+
<details>
|
|
157
|
+
<summary>书稿在哪 / 换电脑怎么迁</summary>
|
|
158
|
+
|
|
159
|
+
见上面「数据与备份」。换机器时把整个数据库目录一起拷过去即可,路径不变就不需要额外配置。
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary>怎么卸载</summary>
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
dsh plugin --profile desktop remove dsh-yanfield
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
然后重启 Harness。书稿不会被删除。
|
|
170
|
+
</details>
|
|
171
|
+
|
|
172
|
+
## 开发
|
|
173
|
+
|
|
174
|
+
需要 Node.js ≥ 22.19(构建与自检用;运行时由 Harness 提供)。
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm ci # 按 package-lock.json 安装构建依赖
|
|
178
|
+
npm test # 构建 dist/,再运行清单检查与冒烟测试
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
client/ 插件半区:Shadow DOM 挂载、插槽注册、样式入口
|
|
183
|
+
src/host.ts 宿主半区:/yanfield 下的 REST/SSE 路由、模型与账号桥接
|
|
184
|
+
vendor/yanfield/ 写作台本体(React 组件、领域逻辑、SQLite 访问)
|
|
185
|
+
scripts/ 构建、自检、冒烟、重装
|
|
186
|
+
docs/ 功能、AI 与费用、架构、开发、常见问题
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
从本地源码安装到隔离 profile 的步骤见 [本地联调](docs/development.md#五本地联调)。架构与数据模型见 [架构说明](docs/architecture.md),功能清单见 [功能说明](docs/features.md),AI 接入和费用见 [AI 与费用](docs/ai-and-cost.md),排障见 [常见问题](docs/faq.md)。
|
|
190
|
+
|
|
191
|
+
English docs: [README.en.md](README.en.md) · [docs/en/](docs/en/features.md)
|
|
192
|
+
|
|
193
|
+
## 路线图
|
|
194
|
+
|
|
195
|
+
- **v0.1.x(当前)**:三栏写作台、资料系统、AI 审阅与费用可视化;
|
|
196
|
+
- **下一步**:章节版本快照与回滚、EPUB 导出、更细的写作统计;
|
|
197
|
+
- **更远**:知识图谱视图、多模型对比、协作审阅。
|
|
198
|
+
|
|
199
|
+
## 致谢
|
|
200
|
+
|
|
201
|
+
界面与领域逻辑来自 [砚田 Yanfield](https://github.com/ZzimaR/Yanfield)。本仓库是它的 DeepSeek Harness 插件化版本:模型改走 Harness 已配置的服务,主题跟随 Harness 明暗切换,多服务商适配改为「DSH 账号 / 官方 API Key」两条路由。
|
|
202
|
+
|
|
203
|
+
## 许可
|
|
204
|
+
|
|
205
|
+
[PolyForm Noncommercial 1.0.0](LICENSE):可以自用、学习、修改和分享,不得商用。用它写出来的小说,版权归作者。
|