gongwen-skill 1.12.74 → 2.1.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/.dsh/skills/gongwen-skill/SKILL.md +4 -5
- package/.dsh/skills/gongwen-skill.md +4 -5
- package/CHANGELOG.md +34 -0
- package/README.md +9 -8
- package/SKILL.md +4 -5
- package/cordis.patch.yml +5 -1
- package/dsh/client.js +4 -2
- package/dsh/index.js +5 -3
- package/engine/__init__.py +1 -0
- package/engine/auto_optimizer.py +5 -0
- package/engine/chat_review.py +5 -0
- package/engine/config.py +1 -0
- package/engine/core/__init__.py +1 -0
- package/engine/core/document/__init__.py +1 -0
- package/engine/core/document/_generator_helpers.py +5 -0
- package/engine/core/document/ai_structure_analyzer.py +1 -0
- package/engine/core/document/annotator.py +5 -0
- package/engine/core/document/editor.py +6 -0
- package/engine/core/document/font_utils.py +1 -0
- package/engine/core/document/generator.py +1 -0
- package/engine/core/document/markdown_converter.py +5 -0
- package/engine/core/document/models.py +1 -0
- package/engine/core/document/modifier.py +1 -0
- package/engine/core/document/ooxml_parser.py +5 -0
- package/engine/core/document/ooxml_workflow.py +5 -0
- package/engine/core/document/parser.py +1 -0
- package/engine/core/document/parser_format.py +6 -0
- package/engine/core/document/reviewer_comments.py +5 -0
- package/engine/core/document/structure_analyzer.py +1 -0
- package/engine/core/document/tracked_annotator.py +5 -0
- package/engine/core/document/tracked_changes.py +5 -0
- package/engine/core/document/tracked_common.py +5 -0
- package/engine/core/rules/__init__.py +1 -0
- package/engine/core/rules/checker.py +1 -0
- package/engine/core/rules/engine.py +1 -0
- package/engine/core/rules/fixer.py +1 -0
- package/engine/core/rules/loader.py +1 -0
- package/engine/core/rules/manager.py +2 -1
- package/engine/docx_to_image.py +5 -0
- package/engine/fact_check.py +5 -0
- package/engine/focus_checker.py +5 -0
- package/engine/handoff.py +1 -0
- package/engine/inject.py +1 -1
- package/engine/live_edit.py +6 -1
- package/engine/optimizer.py +1 -1
- package/engine/review_generator.py +5 -0
- package/engine/structure_checker.py +5 -0
- package/engine/style_profile.py +5 -0
- package/engine/table_sign_generator.py +5 -0
- package/engine/table_sign_template.py +6 -0
- package/engine/template_builder.py +1 -0
- package/engine/utils/__init__.py +6 -0
- package/engine/utils/errors.py +5 -0
- package/engine/utils/logger.py +1 -0
- package/engine/utils/parse.py +5 -0
- package/engine/utils/zip_utils.py +5 -0
- package/etc/dsh-config-defaults.json +1 -1
- package/gongwen/__init__.py +3 -2
- package/gongwen/__main__.py +1 -0
- package/gongwen/_bootstrap.py +6 -0
- package/gongwen/_legacy.py +22 -22
- package/gongwen/cli/__init__.py +1 -0
- package/gongwen/cli/content_cmds.py +17 -11
- package/gongwen/cli/doctor_cmds.py +8 -2
- package/gongwen/cli/font_cmds.py +7 -0
- package/gongwen/cli/helpers.py +8 -1
- package/gongwen/cli/misc_cmds.py +10 -4
- package/gongwen/cli/review_cmds.py +18 -12
- package/gongwen/cli/style_helpers.py +6 -0
- package/gongwen/cli/update_cmds.py +6 -0
- package/package.json +2 -2
- package/prompts/style-prompts.md +5 -4
- package/prompts/usage-prompts.md +7 -1
- package/pyproject.toml +2 -2
- package/rules/official/_common.yaml +4 -0
- package/rules/official/announcement.yaml +4 -0
- package/rules/official/bill.yaml +13 -0
- package/rules/official/bulletin.yaml +13 -0
- package/rules/official/command.yaml +4 -0
- package/rules/official/communique.yaml +21 -0
- package/rules/official/decision.yaml +4 -0
- package/rules/official/instruction.yaml +13 -0
- package/rules/official/letter.yaml +4 -0
- package/rules/official/meeting.yaml +13 -0
- package/rules/official/minutes.yaml +13 -0
- package/rules/official/news.yaml +50 -0
- package/rules/official/notice.yaml +27 -1
- package/rules/official/notice_public.yaml +4 -0
- package/rules/official/opinion.yaml +13 -0
- package/rules/official/regulation.yaml +13 -0
- package/rules/official/reply.yaml +13 -0
- package/rules/official/report.yaml +13 -0
- package/rules/official/request.yaml +4 -0
- package/rules/official/resolution.yaml +13 -0
- package/rules/official/speech.yaml +4 -0
- package/rules/official/summary.yaml +13 -0
- package/rules/official/table_sign.yaml +4 -0
- package/rules/official/technical_proposal.yaml +4 -0
- package/rules/official/work_plan.yaml +13 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gongwen-skill
|
|
3
|
-
description:
|
|
3
|
+
description: 公文全流程处理工具。支持 .docx 公文按 GB/T 9704 国家标准做格式检查(check)、自动修复(optimize)、行内内容修订(optimize-content,红色标注+删除线+修改说明)、模板生成(template)、样式学习(style-learn,从标准文档学习排版样式生成自定义模板)、Markdown 转公文(md2docx),以及版头/版记/页码注入。覆盖通知/请示/报告/函/会议纪要等 24 类公文。完全自包含,克隆即用,无需数据库或后端服务。
|
|
4
4
|
whenToUse: 当用户需要处理中文公文(.docx格式)时,包括格式检查、自动修复、内容润色、模板生成、样式学习(从标准文档学习排版样式生成自定义模板)、Markdown转公文、版头版记注入等场景。适用于通知/请示/报告/函/会议纪要/新闻稿/讲话稿等24种公文类型。
|
|
5
5
|
user-invocable: true
|
|
6
6
|
metadata:
|
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gongwen-skill
|
|
3
|
-
description:
|
|
3
|
+
description: 公文全流程处理工具。支持 .docx 公文按 GB/T 9704 国家标准做格式检查(check)、自动修复(optimize)、行内内容修订(optimize-content,红色标注+删除线+修改说明)、模板生成(template)、样式学习(style-learn,从标准文档学习排版样式生成自定义模板)、Markdown 转公文(md2docx),以及版头/版记/页码注入。覆盖通知/请示/报告/函/会议纪要等 24 类公文。完全自包含,克隆即用,无需数据库或后端服务。
|
|
4
4
|
whenToUse: 当用户需要处理中文公文(.docx格式)时,包括格式检查、自动修复、内容润色、模板生成、样式学习(从标准文档学习排版样式生成自定义模板)、Markdown转公文、版头版记注入等场景。适用于通知/请示/报告/函/会议纪要/新闻稿/讲话稿等24种公文类型。
|
|
5
5
|
user-invocable: true
|
|
6
6
|
metadata:
|
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
https://github.com/linhut/gongwen-skill
|
|
4
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
## v2.1.0 (2026-08-20)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **格式规则完善**:为 24 种公文类型新增 30+ 条 check/fix 规则,提升规则覆盖率
|
|
11
|
+
- `news.yaml`:从 0 条规则扩展至 5 条(导语段/稿源信息/标题风格/标题字数/听取通报段检查)
|
|
12
|
+
- `notice.yaml`:新增标题格式和通知事项检查
|
|
13
|
+
- `communique.yaml`:新增公报签署和标题格式检查
|
|
14
|
+
- 12 个原只有 2 条规则的类型各新增 1 条检查规则(bill/bulletin/instruction/meeting/minutes/opinion/regulation/reply/report/resolution/summary/work_plan)
|
|
15
|
+
- **版本发布清单**:RELEASE.md 扩展版本号检查点从 4 处代码→9 处(含文档/提示词/DSH 桥接)
|
|
16
|
+
- **pre-commit hook**:`.githooks/pre-commit` 自动检查 4 处代码版本号一致性,阻止版本漂移的提交
|
|
17
|
+
- **动态 PyPI 徽章**:README.md 的 PyPI 徽章改为动态版本号(`https://img.shields.io/pypi/v/gongwen-skill`),自动显示最新版本
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- RELEASE.md 全面更新:修复 12 处残留 1.12.x 引用,更新 npm 发布状态,新增 pre-commit hook 说明
|
|
21
|
+
- 规则文件统一添加 `template_name` 和 `document_type` 字段(news.yaml 补齐)
|
|
22
|
+
|
|
23
|
+
## v2.0.0 (2026-08-20)
|
|
24
|
+
|
|
25
|
+
### Major
|
|
26
|
+
- **大版本重置**:从 1.12.x 序列重置为 **2.0.0**,清理历史版本号膨胀
|
|
27
|
+
|
|
28
|
+
### Architecture
|
|
29
|
+
- Migrate all legacy `from core.xxx` imports to `from engine.core.xxx` for proper Python packaging (files: `_legacy.py`, `content_cmds.py`, `review_cmds.py`, `helpers.py`, `misc_cmds.py`, `live_edit.py`)
|
|
30
|
+
- Remove unused `_ENGINE_DIR` import side-effect pattern in `_legacy.py`; use explicit `import gongwen._bootstrap` instead
|
|
31
|
+
|
|
32
|
+
### Performance
|
|
33
|
+
- Reduce verbose logging: change `_dedup_extend` rollup messages from `logger.info` to `logger.debug`, eliminating 50+ lines of noisy "同键覆盖" logs per command
|
|
34
|
+
|
|
1
35
|
## v1.12.74 (2026-08-20)
|
|
2
36
|
|
|
3
37
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
https://github.com/linhut/gongwen-skill
|
|
3
4
|
Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
-->
|
|
5
6
|
|
|
6
|
-
#
|
|
7
|
+
# 公文全流程处理工具
|
|
7
8
|
|
|
8
9
|
<p align="center">
|
|
9
|
-
<img src="./logo/2026-08-19_11-17-43.png" alt="
|
|
10
|
+
<img src="./logo/2026-08-19_11-17-43.png" alt="公文全流程处理工具" width="760">
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
> 中文公文全流程处理工具——基于 **GB/T 9704《党政机关公文格式》** 国家标准,支持 **格式检查与修复、内容优化(Word 原生修订+批注/差异对比版)、模板生成、Markdown 转公文、版头版记页码注入、事实核验、风格增强** 等完整能力。原生支持 **DeepSeek Harness (DSH)** 技能系统,打包为可被 AI Agent 直接调用的 Skill,完全自包含,克隆即用。
|
|
13
14
|
|
|
14
15
|
[](https://github.com/linhut/gongwen-skill/actions)
|
|
15
|
-
[](https://pypi.org/project/gongwen-skill/)
|
|
16
17
|
[](./LICENSE)
|
|
17
18
|

|
|
18
19
|

|
|
@@ -336,7 +337,7 @@ DSH 采用 **Cordis 模块化微内核架构**:技能体系基于本地文件
|
|
|
336
337
|
git clone https://github.com/linhut/gongwen-skill.git
|
|
337
338
|
cd gongwen-skill
|
|
338
339
|
pip install -r requirements.txt # 或 pip install gongwen-skill(已上 PyPI)
|
|
339
|
-
python -m gongwen --version # 检验:gongwen-skill
|
|
340
|
+
python -m gongwen --version # 检验:gongwen-skill v2.1.0
|
|
340
341
|
```
|
|
341
342
|
|
|
342
343
|
### 方式一:作为 DSH Skill 注册(基于本地文件系统)
|
|
@@ -392,7 +393,7 @@ pnpm add -w gongwen-skill
|
|
|
392
393
|
"dependencies": {
|
|
393
394
|
"@deepseek-ai/dsh-base": "...",
|
|
394
395
|
"@deepseek-ai/dsh-web-app": "...",
|
|
395
|
-
"gongwen-skill": "^1.
|
|
396
|
+
"gongwen-skill": "^2.1.0"
|
|
396
397
|
},
|
|
397
398
|
"dsh": {
|
|
398
399
|
"profile": {
|
|
@@ -447,9 +448,9 @@ dsh --profile web
|
|
|
447
448
|
| CLI 独立可执行(`python -m gongwen <命令>`) | ✅ |
|
|
448
449
|
| PyPI 上架(`pip install gongwen-skill`) | ✅ |
|
|
449
450
|
| 零外部运行时依赖(仅 python-docx/pydantic/pyyaml) | ✅ |
|
|
450
|
-
| DSH 配置化排版参数(页边距/行距/字体/默认模板版本) | ✅
|
|
451
|
+
| DSH 配置化排版参数(页边距/行距/字体/默认模板版本) | ✅ v2.1.0+ |
|
|
451
452
|
|
|
452
|
-
### DSH 插件配置化(
|
|
453
|
+
### DSH 插件配置化(v2.1.0+)
|
|
453
454
|
|
|
454
455
|
DSH 插件支持通过配置文件管理排版参数,Agent 调用时自动注入,纯 CLI 用户不受影响。
|
|
455
456
|
|
|
@@ -573,7 +574,7 @@ pip install -r requirements.txt
|
|
|
573
574
|
用户:帮我优化这份会议通知的第二章节措辞
|
|
574
575
|
|
|
575
576
|
Agent:📋 合规自检报告
|
|
576
|
-
Skill 版本:
|
|
577
|
+
Skill 版本: v2.1.0(多渠道自检已确认最新)
|
|
577
578
|
路径判定: B(内容优化)
|
|
578
579
|
依据: 用户指定了已有文档,且要求"优化措辞"
|
|
579
580
|
命令调用: 1. python -m gongwen optimize-content 会议通知.docx --changes changes.json --apply --paragraphs "5-8"
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gongwen-skill
|
|
3
|
-
description:
|
|
3
|
+
description: 公文全流程处理工具。支持 .docx 公文按 GB/T 9704 国家标准做格式检查(check)、自动修复(optimize)、行内内容修订(optimize-content,红色标注+删除线+修改说明)、模板生成(template)、样式学习(style-learn,从标准文档学习排版样式生成自定义模板)、Markdown 转公文(md2docx),以及版头/版记/页码注入。覆盖通知/请示/报告/函/会议纪要等 24 类公文。完全自包含,克隆即用,无需数据库或后端服务。
|
|
4
4
|
whenToUse: 当用户需要处理中文公文(.docx格式)时,包括格式检查、自动修复、内容润色、模板生成、样式学习(从标准文档学习排版样式生成自定义模板)、Markdown转公文、版头版记注入等场景。适用于通知/请示/报告/函/会议纪要/新闻稿/讲话稿等24种公文类型。
|
|
5
5
|
user-invocable: true
|
|
6
6
|
metadata:
|
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
2
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
|
+
|
|
5
|
+
# dsh bundle layer: 公文全流程处理工具 (gongwen-skill, host + client)
|
|
2
6
|
- insert:
|
|
3
7
|
- id: gongwen-skill
|
|
4
8
|
name: gongwen-skill
|
package/dsh/client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
1
|
+
// 公文全流程处理工具 DSH client — 可视化配置面板(gongwen-skill,不做皮肤,仅设置面板)
|
|
2
|
+
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
// https://github.com/linhut/gongwen-skill
|
|
4
|
+
// Licensed under the MIT License. See the LICENSE file for details.
|
|
3
5
|
//
|
|
4
6
|
// 在 DSH Web GUI 系统设置 → 插件配置 中渲染公文排版参数编辑界面。
|
|
5
7
|
// 通过 /plugins/gongwen-skill/api/config (GET/POST) 与宿主端通信。
|
package/dsh/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
1
|
+
// 公文全流程处理工具 - DSH plugin bridge (gongwen-skill, v2.1.0+)
|
|
2
|
+
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
// https://github.com/linhut/gongwen-skill
|
|
4
|
+
// Licensed under the MIT License. See the LICENSE file for details.
|
|
3
5
|
//
|
|
4
6
|
// 分层架构:
|
|
5
7
|
// - Python CLI:纯工具层,通过 --config-overrides 接收规则覆盖 JSON
|
|
@@ -28,7 +30,7 @@ const CONFIG_FILE = join(APP_DATA_DIR, "dsh-config.json");
|
|
|
28
30
|
const DEFAULTS_FILE = join(resolve(__dirname, ".."), "etc", "dsh-config-defaults.json");
|
|
29
31
|
|
|
30
32
|
// AI 工作指引
|
|
31
|
-
const GONGWEN_GUIDANCE =
|
|
33
|
+
const GONGWEN_GUIDANCE = `本机已安装公文全流程处理工具插件(gongwen-skill)。能力:.docx 公文全流程——列出公文类型(list-types)、解析文档(parse)、格式检查(check)、自动修复(optimize)、内容修订对比版(optimize-content)、模板生成(template)、样式学习(style-learn/style-list,从标准文档学习排版样式)、全面诊断(doctor,21 项自检)、自动修复(repair)、Markdown 转公文(md2docx)、JSON 模型生成(generate)、版头/版记/页码注入(header/footer/pagenum)、首句加粗(bold-first)、一键格式修复(fix-common)、桌签生成(table-signs)、审稿流转单(review)、完整审校(full-review)、文档审计(audit)、规则管理(rule-export/import/list)、版本自检(check-update)、会话交接(handoff)、字体管理(font)。覆盖通知/请示/报告/函/会议纪要等 24 类公文。完全自包含,克隆即用,无需数据库或后端服务。用户提到「公文 / 红头文件 / 版式 / 排版 / 格式检查 / 公文模板 / 样式学习 / 自定义模板 / 党政机关公文」时即指本插件。DSH 插件支持配置化排版参数(页边距/行距/字体等),配置文件位于 ~/.gongwen-skill/dsh-config.json,可通过 config 命令或 DSH 系统设置→插件配置管理。`;
|
|
32
34
|
|
|
33
35
|
// Web API 路由前缀
|
|
34
36
|
const API_PREFIX = "/plugins/gongwen-skill/api";
|
package/engine/__init__.py
CHANGED
package/engine/auto_optimizer.py
CHANGED
package/engine/chat_review.py
CHANGED
package/engine/config.py
CHANGED
package/engine/core/__init__.py
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
2
7
|
"""
|
|
3
8
|
Generator helper functions: table and page number field creation.
|
|
4
9
|
Extracted from generator.py (tier-2 split).
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
1
7
|
"""
|
|
2
8
|
Content revision engine for official document optimization.
|
|
3
9
|
Produces comparison documents showing original vs revised content
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Font utilities: Handle Chinese font settings correctly for Word documents.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document generator: converts DocumentModel back into a .docx file.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Pydantic data models for the intermediate document representation.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document modifier: the single source of truth for all DocumentModel mutations.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document parser: converts a .docx file into DocumentModel.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
2
7
|
"""
|
|
3
8
|
tracked 修订公共工具(P2-10 修复:消除 tracked_changes / tracked_annotator 重复代码)。
|
|
4
9
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Format checker: validates a DocumentModel against loaded rules.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule engine: orchestrates loading, checking, and fixing using the rule system.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule-based fixer: interprets YAML fix_rules and delegates to DocumentModifier.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
YAML rule file loader. Reads rule definitions from the rules/ directory.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule Manager: unified rule loading with priority layering.
|
|
@@ -130,7 +131,7 @@ def _dedup_extend(base_list: list, new_items: list, dedup_key) -> None:
|
|
|
130
131
|
if k is not None and k in existing_keys:
|
|
131
132
|
# P2-23 修复:同 field/键去重覆盖属于隐式依赖(如 speech.yaml 覆盖 _common.yaml),
|
|
132
133
|
# 覆盖发生时记录日志,避免静默覆盖导致规则丢失难以排查
|
|
133
|
-
logger.
|
|
134
|
+
logger.debug(f"_dedup_extend: 同键覆盖 {k}(新规则覆盖基础规则)")
|
|
134
135
|
# Replace existing item with same key
|
|
135
136
|
for i, existing in enumerate(base_list):
|
|
136
137
|
if dedup_key(existing) == k:
|
package/engine/docx_to_image.py
CHANGED
package/engine/fact_check.py
CHANGED
package/engine/focus_checker.py
CHANGED
package/engine/handoff.py
CHANGED
package/engine/inject.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 公文文档格式化 Skill —— 版头 / 版记 / 页码注入(独立发行版)
|
|
4
4
|
#
|
|
5
5
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
6
|
-
#
|
|
6
|
+
# https://github.com/linhut/gongwen-skill
|
|
7
7
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
8
8
|
#
|
|
9
9
|
# 本模块从原项目 backend/api/routes/optimize.py 中抽取版头/版记/页码
|
package/engine/live_edit.py
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
2
7
|
"""
|
|
3
8
|
LiveEdit —— 内存级 DocumentModel 编辑会话。
|
|
4
9
|
|
|
@@ -28,7 +33,7 @@ from datetime import datetime
|
|
|
28
33
|
from pathlib import Path
|
|
29
34
|
from typing import List
|
|
30
35
|
|
|
31
|
-
# ARCH-03 修复:engine/ 自身就是搜索路径根,模块内 from core... import 已生效
|
|
36
|
+
# ARCH-03 修复:engine/ 自身就是搜索路径根,模块内 from engine.core... import 已生效
|
|
32
37
|
# 不再需要 sys.path.insert(engine/ 已通过 _bootstrap 或 __init__.py 正确注册)
|
|
33
38
|
|
|
34
39
|
|
package/engine/optimizer.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 公文文档格式化 Skill —— 内容优化差异对比引擎
|
|
4
4
|
#
|
|
5
5
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
6
|
-
#
|
|
6
|
+
# https://github.com/linhut/gongwen-skill
|
|
7
7
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
8
8
|
#
|
|
9
9
|
# 功能:将原文段落与优化后段落进行句子级 diff,生成带标注的 .docx 文档。
|
package/engine/style_profile.py
CHANGED