dsh-cite 0.7.9 → 0.8.0
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 +8 -7
- package/README.md +8 -7
- package/docs/REFERENCE.en.md +1 -1
- package/docs/REFERENCE.zh.md +1 -1
- package/docs/WORKBENCH.md +8 -4
- 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 +1005 -184
- 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.0 (2026-11-16)
|
|
4
|
+
|
|
5
|
+
- 新版原生引文工作台包含格式与状态筛选、文献列表和详情三栏,支持在详情复制当前格式的引文或 BibTeX。窄屏可以在列表和详情之间切换。
|
|
6
|
+
- 新增 DOI 核查页,按首次出现的顺序向 Crossref 查询前 50 个唯一 DOI。导入页保留去重预览和冲突恢复,导出页支持按范围检查和下载。
|
|
7
|
+
- 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.
|
|
8
|
+
- 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.
|
|
9
|
+
|
|
10
|
+
## 0.7.10 (2026-11-14)
|
|
11
|
+
|
|
12
|
+
- 适配 DSH 0.2.2-rc.3:最低 Harness 版本声明提升至 0.2.2-rc.3,运行时代码未变。
|
|
13
|
+
- Support DSH 0.2.2-rc.3: raise the minimum Harness declaration to 0.2.2-rc.3; runtime code is unchanged.
|
|
14
|
+
|
|
3
15
|
## 0.7.9 (2026-11-04)
|
|
4
16
|
|
|
5
17
|
- 同步共享界面:嵌入设置时继承宿主底色,输入框跟随主题,空状态保持可读宽度;新版 DSH 可显示插件设置图标。
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- Filter, search, and inspect references in a three-pane library. Copy a formatted citation or its BibTeX entry.
|
|
21
|
+
- Preview duplicates and missing fields locally before importing a DOI list or BibTeX.
|
|
22
|
+
- Check manuscript DOIs against Crossref, or fill gaps in saved references and review differences.
|
|
23
|
+
- Export selected references or the entire library. Download a full backup with the original sources.
|
|
23
24
|
|
|
24
25
|
## Install
|
|
25
26
|
|
|
@@ -29,7 +30,7 @@ Open **Plugins** in the DSH desktop app and install `dsh-cite`. If the CLI is av
|
|
|
29
30
|
dsh plugin --profile desktop add dsh-cite
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
For the web profile, replace `desktop` with `web`. Restart that DSH profile after installation. The package’s DSH requirement is `>=0.2.
|
|
33
|
+
For the web profile, replace `desktop` with `web`. Restart that DSH profile after installation. The package’s DSH requirement is `>=0.2.2-rc.3`.
|
|
33
34
|
|
|
34
35
|
## Start using it
|
|
35
36
|
|
|
@@ -58,9 +59,9 @@ Check updates at the bottom of the workbench or native plugin details. Automatic
|
|
|
58
59
|
- [Release notes](https://github.com/STARDUSTLC666/dsh-cite/blob/master/CHANGELOG.md)
|
|
59
60
|
- [Validation scope and history](https://github.com/STARDUSTLC666/dsh-cite/blob/master/docs/VALIDATION.md)
|
|
60
61
|
|
|
61
|
-
## Feedback
|
|
62
|
+
## Feedback
|
|
62
63
|
|
|
63
|
-
If the plugin helps, a Star makes it easier for others to discover. Report problems or suggest improvements in [Issues](https://github.com/STARDUSTLC666/dsh-cite/issues)
|
|
64
|
+
If the plugin helps, a Star makes it easier for others to discover. Report problems or suggest improvements in [Issues](https://github.com/STARDUSTLC666/dsh-cite/issues). Include versions and reproduction steps, and remove credentials from reports.
|
|
64
65
|
|
|
65
66
|
## License
|
|
66
67
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
## 功能
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- 在三栏文献库筛选、搜索和查看文献,复制引文或 BibTeX。
|
|
21
|
+
- 导入 DOI 列表或 BibTeX 前,在本地预览重复项与缺失字段。
|
|
22
|
+
- 通过 Crossref 核查文稿中的 DOI,或补全已存文献的空字段并查看差异。
|
|
23
|
+
- 导出所选文献或全库引文,下载包含原始来源的完整备份。
|
|
23
24
|
|
|
24
25
|
## 安装
|
|
25
26
|
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
dsh plugin --profile desktop add dsh-cite
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
网页版把 `desktop` 改为 `web`;安装后重启对应的 DSH。宿主要求以包声明 `>=0.2.
|
|
33
|
+
网页版把 `desktop` 改为 `web`;安装后重启对应的 DSH。宿主要求以包声明 `>=0.2.2-rc.3` 为准。
|
|
33
34
|
|
|
34
35
|
## 开始使用
|
|
35
36
|
|
|
@@ -58,9 +59,9 @@ dsh plugin --profile desktop add dsh-cite
|
|
|
58
59
|
- [更新记录](https://github.com/STARDUSTLC666/dsh-cite/blob/master/CHANGELOG.md)
|
|
59
60
|
- [验证范围与历史](https://github.com/STARDUSTLC666/dsh-cite/blob/master/docs/VALIDATION.md)
|
|
60
61
|
|
|
61
|
-
##
|
|
62
|
+
## 反馈
|
|
62
63
|
|
|
63
|
-
如果插件帮到了你,欢迎 Star,让更多人发现它。问题和建议请提交 [Issues](https://github.com/STARDUSTLC666/dsh-cite/issues)
|
|
64
|
+
如果插件帮到了你,欢迎 Star,让更多人发现它。问题和建议请提交 [Issues](https://github.com/STARDUSTLC666/dsh-cite/issues)。反馈时附上版本与复现步骤,并移除凭据。
|
|
64
65
|
|
|
65
66
|
## License
|
|
66
67
|
|
package/docs/REFERENCE.en.md
CHANGED
|
@@ -57,7 +57,7 @@ Detailed configuration, tool arguments and troubleshooting are in the [usage gui
|
|
|
57
57
|
|
|
58
58
|
## Plugin updates
|
|
59
59
|
|
|
60
|
-
Requires DSH 0.2.
|
|
60
|
+
Requires DSH 0.2.2-rc.3 or newer. Update controls sit at the bottom of the existing workbench, or native plugin details for plugins without a workbench. Checks, release notes and preferences expand in place, with no separate update page or settings menu. Automatic checks are on by default; **automatic installation is off by default**. Only explicit opt-in permits compatible stable patches while idle with no unsaved changes. Preferences are independent, with per-plugin disable, deferral and ignore controls. No forced DSH restart or upgrade, and local-source installations stay unchanged. Suite components explain and operate on the whole Suite in the same footer.
|
|
61
61
|
|
|
62
62
|
Older releases need one manual update in native plugin management to acquire these controls. Publishing to npm does not replace an existing user installation.
|
|
63
63
|
|
package/docs/REFERENCE.zh.md
CHANGED
|
@@ -57,7 +57,7 @@ dsh plugin --profile desktop add dsh-cite
|
|
|
57
57
|
|
|
58
58
|
## 插件更新
|
|
59
59
|
|
|
60
|
-
需要 DSH 0.2.
|
|
60
|
+
需要 DSH 0.2.2-rc.3 或更新版本。更新控件直接位于原有工作台内容末尾;没有工作台的插件,位于原生插件详情页底部。检查、更新记录和偏好在原地展开,不增加独立更新页面或设置菜单。自动检查默认开启;**自动安装默认关闭**,明确授权后才会在空闲且没有未保存修改时安装兼容的稳定补丁。开关按插件独立保存,可关闭、推迟或忽略提醒;不会强制重启 DSH、升级 DSH 本体或替换本地源码安装。Suite 组件在当前页面底部明确说明并操作 Suite 整包更新。
|
|
61
61
|
|
|
62
62
|
旧版用户先在官方插件管理中手动更新一次,之后才会获得此入口。发布到 npm 不会直接替换用户已经安装的版本。
|
|
63
63
|
|
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
|
|
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' } });
|