dsh-cite 0.3.2 → 0.3.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
@@ -1,5 +1,11 @@
1
1
  # dsh-cite
2
2
 
3
+ ## 0.3.4 update (2026-09-27)
4
+
5
+ Preserves given/family name boundaries and compound surnames in BibTeX. Corporate authors are protected with braces instead of being parsed as personal names.
6
+
7
+ Validation host: Harness 0.1.7-rc.2 built from official sources, retaining the local tool-scheduler fix. Build and automated checks pass; interactive coverage and external-service limits are recorded in this release round.
8
+
3
9
  ![npm](https://img.shields.io/npm/v/dsh-cite) ![downloads](https://img.shields.io/npm/dm/dsh-cite) ![license](https://img.shields.io/github/license/STARDUSTLC666/dsh-cite) ![stars](https://img.shields.io/github/stars/STARDUSTLC666/dsh-cite?style=social)
4
10
 
5
11
  > Give it a DOI, get a proper citation — GB/T 7714 / APA / MLA / Chicago / BibTeX.
@@ -18,7 +24,7 @@ A DeepSeek Harness plugin for bibliographic references: query Crossref and forma
18
24
 
19
25
  ## Compatibility
20
26
 
21
- Verified against `@deepseek-ai/dsh@0.1.2-alpha.2` on 2026-08-31. Built for the cordis patch-bundle plugin model (`cordis.patch.yml` + `dsh.bundle.patch`). No runtime imports of `@deepseek-ai/*` internals.
27
+ Verified with official `@deepseek-ai/dsh@0.1.5-rc.1` and Node `24.16.0` on 2026-09-11: all 18 components load alongside Modlens, with passing tool-schema, skill-registration and offline read-only invocation checks. Uses the `cordis.patch.yml` + `dsh.bundle.patch` bundle model. Node requirements match this Harness release: 22.19 or later within 22.x, or 24 or later. Live external-service workflows require separate configuration and validation.
22
28
 
23
29
  ## Install
24
30
 
package/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # dsh-cite
2
2
 
3
+ ## 0.3.4 更新(2026-09-27)
4
+
5
+ 修复 BibTeX 作者姓名顺序,保留复合姓氏;机构作者使用独立括号,避免被拆成人名。
6
+
7
+ 验证宿主:官方源码构建的 Harness 0.1.7-rc.2(保留本地工具调度器修复)。构建与自动测试通过;实际操作和外部服务限制见本轮验收记录。
8
+
3
9
  ![npm](https://img.shields.io/npm/v/dsh-cite) ![downloads](https://img.shields.io/npm/dm/dsh-cite) ![license](https://img.shields.io/github/license/STARDUSTLC666/dsh-cite) ![stars](https://img.shields.io/github/stars/STARDUSTLC666/dsh-cite?style=social)
4
10
 
5
11
  > 给一个 DOI,还你规范参考文献——GB/T 7714 / APA / MLA / Chicago / BibTeX。
@@ -18,7 +24,7 @@ DeepSeek Harness 参考文献工具插件:通过 Crossref API 查询文献元
18
24
 
19
25
  ## 兼容性
20
26
 
21
- 在 `@deepseek-ai/dsh@0.1.2-alpha.2` 上验证(2026-08-31)。遵循 cordis 组合包补丁模型(`cordis.patch.yml` + `dsh.bundle.patch`),运行时不 import 任何 `@deepseek-ai/*` 内部模块。
27
+ 已在官方 `@deepseek-ai/dsh@0.1.5-rc.1`、Node `24.16.0` 上验证(2026-09-11):18 个组件与 Modlens 同载,工具 schema、技能注册及离线只读调用检查通过。采用 `cordis.patch.yml` + `dsh.bundle.patch` 组合包模型。Node 要求与该版本 Harness 一致:22.19 及以上的 22.x,或 24 及以上。外部服务的实际业务操作需按各组件配置单独验证。
22
28
 
23
29
  ## 安装
24
30
 
package/lib/config.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * dsh-cite 配置解析:Crossref 请求超时与 User-Agent。
3
- *
4
- * @module dsh-cite/config
5
- */
6
1
  export interface CiteConfig {
7
2
  timeoutMs?: number;
8
3
  userAgent?: string;
@@ -11,7 +6,7 @@ export interface ResolvedCiteConfig {
11
6
  timeoutMs: number;
12
7
  userAgent: string;
13
8
  }
14
- export declare const DEFAULT_USER_AGENT = "dsh-cite/0.3.2 (DeepSeek Harness citation plugin; mailto:STARDUSTLC666@users.noreply.github.com)";
9
+ export declare const DEFAULT_USER_AGENT: string;
15
10
  export declare const CITE_TIMEOUT_ENV = "DSH_CITE_TIMEOUT_MS";
16
11
  export declare const CITE_USER_AGENT_ENV = "DSH_CITE_USER_AGENT";
17
12
  export declare function resolveConfig(config: CiteConfig | undefined | null, env?: NodeJS.ProcessEnv): ResolvedCiteConfig;
package/lib/config.js CHANGED
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * @module dsh-cite/config
5
5
  */
6
+ import { createRequire } from 'node:module';
6
7
  const DEFAULT_TIMEOUT_MS = 15000;
7
- export const DEFAULT_USER_AGENT = 'dsh-cite/0.3.2 (DeepSeek Harness citation plugin; mailto:STARDUSTLC666@users.noreply.github.com)';
8
+ const pkg = createRequire(import.meta.url)('../package.json');
9
+ export const DEFAULT_USER_AGENT = `dsh-cite/${pkg.version} (DeepSeek Harness citation plugin; mailto:STARDUSTLC666@users.noreply.github.com)`;
8
10
  export const CITE_TIMEOUT_ENV = 'DSH_CITE_TIMEOUT_MS';
9
11
  export const CITE_USER_AGENT_ENV = 'DSH_CITE_USER_AGENT';
10
12
  export function resolveConfig(config, env = process.env) {
package/lib/format.js CHANGED
@@ -245,9 +245,17 @@ export function buildBibtex(work, key) {
245
245
  const baseKey = key !== undefined && key.trim() !== '' ? sanitizeBibtexKey(key.trim()) : sanitizeBibtexKey(((first?.family || first?.name || 'author') + yearText(work) + firstWord).toLowerCase());
246
246
  const type = bibtexType(work);
247
247
  const fields = [];
248
- const authors = work.authors.map((author) => fullName(author)).join(' and ');
248
+ const authors = work.authors.map((author) => {
249
+ // BibTeX interprets an unpunctuated personal name as First Last.
250
+ // Preserve the provider's family/given boundary, including compound surnames.
251
+ if (author.name !== '')
252
+ return '{' + escapeLatex(author.name) + '}';
253
+ if (author.family !== '' && author.given !== '')
254
+ return escapeLatex(author.family) + ', ' + escapeLatex(author.given);
255
+ return '{' + escapeLatex(author.family || author.given) + '}';
256
+ }).join(' and ');
249
257
  if (authors !== '')
250
- fields.push(' author={' + escapeLatex(authors) + '}');
258
+ fields.push(' author={' + authors + '}');
251
259
  fields.push(' title={' + escapeLatex(titleOf(work)) + '}');
252
260
  if (work.containerTitle !== '')
253
261
  fields.push(type === 'article' ? ' journal={' + escapeLatex(work.containerTitle) + '}' : ' booktitle={' + escapeLatex(work.containerTitle) + '}');
package/package.json CHANGED
@@ -1,63 +1,63 @@
1
- {
2
- "name": "dsh-cite",
3
- "version": "0.3.2",
4
- "description": "DSH 参考文献工具插件:cite_lookup/cite_format/cite_bibtex/cite_check/cite_health 五工具(含自检),Crossref 元数据查询(含 DOI 精确解析与并发校验),GB/T 7714 / APA / MLA / Chicago 格式化,零运行时依赖。",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./cordis.patch.yml": "./cordis.patch.yml",
14
- "./package.json": "./package.json"
15
- },
16
- "files": [
17
- "lib",
18
- "cordis.patch.yml",
19
- "README.md",
20
- "README.en.md"
21
- ],
22
- "scripts": {
23
- "build": "tsc -p tsconfig.json",
24
- "typecheck": "tsc -p tsconfig.json --noEmit",
25
- "test": "pnpm run build && node --test \"test/*.test.mjs\"",
26
- "prepublishOnly": "pnpm run build"
27
- },
28
- "dsh": {
29
- "bundle": {
30
- "patch": "./cordis.patch.yml"
31
- }
32
- },
33
- "keywords": [
34
- "dsh",
35
- "deepseek-harness",
36
- "plugin",
37
- "citation",
38
- "crossref",
39
- "gb-t-7714",
40
- "apa",
41
- "mla",
42
- "chicago",
43
- "dsh-plugin"
44
- ],
45
- "license": "MIT",
46
- "engines": {
47
- "node": ">=22"
48
- },
49
- "devDependencies": {
50
- "@types/node": "^24.0.0",
51
- "typescript": "^5.6.0"
52
- },
53
- "repository": {
54
- "type": "git",
55
- "url": "git+https://github.com/STARDUSTLC666/dsh-cite.git"
56
- },
57
- "bugs": {
58
- "url": "https://github.com/STARDUSTLC666/dsh-cite/issues"
59
- },
60
- "homepage": "https://github.com/STARDUSTLC666/dsh-cite#readme",
61
- "author": "stardustlc",
62
- "packageManager": "pnpm@11.7.0"
63
- }
1
+ {
2
+ "name": "dsh-cite",
3
+ "version": "0.3.4",
4
+ "description": "DSH 参考文献插件:Crossref 元数据查询(DOI 精确解析)与 GB/T 7714 / APA / MLA / Chicago 格式化,含去重校验与自检。",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./cordis.patch.yml": "./cordis.patch.yml",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "lib",
18
+ "cordis.patch.yml",
19
+ "README.md",
20
+ "README.en.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.json",
24
+ "typecheck": "tsc -p tsconfig.json --noEmit",
25
+ "test": "pnpm run build && node --test \"test/*.test.mjs\"",
26
+ "prepublishOnly": "pnpm run build"
27
+ },
28
+ "dsh": {
29
+ "bundle": {
30
+ "patch": "./cordis.patch.yml"
31
+ }
32
+ },
33
+ "keywords": [
34
+ "dsh",
35
+ "deepseek-harness",
36
+ "plugin",
37
+ "citation",
38
+ "crossref",
39
+ "gb-t-7714",
40
+ "apa",
41
+ "mla",
42
+ "chicago",
43
+ "dsh-plugin"
44
+ ],
45
+ "license": "MIT",
46
+ "engines": {
47
+ "node": "^22.19.0 || >=24.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^24.0.0",
51
+ "typescript": "^5.6.0"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/STARDUSTLC666/dsh-cite.git"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/STARDUSTLC666/dsh-cite/issues"
59
+ },
60
+ "homepage": "https://github.com/STARDUSTLC666/dsh-cite#readme",
61
+ "author": "stardustlc",
62
+ "packageManager": "pnpm@11.7.0"
63
+ }