Office skills in every deployment with one Office Kit package
Office 技能在所有部署中可用,由单一 Office Kit 包提供 Kit
Office skills were mounted only by Desktop and the Python SDK, so ordinary `dsh web` users could not create or inspect Office documents with the same guidance. Each deployment located LibreOffice Kit differently: the conversion provider, the skills, and the Desktop shell each held their own lookup, and an absent Kit made the conversion row fail to load. A Python SDK executable without its downloaded Office sidecar, o
English
Problem
Office skills were mounted only by Desktop and the Python SDK, so ordinary dsh web users could not create or inspect Office documents with the same guidance. Each deployment located LibreOffice Kit differently: the conversion provider, the skills, and the Desktop shell each held their own lookup, and an absent Kit made the conversion row fail to load. A Python SDK executable without its downloaded Office sidecar, or a source checkout without native engines, is a deployment that lacks Kit, not a misconfigured composition; failing the row hid the provider and the skills even though most of their behavior did not need Kit.
Decision
The Web bundle and the SDK bundle mount skill-office in Desktop, ordinary dsh web, and the SDK. This supersedes the mounting decision of progressive Office skills; its skill structure remains current, and the on-demand Office tools replace its shell execution.
Every deployment reads the Office skills from the skill-office package's assets/, which hold only SKILL.md files. The Host reads them with ordinary file reads: Desktop's Electron Host reads them inside app.asar, and the SDK executable embeds them, so no carrier copies the skills to a separate resource directory. A composition selects another directory through assetRoot, or overrides individual skills with same-name filesystem skills.
The bundled Python environment (tool-workspace-dependencies) mounts only in Desktop and in the SDK when a primary runtime is available. skill-office declares pythonEnvironment: 'workspace-dependencies' | 'user' explicitly; each bundle row selects the value for its deployment. The default is 'workspace-dependencies' because older SDK patches replace the complete config of the skill-office row; such a patch omits the new key and keeps the bundled-environment instructions it was written for.
@deepseek-ai/dsh-office-kit owns Kit location and the shared conversion service. Kit location is an internal implementation of the provider and is not exported: the provider passes its own import.meta.resolve lookup, and native engine paths use ASAR-unpacked mapping. Location reads no environment variables. The on-demand Office tools run Kit operations inside the Host, so no deployment publishes Kit CLI paths or Office executable variables.
An absent Kit degrades instead of failing a load. The conversion service registers and rejects conversions with code unavailable, retaining only a successful Kit import and reporting each distinct failure once; the document_render, document_convert, and document_recalculate tools stay registered and return that message when called.
office-to-pdf became office-kit so that later Kit consumers, such as native rendering (PR #5374) and the tool-document package, take Kit from one package. LibreOffice Kit dependencies declare one exact version in every manifest, so the converter and packaged engine come from the same Kit release.
Alternatives considered
Keep Office skills out of ordinary Web. This keeps ordinary Web free of Office guidance it might not execute, but leaves Web users without document authoring that needs only Python libraries. Skills now direct the model to the user's Python when no bundled environment exists.
Default pythonEnvironment to 'user'. This matches ordinary Web, but an older SDK patch that replaces the row's config would silently switch Desktop-like SDK deployments to the user's Python.
Read deployment environment variables inside the locator. This removes the cordis.yml expressions, but hides deployment configuration inside a library and makes source, Web, Desktop, and SDK behavior depend on ambient variables. Bundles already own deployment-specific expressions.
Fail the conversion row when Kit is absent. This reports the absence at load, which the misconfiguration rule prefers, but the absence belongs to the deployment rather than the configuration, and it disables preview rendering paths and dependent skills that do not need Kit.
Keep a separate locator package. A package without Cordis dependencies isolates skill-office from the service, but duplicates release, dependency-policy, and documentation configuration for one closely coupled component. No consumer outside the provider needs to locate Kit, so the location logic stays inside the provider.
Consequences
Ordinary Web and SDK sessions without a bundled environment list the four Office skills, which adds their summaries to the first context. Deployments without Kit see unavailable previews and office_* tools that report the missing Kit instead of failing at startup; skill loading does not check for Kit; a later Kit installation takes effect for conversion without reloading the provider. External compositions migrate from the office-to-pdf row, ctx.officeToPdf, and the officeToPdf/* Remote methods to the office-kit package through the upgrade guide.
Processes launched from the Desktop built-in terminal inherit DSH_PRIMARY_RUNTIME, so the SDK uses its bundled environment. The shell publishes no Kit location; child applications resolve their own Kit.
Verification covers Kit lookup from the provider's Kit entry (kit-lookup.spec.ts), engine resolution and ASAR-unpacked path mapping (engine-package.spec.ts), independent engine resolution per Kit installation (anchors.spec.ts), conversion retry after a missing or unloadable Kit, deduplicated warnings, the office_* tools' unavailable results with an absent Kit, recorded Web and SDK sessions that list the Office skills, and Office profile end-to-end tests.
中文
问题
原先只有 Desktop 和 Python SDK 挂载 Office 技能,普通 dsh web 用户无法借助同样的指导创建或检查 Office 文档。各部署定位 LibreOffice Kit 的方式也不同:转换提供方、技能和 Desktop 壳各自查找 Kit,Kit 缺失时转换配置行加载失败。没有下载 Office sidecar 的 Python SDK 可执行程序、没有原生引擎的源码检出,都属于部署缺少 Kit,而不是组合配置错误;让配置行失败会隐藏提供方和技能,而它们的大部分行为并不需要 Kit。
决策
Web bundle 和 SDK bundle 在 Desktop、普通 dsh web 和 SDK 中都挂载 skill-office。这取代了渐进式 Office 技能中的挂载决策;其技能结构仍然有效,按需激活的 Office 工具取代了其 shell 执行方式。
所有部署都从 skill-office 包的 assets/ 读取 Office 技能,该目录只包含 SKILL.md 文件。Host 直接读取这些文件:Desktop 的 Electron Host 在 app.asar 内读取,SDK 可执行程序则内嵌这些文件,因此没有载体把技能复制到单独的资源目录。组合可以通过 assetRoot 选择其他目录,或用同名文件系统技能覆盖单个技能。
内置 Python 环境(tool-workspace-dependencies)只在 Desktop 以及有主运行时的 SDK 中挂载。skill-office 显式声明 pythonEnvironment: 'workspace-dependencies' | 'user',由各 bundle 的配置行按部署选择取值。默认值为 'workspace-dependencies',因为旧 SDK patch 会整体替换 skill-office 行的 config;这样的 patch 不含新键,仍保留它所针对的内置环境说明。
@deepseek-ai/dsh-office-kit 负责 Kit 定位和共享转换服务。Kit 定位是提供方的内部实现,不对外导出:提供方传入自己的 import.meta.resolve 查找函数,原生引擎路径使用 ASAR 解包映射。定位不读取环境变量。按需激活的 Office 工具在 Host 内执行 Kit 操作,因此任何部署都不发布 Kit CLI 路径或 Office 可执行文件变量。
Kit 缺失时降级,而不是加载失败。转换服务照常注册,以代码 unavailable 拒绝转换,只保留成功的 Kit 导入,并对每种不同的失败只报告一次;document_render、document_convert 和 document_recalculate 工具保持注册并在调用时返回该消息。
office-to-pdf 改为 office-kit,使后续的 Kit 消费方(例如原生渲染(PR #5374)和 tool-document 包)从同一个包获取 Kit。LibreOffice Kit 依赖在每个清单中声明同一个精确版本,因此转换器和打包的引擎来自同一个 Kit 发行版。
考虑过的替代方案
普通 Web 继续不挂载 Office 技能。 这样普通 Web 不会出现它可能无法执行的 Office 指导,但 Web 用户也无法使用只需要 Python 库的文档创作。现在没有内置环境时,技能会引导模型使用用户的 Python。
pythonEnvironment 默认取 'user'。 这与普通 Web 一致,但整体替换该行 config 的旧 SDK patch 会让类似 Desktop 的 SDK 部署悄然改用用户的 Python。
在定位函数中读取部署环境变量。 这样可以去掉 cordis.yml 表达式,但会把部署配置藏进库中,使源码、Web、Desktop 和 SDK 的行为依赖环境变量。bundle 本来就负责部署专有的表达式。
Kit 缺失时让转换配置行失败。 这样能在加载时报告缺失,符合配置错误应尽早报告的规则;但缺失属于部署环境而非配置,而且会停用不需要 Kit 的预览渲染路径和依赖技能。
保留独立的定位包。 没有 Cordis 依赖的独立包可以让 skill-office 与服务隔离,但要为一个紧密耦合的组件重复维护发布、依赖策略和文档配置。提供方以外没有消费方需要定位 Kit,因此定位逻辑留在提供方内部。
影响
没有内置环境的普通 Web 和 SDK 会话会列出四个 Office 技能,首个上下文因此增加它们的摘要。没有 Kit 的部署看到的是 unavailable 预览和报告 Kit 缺失的 office_* 工具,而不是启动失败;加载技能时不检查 Kit;之后安装的 Kit 无需重新加载提供方即可用于转换。外部组合按升级指南从 office-to-pdf 配置行、ctx.officeToPdf 和 officeToPdf/* Remote 方法迁移到 office-kit 包。
从 Desktop 内置终端启动的进程会继承 DSH_PRIMARY_RUNTIME,因此 SDK 使用其内置环境。Desktop 壳不发布 Kit 位置;子应用自行解析自己的 Kit。
验证覆盖从提供方 Kit 入口查找 Kit(kit-lookup.spec.ts)、引擎解析与 ASAR 解包路径映射(engine-package.spec.ts)、按 Kit 安装独立解析引擎(anchors.spec.ts)、Kit 缺失或无法加载后的转换重试、去重后的警告、Kit 缺失时 office_* 工具的 unavailable 结果、列出 Office 技能的录制 Web 与 SDK 会话,以及 Office profile 端到端测试。