dsh-cite 0.7.10 → 0.8.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/CHANGELOG.md +12 -0
- package/README.en.md +21 -10
- package/README.md +21 -10
- package/docs/WORKBENCH.md +8 -4
- package/docs/assets/screenshots/doi-check-en.jpg +0 -0
- package/docs/assets/screenshots/doi-check-zh.jpg +0 -0
- package/docs/assets/screenshots/import-en.jpg +0 -0
- package/docs/assets/screenshots/import-zh.jpg +0 -0
- package/docs/assets/screenshots/library-en.jpg +0 -0
- package/docs/assets/screenshots/library-zh.jpg +0 -0
- package/lib/citation-errors.js +4 -0
- package/lib/citation-workbench.d.ts +1 -0
- package/lib/citation-workbench.js +16 -2
- package/lib/client.js +1148 -216
- package/lib/tools.d.ts +17 -0
- package/lib/tools.js +19 -16
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# 更新记录
|
|
2
2
|
|
|
3
|
+
## 0.8.1 (2026-11-17)
|
|
4
|
+
|
|
5
|
+
- 在工作台单独检查和安装兼容版本。自动安装默认关闭,可为该插件开启空闲时的稳定补丁更新。
|
|
6
|
+
- Check and install compatible versions separately from the workbench. Automatic installation is off by default. Enable it for this plugin to apply stable patches while idle.
|
|
7
|
+
|
|
8
|
+
## 0.8.0 (2026-11-16)
|
|
9
|
+
|
|
10
|
+
- 新版原生引文工作台包含格式与状态筛选、文献列表和详情三栏,支持在详情复制当前格式的引文或 BibTeX。窄屏可以在列表和详情之间切换。
|
|
11
|
+
- 新增 DOI 核查页,按首次出现的顺序向 Crossref 查询前 50 个唯一 DOI。导入页保留去重预览和冲突恢复,导出页支持按范围检查和下载。
|
|
12
|
+
- The native workbench has panes for format and status filters, the reference list, and details. Copy a formatted citation or BibTeX from the details pane. Narrow layouts let you switch between the list and details.
|
|
13
|
+
- The DOI check tab queries Crossref for the first 50 unique DOIs in order of appearance. The import tab previews duplicates and recovers from save conflicts. The export tab checks and downloads the chosen scope.
|
|
14
|
+
|
|
3
15
|
## 0.7.10 (2026-11-14)
|
|
4
16
|
|
|
5
17
|
- 适配 DSH 0.2.2-rc.3:最低 Harness 版本声明提升至 0.2.2-rc.3,运行时代码未变。
|
package/README.en.md
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
# Cite
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Organize references, check DOIs, and export citations in DeepSeek Harness.**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-cite) [](https://www.npmjs.com/package/dsh-cite) [](https://www.npmjs.com/package/dsh-cite)
|
|
8
8
|
|
|
9
9
|
**[Install](#install) · [Workflow](#start-using-it) · [Full guide](https://github.com/STARDUSTLC666/dsh-cite/blob/master/docs/REFERENCE.en.md)**
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
## Screenshots
|
|
12
|
+
|
|
13
|
+
[](docs/assets/screenshots/library-en.jpg)
|
|
14
|
+
|
|
15
|
+
| Import preview and deduplication | DOI check |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [](docs/assets/screenshots/import-en.jpg) | [](docs/assets/screenshots/doi-check-en.jpg) |
|
|
18
|
+
|
|
19
|
+
*Captured with `dsh-cite 0.8.0` running in Harness Web `0.2.2-rc.3`.*
|
|
17
20
|
|
|
18
21
|
## Features
|
|
19
22
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
+
- Filter, search, and inspect references in a three-pane library. Copy a formatted citation or its BibTeX entry.
|
|
24
|
+
- Preview duplicates and missing fields locally before importing a DOI list or BibTeX.
|
|
25
|
+
- Check manuscript DOIs against Crossref, or fill gaps in saved references and review differences.
|
|
26
|
+
- Export selected references or the entire library. Download a full backup with the original sources.
|
|
23
27
|
|
|
24
28
|
## Install
|
|
25
29
|
|
|
@@ -33,6 +37,13 @@ For the web profile, replace `desktop` with `web`. Restart that DSH profile afte
|
|
|
33
37
|
|
|
34
38
|
## Start using it
|
|
35
39
|
|
|
40
|
+
<picture>
|
|
41
|
+
<source media="(prefers-color-scheme: dark) and (max-width: 640px)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-en-mobile-dark.svg">
|
|
42
|
+
<source media="(max-width: 640px)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-en-mobile-light.svg">
|
|
43
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-en-dark.svg">
|
|
44
|
+
<img src="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-en-light.svg" alt="Turn scattered DOIs and BibTeX into a reference library. · workflow illustration" width="100%">
|
|
45
|
+
</picture>
|
|
46
|
+
|
|
36
47
|
1. Open Citations in the sidebar and prepare DOI entries or a BibTeX file.
|
|
37
48
|
2. Preview the import locally; inspect entries, duplicates and fields before saving selected references.
|
|
38
49
|
3. Select entries and explicitly request Crossref enrichment when needed, then review the returned fields.
|
package/README.md
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
# Cite
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**在 DeepSeek Harness 中整理文献、核查 DOI 并导出引文。**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-cite) [](https://www.npmjs.com/package/dsh-cite) [](https://www.npmjs.com/package/dsh-cite)
|
|
8
8
|
|
|
9
9
|
**[安装使用](#安装) · [使用流程](#开始使用) · [完整说明](https://github.com/STARDUSTLC666/dsh-cite/blob/master/docs/REFERENCE.zh.md)**
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
## 界面截图
|
|
12
|
+
|
|
13
|
+
[](docs/assets/screenshots/library-zh.jpg)
|
|
14
|
+
|
|
15
|
+
| 导入预览与去重 | DOI 核查 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [](docs/assets/screenshots/import-zh.jpg) | [](docs/assets/screenshots/doi-check-zh.jpg) |
|
|
18
|
+
|
|
19
|
+
*截图来自 Harness Web `0.2.2-rc.3` 中运行的 `dsh-cite 0.8.0`。*
|
|
17
20
|
|
|
18
21
|
## 功能
|
|
19
22
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
+
- 在三栏文献库筛选、搜索和查看文献,复制引文或 BibTeX。
|
|
24
|
+
- 导入 DOI 列表或 BibTeX 前,在本地预览重复项与缺失字段。
|
|
25
|
+
- 通过 Crossref 核查文稿中的 DOI,或补全已存文献的空字段并查看差异。
|
|
26
|
+
- 导出所选文献或全库引文,下载包含原始来源的完整备份。
|
|
23
27
|
|
|
24
28
|
## 安装
|
|
25
29
|
|
|
@@ -33,6 +37,13 @@ dsh plugin --profile desktop add dsh-cite
|
|
|
33
37
|
|
|
34
38
|
## 开始使用
|
|
35
39
|
|
|
40
|
+
<picture>
|
|
41
|
+
<source media="(prefers-color-scheme: dark) and (max-width: 640px)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-zh-mobile-dark.svg">
|
|
42
|
+
<source media="(max-width: 640px)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-zh-mobile-light.svg">
|
|
43
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-zh-dark.svg">
|
|
44
|
+
<img src="https://raw.githubusercontent.com/STARDUSTLC666/dsh-cite/master/docs/assets/intro/workflow-zh-light.svg" alt="把零散 DOI 和 BibTeX 整理成可用的文献库。 · 流程示意" width="100%">
|
|
45
|
+
</picture>
|
|
46
|
+
|
|
36
47
|
1. 从左侧栏打开“引文库”,准备 DOI 列表或 BibTeX 文件。
|
|
37
48
|
2. 先做本地导入预览,检查条目、重复项和字段,再保存选中的文献。
|
|
38
49
|
3. 需要联网补全时,选择条目后主动执行 Crossref 补全,核对返回字段。
|
package/docs/WORKBENCH.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# dsh-cite 工作台 / Workbench
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
引文库分为格式与状态筛选、文献列表、详情三栏。可按 DOI、标题、作者或引用键搜索,并在详情复制当前格式的引文或 BibTeX。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The library has three panes for format and status filters, references, and details. Search by DOI, title, author, or citation key. Copy the formatted citation or BibTeX from the details pane.
|
|
6
6
|
|
|
7
7
|
## 使用 / Use
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ The UI follows host language and theme without translating user content. Narrow
|
|
|
16
16
|
|
|
17
17
|
## 导出前检查与冲突 / Export checks and conflicts
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
「导出备份」支持切换「全部文献 / 仅所选」。切换范围会更新文献条数、引文预览,以及缺少标题、作者或年份的条目数。完整备份始终包含全库与原始输入。
|
|
20
20
|
|
|
21
21
|
The downloads tab shows a pre-export check before the links: switch between the entire library and the current selection, read the entry count, citation style, counts of entries missing title/authors/year, and the note that full backup always covers the whole library with original sources. Counts come from the local library and recompute when the scope changes; an empty library explains itself instead of showing inert buttons.
|
|
22
22
|
|
|
@@ -24,9 +24,13 @@ The downloads tab shows a pre-export check before the links: switch between the
|
|
|
24
24
|
|
|
25
25
|
A concurrent-save conflict is shown as an error status that names what happened, keeps the input, and offers one recovery path (preview the current input again). Saving stays disabled with a stated reason, so the same stale revision cannot be resubmitted.
|
|
26
26
|
|
|
27
|
+
「DOI 核查」页复用 `cite_check` 的校验逻辑。点击核查后,按首次出现顺序向 Crossref 查询前 50 个唯一 DOI。核查以只读方式运行。
|
|
28
|
+
|
|
29
|
+
The DOI check tab uses the same validation as `cite_check` to look up the first 50 unique DOIs in order of appearance. Checking is read-only.
|
|
30
|
+
|
|
27
31
|
## 源码 / Source
|
|
28
32
|
|
|
29
|
-
编辑 templates/client.js、templates/panels/*.js
|
|
33
|
+
编辑 templates/client.js、templates/panels/*.js 和 templates/workbench.css,运行 pnpm run build。lib/client.js 是确定性产物,请随源码提交。公共组件的规范源位于 dsh-suite/ui/workbench-ui.js,Suite 的同步脚本显式分发副本;单个仓库可独立构建和安装。
|
|
30
34
|
|
|
31
35
|
Edit the template sources and run pnpm run build. Commit generated lib/client.js with source changes. The vendored UI has no Suite runtime dependency.
|
|
32
36
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/citation-errors.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/** English UI messages; bibliographic content and original source text stay unchanged. */
|
|
2
2
|
export function englishCitationError(raw) {
|
|
3
|
+
if (raw === '请粘贴待核查的文本。')
|
|
4
|
+
return 'Paste text to check.';
|
|
5
|
+
if (raw === '核查文本不能超过 256 KiB。')
|
|
6
|
+
return 'Check up to 256 KiB of text at a time.';
|
|
3
7
|
if (/^Crossref.*超时/.test(raw))
|
|
4
8
|
return 'Crossref timed out. Retry later; your local entries were preserved.';
|
|
5
9
|
if (/^Crossref 请求失败:/.test(raw))
|
|
@@ -94,6 +94,7 @@ export declare class CitationWorkbench {
|
|
|
94
94
|
job(id: unknown): EnrichmentJob;
|
|
95
95
|
cancel(id: unknown): EnrichmentJob;
|
|
96
96
|
dispose(): void;
|
|
97
|
+
private check;
|
|
97
98
|
export(kind: unknown, style: unknown, lang: unknown, rawIds?: unknown): Promise<{
|
|
98
99
|
filename: string;
|
|
99
100
|
type: string;
|
|
@@ -3,7 +3,8 @@ import { lookupDoi } from './crossref.js';
|
|
|
3
3
|
import { buildBibtex, buildCitation, readStyle } from './format.js';
|
|
4
4
|
import { parseCitationInput } from './citation-parser.js';
|
|
5
5
|
import { CitationStore } from './citation-store.js';
|
|
6
|
-
import { LibraryConflict, candidateKey, citationId, normalizeWork, readImportInput, readSelection, workWarnings } from './citation-model.js';
|
|
6
|
+
import { LibraryConflict, MAX_INPUT_BYTES, candidateKey, citationId, normalizeWork, readImportInput, readSelection, workWarnings } from './citation-model.js';
|
|
7
|
+
import { checkDois, MAX_DOI_CHECKS } from './tools.js';
|
|
7
8
|
import { englishCitationError } from './citation-errors.js';
|
|
8
9
|
const message = (e) => (e instanceof Error ? e.message : String(e)).slice(0, 1800);
|
|
9
10
|
const summary = (state) => ({ revision: state.revision, entries: state.entries.map(e => ({ ...e, warnings: workWarnings(e.work) })), sources: state.sources.map(({ text: _text, ...s }) => s) });
|
|
@@ -193,6 +194,15 @@ export class CitationWorkbench {
|
|
|
193
194
|
j.controller.abort(); return structuredClone(j.view); }
|
|
194
195
|
dispose() { this.lifetime.abort(new Error('插件已卸载。')); for (const j of this.jobs.values())
|
|
195
196
|
j.controller.abort(); }
|
|
197
|
+
async check(text, signal) {
|
|
198
|
+
this.live();
|
|
199
|
+
if (typeof text !== 'string' || !text.trim())
|
|
200
|
+
throw new Error('请粘贴待核查的文本。');
|
|
201
|
+
if (Buffer.byteLength(text) > MAX_INPUT_BYTES)
|
|
202
|
+
throw new Error('核查文本不能超过 256 KiB。');
|
|
203
|
+
const { count, results } = await checkDois(text, this.cfg, MAX_DOI_CHECKS, this.fetchImpl, AbortSignal.any([signal, this.lifetime.signal]));
|
|
204
|
+
return { count, results: results.map(row => row.error ? { ...row, errorEn: englishCitationError(row.error) } : row) };
|
|
205
|
+
}
|
|
196
206
|
async export(kind, style, lang, rawIds) {
|
|
197
207
|
this.live();
|
|
198
208
|
const state = await this.store.read(), ids = rawIds === undefined ? undefined : readSelection(rawIds);
|
|
@@ -260,7 +270,11 @@ export class CitationWorkbench {
|
|
|
260
270
|
const text = await request.text();
|
|
261
271
|
if (Buffer.byteLength(text) > 2 * 1024 * 1024)
|
|
262
272
|
throw new Error('请求超过容量限制,请拆分输入。');
|
|
263
|
-
|
|
273
|
+
const input = JSON.parse(text);
|
|
274
|
+
const value = input?.action === 'check'
|
|
275
|
+
? await this.check(input.text, request.signal)
|
|
276
|
+
: await this.dispatch(input, request.signal);
|
|
277
|
+
return Response.json({ ok: true, value }, { headers: { 'cache-control': 'no-store' } });
|
|
264
278
|
}
|
|
265
279
|
catch (e) {
|
|
266
280
|
return Response.json({ ok: false, message: message(e), messageEn: englishCitationError(message(e)) }, { status: e instanceof LibraryConflict ? 409 : 400, headers: { 'cache-control': 'no-store' } });
|