gongwen-skill 2.14.0 → 2.15.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 +15 -0
- package/dsh/index.js +1 -1
- package/gongwen/__init__.py +1 -1
- package/gongwen/_legacy.py +1 -1
- package/gongwen/cli/doctor_cmds.py +34 -7
- package/package.json +9 -3
- package/prompts/usage-prompts.md +1 -1
- package/pyproject.toml +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
Licensed under the MIT License. See the LICENSE file for details.
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
|
+
## v2.15.0 (2026-10-01)
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **npm peer 依赖在 DSH 0.2.0-rc.2 宿主上安装失败(P1,GitHub issue #2「0.2.0 rc-2装上就报错」)**:DSH 宿主升级到 0.2.0-rc.2 线后,其捆绑的 `@deepseek-ai/dsh-tools@0.2.0-rc.2` 与 `@deepseek-ai/dsh-client-ui-settings-plugins@0.2.0-rc.2` 均不满足 v2.14.0 声明的 peer 范围(`>=0.1.5-rc.3` / `>=0.1.2-rc.1`)。根因是 node-semver 的预发布逐线放行规则:范围里带预发布版本(如 `0.1.5-rc.3`)的比较器,只允许**相同 [major,minor,patch] 元组**的预发布版本参与匹配,0.2.0 线因此整体不可达 → pnpm 解析 peer 报 `ERR_PNPM_NO_MATCHING_VERSION`(与 issue #1 同根,属宿主升线后的复发性问题)
|
|
11
|
+
- `@deepseek-ai/dsh-tools` peer 改为多线锚定:`>=0.1.2-alpha.1 || >=0.1.5-alpha.1 || >=0.1.7-alpha.1 || >=0.2.0-0`(实测覆盖 0.1.2/0.1.5/0.1.7/0.2.0 全部已发布预发布线,与 npm 全部 30 个已发布版本匹配 16 个关键线)
|
|
12
|
+
- `@deepseek-ai/dsh-client-ui-settings-plugins` peer 改为:`>=0.1.2-rc.1 || >=0.1.5-rc.1 || >=0.2.0-0`
|
|
13
|
+
- **新增 `peerDependenciesMeta` 将 4 个 `@deepseek-ai/*` peer 全部标为 `optional: true`**:DSH 桌面端市场安装后这些宿主单例原就会被移除、运行时统一走宿主共享副本(issue #1 已核实的安装模型),optional 化后安装期不再因 peer 版本线漂移失败,未来宿主再升线也不受影响;运行时 import 仍解析到宿主提供的副本(版本由宿主保证)
|
|
14
|
+
- `doctor`(O2 peer 检查)版本解析升级:`_parse_version_tuple` 支持 `-alpha.N` / `-0` 预发布标记,新增 `_peer_branch_minima` 按 `||` OR 分支保守判定(安装版本 ≥ 任一分支下限即满足),避免对多线范围误报
|
|
15
|
+
- **doctor O1 宿主版本检查兼容 0.2.0 线**:`_parse_version_tuple` 预发布段由仅识别 `-rc.N` 扩展为通用 `-<tag>N`(rc/alpha/裸数字),0.2.0-rc.2 正确判定 ≥ 0.1.2-rc.1,不再误报
|
|
16
|
+
|
|
17
|
+
### Notes
|
|
18
|
+
- 本版为 DSH 插件安装兼容性修复,CLI 功能无变化;纯 CLI 用户不受影响
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
7
22
|
## v2.14.0 (2026-09-26)
|
|
8
23
|
|
|
9
24
|
### Added
|
package/dsh/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// 公文全流程处理专家 - DSH plugin bridge (gongwen-skill, v2.
|
|
1
|
+
// 公文全流程处理专家 - DSH plugin bridge (gongwen-skill, v2.15.0+)
|
|
2
2
|
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
3
|
// https://github.com/linhut/gongwen-skill
|
|
4
4
|
// Licensed under the MIT License. See the LICENSE file for details.
|
package/gongwen/__init__.py
CHANGED
package/gongwen/_legacy.py
CHANGED
|
@@ -16,7 +16,7 @@ from gongwen.cli.helpers import (
|
|
|
16
16
|
parse_config_overrides as _parse_config_overrides,
|
|
17
17
|
load_rules_with_overrides as _load_rules_with_overrides,
|
|
18
18
|
)
|
|
19
|
-
__version__ = "2.
|
|
19
|
+
__version__ = "2.15.0"
|
|
20
20
|
# 版本号应与 gongwen/__init__.py 保持一致,每次发版同步更新
|
|
21
21
|
"""
|
|
22
22
|
中文公文全流程处理专家 —— 基于 GB/T 9704《党政机关公文格式》国家标准。
|
|
@@ -717,17 +717,42 @@ def _check_display_name_consistency() -> dict:
|
|
|
717
717
|
|
|
718
718
|
|
|
719
719
|
def _parse_version_tuple(v: str):
|
|
720
|
-
"""解析 1.2.3 / 4 / 3.18.0 / 0.1.2-rc.1
|
|
720
|
+
"""解析 1.2.3 / 4 / 3.18.0 / 0.1.2-rc.1 / 0.1.2-alpha.1 / 0.1.2-0 → 可比较元组。
|
|
721
721
|
|
|
722
|
-
rc.N 预发布 <
|
|
722
|
+
rc.N / alpha.N / 预发布 0 < 同版本正式版(预发布取末尾数字段,正式版取 inf)。
|
|
723
723
|
无法解析返回 None(调用方按不满足处理,保守)。
|
|
724
724
|
"""
|
|
725
725
|
import re as _re
|
|
726
|
-
m = _re.match(r"^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-
|
|
726
|
+
m = _re.match(r"^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z.]+))?$", v.strip())
|
|
727
727
|
if not m:
|
|
728
728
|
return None
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
major, minor, patch = int(m.group(1)), int(m.group(2) or 0), int(m.group(3) or 0)
|
|
730
|
+
pre = m.group(4)
|
|
731
|
+
if pre is None:
|
|
732
|
+
return (major, minor, patch, float("inf"))
|
|
733
|
+
# 预发布取末尾数字段近似(rc.1→1、alpha.1→1、0→0、裸 rc→0),
|
|
734
|
+
# 仅用于 doctor 下限比较,不追求与 node-semver 逐线规则完全一致
|
|
735
|
+
seg = pre.split(".")[-1]
|
|
736
|
+
n = int(seg) if seg.isdigit() else 0
|
|
737
|
+
return (major, minor, patch, n)
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
def _peer_branch_minima(range_str: str) -> list:
|
|
741
|
+
"""把 peer 范围(可能含 `||` OR 多线)拆成各分支版本下限元组列表。
|
|
742
|
+
|
|
743
|
+
背景:DSH 宿主按 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 等预发布线迭代,
|
|
744
|
+
peer 范围需多线锚定(npm semver 预发布逐线放行),doctor 据此做保守检查:
|
|
745
|
+
安装版本 ≥ 任一分支下限即视为满足(比 node-semver 略宽松,宁可少报)。
|
|
746
|
+
"""
|
|
747
|
+
out = []
|
|
748
|
+
for branch in (range_str or "").split("||"):
|
|
749
|
+
b = branch.strip().lstrip(">=").strip()
|
|
750
|
+
if not b:
|
|
751
|
+
continue
|
|
752
|
+
t = _parse_version_tuple(b)
|
|
753
|
+
if t is not None:
|
|
754
|
+
out.append(t)
|
|
755
|
+
return out
|
|
731
756
|
|
|
732
757
|
|
|
733
758
|
def _dsh_profiles() -> list:
|
|
@@ -828,7 +853,7 @@ def _check_dsh_peer_deps() -> dict:
|
|
|
828
853
|
problems = []
|
|
829
854
|
checked = 0
|
|
830
855
|
for peer, minimum in peers.items():
|
|
831
|
-
|
|
856
|
+
branch_mins = _peer_branch_minima(minimum)
|
|
832
857
|
installed = []
|
|
833
858
|
for nm in nm_dirs:
|
|
834
859
|
pkg = nm / peer / "package.json"
|
|
@@ -844,7 +869,9 @@ def _check_dsh_peer_deps() -> dict:
|
|
|
844
869
|
checked += 1
|
|
845
870
|
for profile, ver in installed:
|
|
846
871
|
key = _parse_version_tuple(ver)
|
|
847
|
-
|
|
872
|
+
# 满足 = 不低于任一分支下限(多线 OR 保守判定)
|
|
873
|
+
ok = key is not None and any(key >= mn for mn in branch_mins)
|
|
874
|
+
if not ok:
|
|
848
875
|
problems.append(f"{peer}: {profile}={ver or '未知'}(要求 {minimum})")
|
|
849
876
|
if problems:
|
|
850
877
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gongwen-skill",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "公文全流程处理专家 - GB/T 9704 格式检查/修复/内容优化/模板生成/版式注入",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dsh/index.js",
|
|
@@ -46,9 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@deepseek-ai/cordis": ">=4",
|
|
49
|
-
"@deepseek-ai/dsh-tools": ">=0.1.5-
|
|
49
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-alpha.1 || >=0.1.5-alpha.1 || >=0.1.7-alpha.1 || >=0.2.0-0",
|
|
50
50
|
"@deepseek-ai/schemastery": ">=3.18.0",
|
|
51
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.2-rc.1"
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.2-rc.1 || >=0.1.5-rc.1 || >=0.2.0-0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@deepseek-ai/cordis": { "optional": true },
|
|
55
|
+
"@deepseek-ai/dsh-tools": { "optional": true },
|
|
56
|
+
"@deepseek-ai/schemastery": { "optional": true },
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": { "optional": true }
|
|
52
58
|
},
|
|
53
59
|
"scripts": {
|
|
54
60
|
"prepack": "node scripts/clean-cache.js",
|
package/prompts/usage-prompts.md
CHANGED
package/pyproject.toml
CHANGED