Introduction¶
DeepSeek Harness (DSH) is a development framework based on a plugin architecture. When installing plugins with dsh plugin add in offline environments, pnpm usually fails directly because it must access the network to resolve the npm registry. dsh-plugin-offline-packager solves this pain point: on an online machine, it completes dependency resolution, build, and packaging, generates a self-contained offline installer package, and provides it for use in offline environments. It also supports uploading the packaged result to the dsh-admin plugin marketplace for distribution in offline environments.
Core Features¶
The plugin provides the following capabilities:
- Packaging via conversation: Registers the
offline-packtool, which can be invoked via natural language in the DSH Web UI without memorizing commands. - Three plugin sources: Supports npm package names (such as
@deepseek-ai/dsh-base), GitHub repositories (with branch specification), and local paths. - Self-contained offline package: Uses the
bundleDependenciesmechanism to carry the complete production dependency closure inside the tarball, so offline installation does not require registry access. - Intelligent peerDependencies exclusion: Peer dependencies provided by the DSH host are not included in the offline package, avoiding duplication with the host instance or type incompatibility.
- Automatic build: For GitHub and local sources, the plugin automatically installs dependencies and runs
prepare/build, and build artifacts are included directly in the package. - Offline metadata: Generates a
.meta.jsonfile recording the package name, source, packaging time, DSH version, packager version, and bundled dependency list for auditing. - Built-in installation guidance: For pnpm ≥ 11 supply chain policy issues, includes automatically generated offline installation resolution commands.
- Zero self-dependencies: The plugin itself is bundled as a single file with esbuild, and its installation does not depend on any runtime.
- Compatibility: Built with
@deepseek-ai/dsh-tools@0.1.6-alpha.2and@deepseek-ai/cordis@^4.0.2, compatible with DSH 0.1.6-alpha.2.
Installation and Enablement¶
The following prerequisites are required to install this plugin:
* DeepSeek Harness (DSH) is installed, with versions validated on 0.1.5-alpha.1 / 0.1.5-alpha.2 / 0.1.6-alpha.2.
* Node.js >= 22, npm, and pnpm available on the system (dsh plugin depends on it to forward).
* git is required when packaging from a GitHub source.
Run the following commands to install:
# 1. 进入项目目录
cd dsh-plugin-offline-packager
# 2. 安装依赖并构建
npm install
# 3. 安装到 DSH profile(以 web profile 为例)
dsh plugin --profile web add .
After installation, restart DSH. Verify the installation:
dsh --profile web --dump-config | grep offline-packager
Typical Usage¶
Via AI Conversation¶
Directly enter natural language instructions in the DSH Web UI:
请将 @deepseek-ai/dsh-base 打包为离线安装包
AI will invoke the offline-pack tool and return the generated file path and the offline installation command.
Via Command Line¶
Install the generated offline package:
dsh plugin --profile web add ./deepseek-ai-dsh-base-0.1.5-alpha.2.tgz
How It Works¶
- Source retrieval: Places the plugin source into a temporary staging directory based on the source (npm, GitHub, or local path).
- Dependencies and build: Installs dependencies and runs build scripts (
prepare/build) inside the staging directory. - Packaging: Installs production dependencies (excluding peer dependencies), writes the actual installed top-level dependencies into
bundleDependencies, then runsnpm pack --ignore-scriptsto pack. - Metadata: Generates a
.meta.jsonfile containing version, source, and other information.
Scenarios and Caveats¶
- Packaging requires network access: The installation side is offline, but the packaging process still needs access to the npm registry or GitHub.
- Platform consistency: Plugins with native binary dependencies must be packaged on the same platform (OS/arch) as the target offline machine; otherwise, cross-platform
optionalDependenciesmay be unavailable. - peerDependencies: The plugin’s peerDependencies are not packaged into the offline package; the target machine must already have the corresponding DSH host framework.
- Local path limitations: Packaging from a local path does not guarantee success for all projects and may fail due to build errors.
- pnpm ≥ 11 configuration: If the target machine uses pnpm ≥ 11, the
minimumReleaseAgepolicy is enabled by default, and offline installation may fail because metadata cannot be fetched. SetminimumReleaseAge: 0inpnpm-workspace.yaml, or append--config.minimum-release-age=0to the installation command. - Windows path limitations: On Windows, the full path containing the
.tgzfile must not include spaces; otherwise,dsh plugin addreports anENOENTerror.
Summary¶
This plugin resolves the difficulty of installing DSH plugins directly in offline environments by pre-resolving dependencies and performing builds in an online environment. Developers can generate self-contained .tgz packages that, combined with built-in metadata and installation guidance, enable secure and stable plugin deployment in network-restricted environments.