fix: 内置 Office 技能离线资源与中文校验 / offline Office schemas and XML validation (#218)

## 中文

内网环境显式使用 Office skill 校验含 `docProps/core.xml` 的文件时,Schema 仍引用远程 Dublin
Core XSD;Windows 默认 GBK 读取中文 UTF-8 XML 也会报错。本修改让 docx/pptx/xlsx 独立携带完整本地
Schema 闭包,并按 XML 编码声明读取文件,保留完整校验。

- 三个 Office skill 分别随包加入 Dublin Core 三份 XSD,复用本地
xml.xsd,补齐来源、原始摘要、许可与适配说明。
- 修正两个 Microsoft XSD 的 ST_String 类型引用,以及 presentation-forge 编辑器脚本路径。
- 市场版本 1.5.11;docx 1.0.4、pptx 1.0.5、xlsx 1.0.4、presentation-forge
0.1.1,同步目录元数据。
- 新增定向回归:遍历所有内置技能的 XSD,拒绝远程依赖并离线编译;模拟 GBK 校验中文 XML,确认非法 Word 节点仍被拒绝。

验证:126 份 XSD 离线编译、2 项回归通过;i18n/catalog 校验均为 0 errors / 105 既有
warnings;translate --check 与 git diff --check 通过。README
两种语言同步。工作树、路径、Git 元数据与发布正文隐私检查通过。

Windows x64 dev 10.0.181 已通过产品 prepare-static 准备随包依赖,并真实调用
Skill(docx):创建、全校验、解包编辑、重新打包、再全校验均退出 0,两次校验各 18 valid / 0 skipped / 0
errors。该实验禁用 pip/npm 依赖索引,保留模型连接;不等同于正式包或全机断网验收。辅助 Grep
有一次旧参数错误,改正后成功;Python 缓存污染安装摘要另列真机测试跟踪。主仓 market.zip 尚未刷新,源 PR 合并后需通过
sync-market 纳入产品。

## English

Office validation in an intranet deployment still depended on remote
Dublin Core schemas, and reading Chinese UTF-8 XML with the Windows GBK
default could fail. Each Office skill now includes its local schema
dependency closure, and validators read XML as bytes so its declared
encoding is respected without weakening validation.

This also fixes two Microsoft schema type references and the
presentation-forge editor script path. Market version becomes 1.5.11;
skill versions become docx 1.0.4, pptx 1.0.5, xlsx 1.0.4 and
presentation-forge 0.1.1. Vendored schemas include attribution,
licensing, original hashes and adaptation notes.

Validation: 126 schemas compile offline; both targeted regression tests
pass, including GBK input and invalid-node rejection. Catalog/i18n
checks pass with 105 existing warnings each; translation freshness and
whitespace checks pass. Bilingual README and publication privacy checks
are complete.

The actual Windows x64 dev session passed explicit docx loading,
creation, full validation, editing, repacking and revalidation using
product-prepared dependencies. Dependency indexes were disabled while
model connectivity remained available. Packaged/cross-platform testing
and the observed Python-cache installation-digest drift remain
follow-ups. The product bootstrap ZIP will require sync-market after
this source PR merges.

真机测试与剩余验收 / Hardware testing and remaining acceptance:
https://github.com/desirecore/desirecore/issues/4819

---------

Co-authored-by: Johnson <yeslee1126@gmail.com>
This commit is contained in:
2026-10-16 00:06:24 +08:00
committed by GitHub
parent e8fb262399
commit f7f4fcd035
39 changed files with 1846 additions and 44 deletions

View File

@@ -14,7 +14,7 @@ description: >-
PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document
generation. Use when 用户提到 Word文档、docx、创建文档、编辑文档、报告、
备忘录、公文、合同、信函模板。
version: 1.0.3
version: 1.0.4
type: procedural
risk_level: low
status: enabled
@@ -26,7 +26,7 @@ tags:
- office
metadata:
author: anthropic
updated_at: '2026-06-02'
updated_at: '2026-10-14'
i18n:
default_locale: en-US
source_locale: zh-CN