dsh-clio 0.0.0-stage → 1.0.3
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 +204 -0
- package/README.md +222 -2
- package/cordis.patch.yml +5 -0
- package/dist/client.js +625 -0
- package/dist/host.js +57853 -0
- package/icon.svg +13 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +110 -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,204 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="icon.svg" alt="Clio: a vermilion field grid and an ink drop on a rice-paper tile" width="88" height="88">
|
|
4
|
+
|
|
5
|
+
# Clio 起笔
|
|
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
|
+
[](https://github.com/elk771-alt/kuf/releases/latest)
|
|
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
|
+
> Clio is still being polished; UI and behavior will keep changing. Bugs and ideas are welcome in [Issues](https://github.com/elk771-alt/kuf/issues/new/choose) — the Bug report / Feature request forms (with environment and steps) get fixed faster. Pull requests are welcome too.
|
|
23
|
+
|
|
24
|
+
> Screenshots below are from the Yanfield era; 1.0 (material canvas, inline companion, templates) still needs new captures. The live UI is authoritative.
|
|
25
|
+
|
|
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
|
+
|
|
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
|
+
Clio is a **DeepSeek Harness plugin**, not a standalone app. After installation a **Clio** 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
|
+
|
|
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
|
+
- **One pipeline** — Overview / Material field / Writing / Review / Export, all one click apart: collect material first, or write first and break it back into the map.
|
|
36
|
+
- **Material field** — an infinite canvas for ideas, scenes, excerpts and paragraphs. Order lines decide prose order, relation lines carry subplots; group and drag to consolidate.
|
|
37
|
+
- **Companion & draft** — pause and a pale suggestion appears after the caret (Tab accepts, Esc dismisses; tune context, length and style). Use Draft when you need a whole passage from your materials.
|
|
38
|
+
- **Style profiles** — extract rules from your own writing, or pick a preset / custom example; the assistant and companion write to it.
|
|
39
|
+
- **Knowledge base** — reusable notes across books, cited with `@knowledge` while writing.
|
|
40
|
+
- **Notes at hand** — chapter blueprints, characters, world settings, foreshadowing and story archives live in the left rail, edited in place without leaving the page.
|
|
41
|
+
- **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.
|
|
42
|
+
- **Local first** — manuscript, notes and conversations live in a local SQLite file; use the DeepSeek service already configured in Harness, or a local model through Ollama / LM Studio.
|
|
43
|
+
- **Local files & backups** — export a book to your own folder (prose / material / full text / backups), with automatic snapshots and restorable versions; export Markdown, plain text, Fountain, Word or Obsidian.
|
|
44
|
+
- **English and Chinese** — the interface follows the Harness language (`Settings → General → Language`): the sidebar entry and every screen switch between 起笔 and Clio. Manuscripts are never translated, and the AI replies in the language you write in.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
Requires DeepSeek Harness `>=0.2.1-rc.5`.
|
|
49
|
+
|
|
50
|
+
1. In DSH, open **Plugins → Add plugin**.
|
|
51
|
+
2. Enter `dsh-clio` in **Package name or address** and click **Install**.
|
|
52
|
+
3. Click **Enable now** if prompted, then open **Clio** from the left sidebar. If DSH prompts you to restart, quit Harness completely and reopen it. Find the version and build time under **Clio → Settings → About**.
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
About 14 seconds, recorded in the Chinese interface with the light theme. Click the GIF for full size.
|
|
57
|
+
|
|
58
|
+
When you open the Clio library or editor, Harness checks whether a compatible update is available for the current installation. Use the update button on the library notice or in the editor toolbar to review and confirm it in the Harness plugin details. You can dismiss the notice for that release or check manually in Clio under **Settings → About**. If DSH reports that it cannot find `pnpm`, install pnpm and make sure it is on the `PATH` of the environment that launches DSH.
|
|
59
|
+
|
|
60
|
+
## First run
|
|
61
|
+
|
|
62
|
+
1. Open **Clio** from the sidebar and click **New book** 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
|
+
| Custom DSH model | Configure the API under Settings → Models in DSH | Connects to LM Studio, vLLM, or llama.cpp |
|
|
74
|
+
| Offline demo | Nothing | Template text only, for trying the UI; cannot really edit |
|
|
75
|
+
|
|
76
|
+
Pick a model in Clio's Model services or in the writing assistant. Models are grouped by DSH route.
|
|
77
|
+
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
*English screenshots are pending; the Chinese captures below show the same layout.*
|
|
81
|
+
|
|
82
|
+
**Writing**
|
|
83
|
+
|
|
84
|
+
- Novel / volume / chapter tree with word counts and status; create, reorder, navigate
|
|
85
|
+
- Autosave with an adjustable delay, manual save, and live word, paragraph, and reading-time stats
|
|
86
|
+
- Chapter version history with snapshots, previews, and an automatic snapshot before restoring earlier text
|
|
87
|
+
- Typography controls: serif or sans, size, weight, line height, letter spacing, paragraph spacing, margins, max line width
|
|
88
|
+
- Focus mode, typewriter mode, writing goal and daily target
|
|
89
|
+
- `Alt + 1` collapse the outline, `Alt + J` focus the AI box, `Ctrl / ⌘ + K` quick jump, `Ctrl / ⌘ + F` find in chapter
|
|
90
|
+
|
|
91
|
+
**Notes**
|
|
92
|
+
|
|
93
|
+
- Three-level outline: book / volume / chapter blueprints (goal, conflict, scene beats, hooks)
|
|
94
|
+
- Character cards, world settings, foreshadowing, story archive (chapter summary, character states, setting changes, timeline, unresolved conflicts)
|
|
95
|
+
- Settings stay hidden from the AI until their reveal chapter; turning off "AI visibility" hides them even from explicit `@` references
|
|
96
|
+
- TXT import (chapter titles detected, preview before writing), Markdown / TXT export
|
|
97
|
+
|
|
98
|
+
**AI assistant**
|
|
99
|
+
|
|
100
|
+
- One conversation handles continuation, rewriting, card creation, note edits and blueprint drafting, with skill presets, style presets and a customizable persona
|
|
101
|
+
- `@` to reference chapters, characters, settings, foreshadowing and archives; context budget and per-section preview
|
|
102
|
+
- Progress steps keep their order, the current step updates in place, and autoscroll pauses while you read back
|
|
103
|
+
- Prose changes are reviewed inline (green insertions, red deletions); note changes are compared field by field
|
|
104
|
+
- The assistant finds and reads material as needed, then prepares changes for review. You can review successful changes in a batch and check any failures in the execution log. Ask for notes alongside new prose to get note proposals with source quotes you can verify
|
|
105
|
+
- Save frequently used instructions as prompt presets. The toolbar's continuation, expansion, polishing, and AI-tone cleanup shortcuts use the corresponding presets
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## AI and cost
|
|
109
|
+
|
|
110
|
+
- **Models** — models from all available DSH routes appear in both `Settings → Model services` and the writing assistant. See [AI and cost](docs/en/ai-and-cost.md) for LM Studio, vLLM, and llama.cpp setup.
|
|
111
|
+
- **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.
|
|
112
|
+
- **Balance** — the **Balance** button under the composer queries the signed-in DSH account, no key needed.
|
|
113
|
+
- **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.**
|
|
114
|
+
- **Usage controls** — a short model call determines the scope of each request. Routine decisions skip deep thinking, short polishes use a lower thinking level, and long tool results are paginated.
|
|
115
|
+
|
|
116
|
+
## Screenshots
|
|
117
|
+
|
|
118
|
+
More: [shelf](docs/screenshots/clio-library.jpg) · [writing desk](docs/screenshots/clio-workspace.jpg) · [material canvas](docs/screenshots/clio-canvas.jpg) · [export](docs/screenshots/clio-export.jpg) · [screenshot notes](docs/screenshots/README.md)
|
|
119
|
+
|
|
120
|
+
## Data and backup
|
|
121
|
+
|
|
122
|
+
- Manuscripts live in `$DSH_HOME/yanfield/yanfield.db` (plus `-wal` / `-shm`). `Settings → Data` shows the real path and can open the folder.
|
|
123
|
+
- 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.
|
|
124
|
+
- In **Settings → Data → Export backup**, download a `.yanfield` file. Select books to back up their manuscripts, story notes, and AI history. A full backup also includes global settings, presets, model service configuration, and statistics.
|
|
125
|
+
- Use **Import backup** to preview the file and import copies. With a full backup, you can also **Restore full library**. Clio creates a `yanfield-before-restore-*.db` snapshot in the data folder first. To roll back, quit Harness, replace the current database with that snapshot, and move the current database’s matching `-wal` and `-shm` files out of the folder.
|
|
126
|
+
- Full exports omit model service API keys by default. Select **Encrypt the backup and include model service API keys** to transfer keys stored in Clio. Set up Harness-managed accounts and credentials separately on the destination.
|
|
127
|
+
- Before upgrading the database schema, Clio creates a full snapshot in the same folder. If the backup fails, the upgrade stops. After a successful upgrade, Clio keeps the three most recent automatic upgrade backups.
|
|
128
|
+
- Removing the plugin does not delete your manuscript; the database stays where it is.
|
|
129
|
+
|
|
130
|
+
## Troubleshooting
|
|
131
|
+
|
|
132
|
+
<details>
|
|
133
|
+
<summary>No **Clio** 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-clio` 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 selected model uses the official API key route, which needs a credential. Pick a model in the DeepSeek account group in Clio or enter the API key under Settings → Models in DSH.
|
|
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 **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 & 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. Export a full backup and restore it on the new machine.
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary>Uninstall</summary>
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
dsh plugin --profile desktop remove dsh-clio
|
|
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
|
+
src/yanfield/ the desk itself (React components, domain logic, SQLite access)
|
|
185
|
+
scripts/ build, check, smoke, reinstall, website build
|
|
186
|
+
site/ source of the website (yanfield.com)
|
|
187
|
+
docs/ features, AI and cost, architecture, development, FAQ
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
The website ([yanfield.com](https://yanfield.com)) is a static site in `site/`: `npm run build:site` builds it, `npm run check:site` checks it, `npm run preview:site` previews it locally, and GitHub Pages deploys it from `main`. See [website](docs/en/website.md) for build and deployment details.
|
|
193
|
+
|
|
194
|
+
中文文档:[README.md](README.md) · [docs/](docs/features.md)
|
|
195
|
+
|
|
196
|
+
## Roadmap
|
|
197
|
+
|
|
198
|
+
- **v0.2.0 (current)**: writing desk, notes system, chapter version history, AI review, and cost visibility;
|
|
199
|
+
- **Next**: EPUB export and more detailed writing statistics;
|
|
200
|
+
- **Later**: knowledge-graph view, model comparison, collaborative review.
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
[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,223 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="icon.svg" alt="起笔:浅蓝圆角底上的一支蓝色钢笔" width="88" height="88">
|
|
4
|
+
|
|
5
|
+
# 起笔 Clio
|
|
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
|
+
> [!TIP]
|
|
22
|
+
> **第一次用?三步装好:** ① 下载 [`releases/dsh-clio-1.0.2.tgz`](releases/dsh-clio-1.0.2.tgz);② Harness 左下角 **Plugins → Add plugin** 选这个包;③ 完全退出 Harness 再打开,侧栏点「起笔 Clio」。
|
|
23
|
+
> 图文步骤与常见问题见 [INSTALL.md](INSTALL.md)。不需要命令行,不需要装 Node。
|
|
24
|
+
|
|
25
|
+
> [!NOTE]
|
|
26
|
+
> 起笔还在打磨中,界面与行为会继续调整。遇到问题、有想法,欢迎在 [Issues](https://github.com/elk771-alt/kuf/issues/new/choose) 里说——用「Bug 报告 / 功能建议」模板带上环境与复现步骤会快很多;也可以直接发邮件到 **elk771@gmail.com**(主题写「起笔 Clio 反馈」),我会逐条看。也欢迎直接提 PR。目前项目由我一人维护,难免有疏漏,感谢你的理解与包涵~
|
|
27
|
+
|
|
28
|
+
> 界面截图仍是砚田时期的旧图,1.0 版(素材场画布、伴写、模板)待补拍;操作以实际界面为准。欢迎在 Issue 里认领截图或发我邮箱。
|
|
29
|
+
|
|
30
|
+
<p align="center"><sub>三栏写作台 · 示例书稿 · 点击图片查看原图</sub></p>
|
|
31
|
+
|
|
32
|
+
> **本分支说明**:起笔 Clio 是 [砚田 Yanfield](https://github.com/ZzimaR/dsh-yanfield) 的非商用分支,沿用 PolyForm Noncommercial 1.0.0;上游版权归 ZzimaR。本分支在砚田 0.2.4 基础上重建,新增素材场画布、伴写与起草、文风档案、知识库、校对与输出流水线、本地文件与备份,详见 [NOTICE.md](NOTICE.md)。
|
|
33
|
+
|
|
34
|
+
功能地图、逐项测试步骤与已知边界整理在 [交付说明](docs/交付说明.md);装好后照着 [测试说明](docs/TEST-GUIDE.md) 走一遍即可。
|
|
35
|
+
|
|
36
|
+
## 这个插件做什么
|
|
37
|
+
|
|
38
|
+
起笔是一个 **DeepSeek Harness 插件**,不是独立应用:安装后 Harness 左侧导航会出现「起笔」,点开就是一个跑在面板里的长篇写作台。
|
|
39
|
+
|
|
40
|
+
界面跟随 DSH 的语言设置(设置 → 通用 → 语言):DSH 用英文时,侧栏显示 **Clio**,工作台、AI 面板与设置页也全部切换为英文;中文界面保持原样。书稿内容不会被翻译,AI 用你写作的语言回复。
|
|
41
|
+
|
|
42
|
+
- **写作台**:作品 / 卷 / 章三级结构,三栏布局(目录 · 正文 · AI),自动保存、字数统计、专注模式、排版可调、宣纸 / 夜航双主题。
|
|
43
|
+
- **一条流水线**:概览 / 素材场 / 写作 / 校对 / 输出五个入口随时互通,先攒素材再写,或写完再拆回画布。
|
|
44
|
+
- **素材场**:无限画布上摊开灵感、场景、摘录与段落;连顺序线决定正文先后,连关联线表达暗线,拖动分组即收束。
|
|
45
|
+
- **伴写与起草**:停笔片刻,光标后浮出浅灰续写(Tab 接受、Esc 忽略,可调上文范围、长度与风格);需要整段时用「起草」带资料写。
|
|
46
|
+
- **文风档案**:从自己的文章里析出写作守则,或从预设与自定义范例里挑一套,AI 按它写。
|
|
47
|
+
- **知识库**:跨作品的设定、资料与判断,写作时用 `@知识` 直接引用。
|
|
48
|
+
- **资料随写随查**:章纲、设定、角色、伏笔、故事档案都在左栏,浮窗就地编辑,不离开正文。
|
|
49
|
+
- **AI 改稿,作者做主**:AI 读资料、多步执行,提出正文与资料改动;正文逐段对比(绿色新增、红色删除),你决定保留哪几段,确认后才写进书稿。
|
|
50
|
+
- **文体模板**:小说、影视剧本、短剧、宣传片、论文、公文、公众号、散文八种内置体例;剧本按「场」、论文按「节」、宣传片按「镜头」建骨架,导出按各自排版走。也可以**从零自定义模板**:单元叫法、小节骨架、体例要求与导出排版都由你定,建好后出现在「新建作品 → 文体模板」。
|
|
51
|
+
- **本地优先**:书稿、设定、对话都在本机 SQLite 里;模型走 Harness 已经配好的 DeepSeek,也可以接 Ollama / LM Studio 的本地模型。
|
|
52
|
+
- **本地文件与备份**:作品可导出到自己的文件夹(正文 / 素材 / 整本 / 备份),自动备份与版本可回滚;导出 Markdown、纯文本、Fountain 剧本、Word、Obsidian。
|
|
53
|
+
|
|
54
|
+
## 安装
|
|
55
|
+
|
|
56
|
+
需要 DeepSeek Harness `>=0.2.1-rc.5`。
|
|
57
|
+
|
|
58
|
+
1. 在 DSH 中打开 **插件 → 添加插件**。
|
|
59
|
+
2. 在 **包名或地址** 中输入 `dsh-clio`,点击 **安装**。
|
|
60
|
+
3. 安装后如果出现 **立即启用**,点击它。左侧导航出现 **起笔** 后即可打开。如果 DSH 提示重启,完全退出后重新打开。版本与构建时间可在 **起笔 → 设置 → 关于** 查看。
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
约 14 秒,中文浅色界面。点击动图可看原图。
|
|
65
|
+
|
|
66
|
+
打开起笔书架或写作台时,会通过 Harness 检查当前安装有没有兼容的新版本。有更新时可点书架提示或编辑器顶栏的更新入口,在 Harness 的插件详情里确认。关闭提醒后,同一版本不会再提示。也可以在起笔的 **设置 → 关于** 手动检查。如果 DSH 报找不到 `pnpm`,请安装 pnpm,并确认启动 DSH 的环境能在 `PATH` 上找到它。
|
|
67
|
+
|
|
68
|
+
## 第一次使用
|
|
69
|
+
|
|
70
|
+
1. 点左侧「起笔」,在书架页 **新建作品**(书名、类型、封面底色、一句话简介)。
|
|
71
|
+
2. 进入作品后点 **写作**,就来到三栏写作台:左栏目录 / 章纲 / 设定 / 档案,中间正文,右侧 AI 助手。
|
|
72
|
+
3. 右侧输入框直接说需求即可,例如「把第一段改得更有画面感,只改第一段」「为下一章写一份章纲」「给周晚建一张角色卡」。
|
|
73
|
+
4. AI 提出的正文改动会在正文区打开审阅:逐段「保留 / 还原」,点「确认审阅结果」后只写入保留的段落;资料改动在任务卡里逐项确认。
|
|
74
|
+
|
|
75
|
+
模型来源(`设置 → 模型服务`):
|
|
76
|
+
|
|
77
|
+
| 方式 | 需要什么 | 说明 |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| DSH 账号登录 | 在 Harness 里登录 DeepSeek | 推荐,零配置;余额可直接查 |
|
|
80
|
+
| 官方 API Key | `DEEPSEEK_API_KEY` | 按量计费;也可在 DSH 的模型服务页填写 |
|
|
81
|
+
| DSH 自定义模型 | 在 DSH 的「设置 → 模型」中配置 API | 可接入 LM Studio、vLLM 或 llama.cpp |
|
|
82
|
+
| 离线演示 | 不需要 | 只有模板文本,用于试用界面,不能真正改稿 |
|
|
83
|
+
|
|
84
|
+
在起笔的「模型服务」或写作助手中直接选择模型。模型按 DSH 路由分组。
|
|
85
|
+
|
|
86
|
+
## 功能
|
|
87
|
+
|
|
88
|
+
> 界面截图仍是砚田时期的旧图,素材场、伴写、校对与输出等新界面待补拍;以实际界面为准。
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
**写作**
|
|
93
|
+
|
|
94
|
+
- 作品 / 卷 / 章三级结构;新建卷、新建章、拖拽排序,章节树显示字数与状态
|
|
95
|
+
- 正文自动保存(延迟可调)+ 手动保存;字数、段落、阅读时间实时统计
|
|
96
|
+
- 章节版本历史:保存快照、预览旧稿,并在恢复正文前自动留存当前版本
|
|
97
|
+
- 排版可调:衬线 / 黑体、字号、字重、行高、字间距、段落间距、页边距、最大行宽
|
|
98
|
+
- 专注模式(隐藏侧栏)、打字机模式(光标居中)、写作目标与每日字数
|
|
99
|
+
- `Alt + 1` 收起 / 打开目录,`Alt + J` 聚焦 AI 输入框,`Ctrl / ⌘ + K` 快速跳转,`Ctrl / ⌘ + F` 页内查找
|
|
100
|
+
|
|
101
|
+
**资料**
|
|
102
|
+
|
|
103
|
+
- 总纲 / 卷纲 / 章纲三级大纲(目标、冲突、场景节拍、钩子)
|
|
104
|
+
- 角色卡、世界观、伏笔、故事档案(本章摘要、人物状态、设定变动、时间线、待确认冲突)
|
|
105
|
+
- 设定在揭示章节前默认对 AI 隐藏;关掉「AI 可见性」后即使 `@` 引用也读不到
|
|
106
|
+
- TXT 导入(识别「第 N 章」等标题自动拆章,预览后写入)、Markdown / TXT 导出
|
|
107
|
+
|
|
108
|
+
**AI 助手**
|
|
109
|
+
|
|
110
|
+
- 一个对话里完成续写、改稿、建卡、改设定、理章纲;带技能预设、文风选择与可自定义人设
|
|
111
|
+
- `@` 引用章节、角色、设定、伏笔、档案;上下文预算与分节预览可调
|
|
112
|
+
- 关键进展按顺序保留,当前步骤原地更新;上翻阅读时暂停自动滚动
|
|
113
|
+
- 正文改动在正文区逐段审阅(绿色新增 / 红色删除),资料改动按字段对比
|
|
114
|
+
- 助手根据本轮指令查找和读取资料,再生成待审阅的改动。批量改动的成功项可以先审阅,失败项可在「执行记录」查看。需要从新稿整理资料时,可在同一条指令里提出,候选会附上可核对的正文引文
|
|
115
|
+
- 支持把常用指令存成提示词预设。工具栏「AI 助手」的续写、扩写、润色和去 AI 味快捷任务会使用对应的预设
|
|
116
|
+
|
|
117
|
+

|
|
118
|
+
|
|
119
|
+
## AI 与费用
|
|
120
|
+
|
|
121
|
+
- **模型**:`设置 → 模型服务` 和写作助手的模型列表同时显示 DSH 各路由中的可用模型。LM Studio、vLLM 和 llama.cpp 的配置方式见 [AI 与费用](docs/ai-and-cost.md)。
|
|
122
|
+
- **模型目录**:`deepseek-flash`(DeepSeek-V4.1-Flash,支持文本与图像)与 `deepseek-v4-pro`(DeepSeek-V4-Pro,纯文本),上下文各约 100 万 token;Harness 新增模型时会自动同步进选择器。
|
|
123
|
+
- **余额**:输入框底部的「余额」直接查 DSH 已登录账号的余额,不需要填 Key。
|
|
124
|
+
- **费用**:底部「今日 N tok · 预估 ¥X」是**今日累计**的估算,不是单次任务;单价由插件内置的 DeepSeek 官方价目表提供,按北京时间自动区分高峰与空闲(高峰为工作日 9:00–12:00、14:00–18:00,其余时段与法定节假日按空闲计,空闲价是高峰价的一半)。**估算仅供参考,账单以 DeepSeek 官方为准。**
|
|
125
|
+
- **用量控制**:每轮先用一次短模型调用判断任务范围,一般决策轮关闭深度思考。小段润色、选区改写自动降档,较长的工具回执分页返回。
|
|
126
|
+
|
|
127
|
+
## 截图
|
|
128
|
+
|
|
129
|
+
| 书架 | 写作台 |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| [](docs/screenshots/clio-library.jpg) | [](docs/screenshots/clio-workspace.jpg) |
|
|
132
|
+
|
|
133
|
+
| 素材场画布 | 输出 |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| [](docs/screenshots/clio-canvas.jpg) | [](docs/screenshots/clio-export.jpg) |
|
|
136
|
+
|
|
137
|
+
更多:[作品概览](docs/screenshots/clio-overview.jpg) · [模型服务设置(含本地模型)](docs/screenshots/clio-settings-models.jpg) · [截图说明](docs/screenshots/README.md)
|
|
138
|
+
|
|
139
|
+
## 数据与备份
|
|
140
|
+
|
|
141
|
+
- 书稿默认在 `$DSH_HOME/yanfield/yanfield.db`(含 `-wal` / `-shm` 附属文件)。`设置 → 数据` 会显示实际路径并能一键打开所在文件夹。
|
|
142
|
+
- 用环境变量 `YANFIELD_DB_PATH` 可指定数据库文件。若 profile 的 `cordis.patch.yml` 配置了插件的 `dataDir`,优先使用该目录里的 `yanfield.db`。
|
|
143
|
+
- 在 **设置 → 数据 → 导出备份** 下载 `.yanfield` 文件。可以选择作品,备份正文、设定、资料和 AI 历史,也可以整库备份,额外带走全局设置、预设、模型服务配置和统计。
|
|
144
|
+
- 在 **导入备份** 预览文件并导入作品副本。只有整库备份可用来 **恢复整库**,恢复前起笔会在数据目录保存一份 `yanfield-before-restore-*.db`。需要回退时,退出 Harness,再用该快照替换当前数据库文件,并移走当前库的同名 `-wal` 和 `-shm` 文件。
|
|
145
|
+
- 整库导出默认省略模型服务 API Key。请勾选 **加密备份并包含模型服务 API Key** 来迁移起笔保存的密钥。Harness 管理的账号与凭据需要在目标环境分别配置。
|
|
146
|
+
- 数据库结构升级前,起笔会在同一目录创建整库快照。备份失败时会停止升级。升级成功后保留最近三份自动升级备份。
|
|
147
|
+
- 卸载插件不会删除书稿;数据库仍在上面那个路径里。
|
|
148
|
+
|
|
149
|
+
## 排障
|
|
150
|
+
|
|
151
|
+
<details>
|
|
152
|
+
<summary>左侧没有「起笔」</summary>
|
|
153
|
+
|
|
154
|
+
先确认是完全退出 Harness 后重开的(不是刷新页面),再看 `设置 → 插件` 里 `dsh-clio` 是否已启用、版本是否为刚装的那次。
|
|
155
|
+
</details>
|
|
156
|
+
|
|
157
|
+
<details>
|
|
158
|
+
<summary>发消息报 no API key / 模型不可用</summary>
|
|
159
|
+
|
|
160
|
+
当前选的是「DeepSeek 官方 API Key」路由下的模型,但还没有填 Key。在起笔选择「DeepSeek 账号登录」分组下的模型,或在 DSH 的「设置 → 模型」填写 API Key。
|
|
161
|
+
</details>
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary>余额显示「—」或提示未登录</summary>
|
|
165
|
+
|
|
166
|
+
余额来自 DSH 已登录的 DeepSeek 账号。先在 Harness 里登录 DeepSeek 账号,再回来点一下「查询余额」。
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary>费用一直是「费用未知」</summary>
|
|
171
|
+
|
|
172
|
+
说明这次调用没有返回 usage(比如请求中断),或者模型不在内置价目表里、你也没有在 `设置 → AI 与上下文` 里填单价。填上三档单价后会显示预估值。
|
|
173
|
+
</details>
|
|
174
|
+
|
|
175
|
+
<details>
|
|
176
|
+
<summary>书稿在哪 / 换电脑怎么迁</summary>
|
|
177
|
+
|
|
178
|
+
见上面「数据与备份」。换机器时导出整库备份,在目标环境导入并恢复。
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary>怎么卸载</summary>
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
dsh plugin --profile desktop remove dsh-clio
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
然后重启 Harness。书稿不会被删除。
|
|
189
|
+
</details>
|
|
190
|
+
|
|
191
|
+
## 开发
|
|
192
|
+
|
|
193
|
+
需要 Node.js ≥ 22.19(构建与自检用;运行时由 Harness 提供)。
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
npm ci # 按 package-lock.json 安装构建依赖
|
|
197
|
+
npm test # 构建 dist/,再运行清单检查与冒烟测试
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
client/ 插件半区:Shadow DOM 挂载、插槽注册、样式入口
|
|
202
|
+
src/host.ts 宿主半区:/yanfield 下的 REST/SSE 路由、模型与账号桥接
|
|
203
|
+
src/yanfield/ 写作台本体(React 组件、领域逻辑、SQLite 访问)
|
|
204
|
+
scripts/ 构建、自检、冒烟、重装、官网构建
|
|
205
|
+
site/ 官网(yanfield.com)源码
|
|
206
|
+
docs/ 功能、AI 与费用、架构、开发、常见问题
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
从本地源码安装到隔离 profile 的步骤见 [本地联调](docs/development.md#五本地联调)。架构与数据模型见 [架构说明](docs/architecture.md),功能清单见 [功能说明](docs/features.md),AI 接入和费用见 [AI 与费用](docs/ai-and-cost.md),排障见 [常见问题](docs/faq.md)。
|
|
210
|
+
|
|
211
|
+
官网([yanfield.com](https://yanfield.com))是 `site/` 下的纯静态站点:`npm run build:site` 构建,`npm run check:site` 检查,`npm run preview:site` 本地预览,推送到 `main` 后由 GitHub Pages 部署。构建和部署细节见 [官网](docs/website.md)。
|
|
212
|
+
|
|
213
|
+
English docs: [README.en.md](README.en.md) · [docs/en/](docs/en/features.md)
|
|
214
|
+
|
|
215
|
+
## 路线图
|
|
216
|
+
|
|
217
|
+
- **v0.2.0(当前)**:三栏写作台、资料系统、章节版本历史、AI 审阅与费用可视化;
|
|
218
|
+
- **下一步**:EPUB 导出、更细的写作统计;
|
|
219
|
+
- **更远**:知识图谱视图、多模型对比、协作审阅。
|
|
220
|
+
|
|
221
|
+
## 许可
|
|
222
|
+
|
|
223
|
+
[PolyForm Noncommercial 1.0.0](LICENSE):可以自用、学习、修改和分享,不得商用。用它写出来的小说,版权归作者。
|