Files
deepseek-harness/packages/document/office-engine-resolver
yudshj ee06bf3f9b fix(office): 升级 LibreOffice Kit 到 0.2.3,Kit CLI 定位失败时隔离并保留技能
- 将 Kit 引擎包解析提取为 office-engine-resolver,并与 master 的发布配置对齐
- LibreOffice Kit 升级到 0.2.3 正式版
- Desktop 的 Office CLI 改由 skill-office 解析 Kit,去掉 desktop-host 对 Kit 的依赖
- Kit 缺失时给出可操作错误;Office CLI 定位失败时隔离错误并保留 Office 技能
- 按 Kit 0.2.3 的 helper 授予 macOS JIT 权限,并按新 Host 签名转发夹具参数
2026-11-04 18:17:57 +08:00
..

description, kind
description kind
Resolve LibreOffice Kit engine manifests from the consumer's installation, including native ASAR paths. package-library

@deepseek-ai/dsh-office-engine-resolver

English | 中文

Summary

Resolve engine packages for the LibreOffice Kit installation your application actually uses. Native engines inside an ASAR archive resolve to their adjacent unpacked paths; WASM retains its logical path. The Office-to-PDF provider uses this callback without installing module hooks or loading Electron.

Table of Contents


Use this package

Use this library as a dependency of a Node consumer that supplies Kit's resolveEnginePackage option. The consumer owns its Kit dependency; this package does not depend on Kit and has no cordis.yml configuration.

import { createEnginePackageResolver } from '@deepseek-ai/dsh-office-engine-resolver'

const options = {
  resolveEnginePackage: createEnginePackageResolver(import.meta.resolve('@deepseek-ai/libreoffice-kit')),
}

Pass options to Kit's createConverter or discoverRuntime, or as options in the editor's openDocument request. Resolve the Kit entry in the consuming module: anchoring at this library could select a different installation. The factory also accepts an absolute entry path or a file URL; each callback retains its own resolver.

A successful callback returns an absolute engine package.json path. An absent package preserves Node's original MODULE_NOT_FOUND, allowing Kit's native-to-WASM fallback. If a package directory exists, including a dangling symlink, but its manifest cannot resolve, the callback throws an incomplete-installation error with the Node error as cause; reinstall that package. Other resolution and filesystem inspection errors propagate unchanged. Kit owns validation of the returned manifest and required assets.


Understand the implementation

Implementation internals — click to expand

The factory creates a Node resolver from the supplied Kit entry and resolves engine manifests relative to it. Native paths replace only the first .asar archive segment with .asar.unpacked, regardless of whether the process runs in Electron. Already-unpacked paths and paths outside an archive remain unchanged. @deepseek-ai/libreoffice-kit-wasm always keeps Node's logical path for archive-aware filesystem access.

The callback only resolves paths and inspects failed installations. It does not load engine code, register services, mutate module resolution, or retain module-level state. Desktop packaging owns the unpacked files.


Further Exploration


Model Experience

None, as this package resolves engine manifests without constructing model input or registering tools.

KV Cache effect

None; resolution does not construct or modify model requests.

Known Limitations and Deferred Work

  • The caller must supply the entry of the Kit installation it uses; the resolver does not discover or install Kit or engines.
  • Mapping a native path does not verify that the unpacked copy exists. Kit rejects missing manifests or assets instead of treating them as an absent native package.

Dev Note

Working context for maintainers — click to expand

None.