Introduction

DeepSeek Harness (DSH) supports a plugin-based architecture, which means we can extend agent capabilities through plugins. When building agents that involve version management, large models often make mistakes when handling Semantic Versioning (SemVer). For example, questions such as “Is 2.1.0-rc.1 newer than 2.1.0-beta.11?” and “Does 1.2.4-beta.1 satisfy ^1.2.3?” often cannot be answered reliably by LLMs, especially when dealing with details such as prerelease version ordering and caret/tilde boundary rules.

To address this problem, we need to convert version logic into deterministic tool calls. The following section introduces the dsh-semver plugin, which is specifically designed to solve these problems.

Core Features

dsh-semver provides a set of pure logic tools that do not depend on any runtime environment and run completely offline. Its core capabilities include:

  1. Parsing and Comparison: Decompose SemVer strings into fields such as major/minor/patch, and perform strict regex and numeric validation.
  2. Range Validation: Check whether a version matches npm-compatible range syntax (such as ^1.2.3), and support specific matching rules for prerelease versions (tuple-lock).
  3. Version Incrementing: Increment version numbers according to npm’s SemVer rules, supporting major, minor, patch, and various pre* types, with the ability to specify prerelease identifiers.
  4. Difference Calculation: Calculate the difference type between two versions (such as major, minor, prerelease).
  5. Sorting and Lookup: Sort version lists in ascending or descending order, and find the minimum version that satisfies a given range.

Installation and Activation

DSH plugins do not have a default profile, so a profile must be specified during installation. First, confirm your environment configuration (for example, the web profile), then run the following command:

dsh plugin --profile web add github:TYEclipse/dsh-semver

After installation, you can verify that the plugin has been loaded successfully with the following command:

dsh --profile web --dump-config | grep '== dsh-semver'

Typical Usage

After installation, you can invoke the following tools in a DSH context:

# 解析版本字符串
semver_parse("2.1.0-rc.1+build.42")

# 比较两个版本
semver_compare("2.1.0", "2.0.3")

# 检查版本是否满足范围(注意预发布版本通常不满足纯范围)
semver_satisfies("1.2.4-beta.1", "^1.2.3")

# 递增版本号
semver_inc("1.2.4-beta.0", "prerelease", "beta")

# 递增主版本并指定标识符
semver_inc("1.2.3", "preminor", "rc")

# 计算版本差异
semver_diff("1.2.3", "2.0.0-beta.1")

# 对版本列表排序
semver_sort(["1.2.3", "1.2.10", "1.0.0"], "desc")

# 查找满足范围的最小版本
semver_min_version(">=1.2.0 <2.0.0")

# 检查两个范围是否有交集
semver_intersects("^1.2.3", ">=1.3.0 <1.5.0")

Use Cases and Notes

  • Use Cases: When an agent needs to handle dependency management, release process automation, or version negotiation logic, this plugin can provide stable and accurate computation results.
  • Pure Logic and Offline: All tools are pure functions with no network, filesystem, or Shell dependencies, making them suitable for security-constrained or no-network environments.
  • Syntax Compatibility: Fully supports npm range syntax (including ^, ~, ||, x-ranges, etc.).
  • Security Notice: The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to review the source code and license (MIT) to ensure it meets your security requirements.

Summary

dsh-semver provides a reliable versioning layer for the DeepSeek Harness ecosystem. By converting vague LLM reasoning into precise tool invocations, it addresses common pitfalls in version arithmetic.

For more details, test cases, or source code discussion, visit:
* SkillHub Plugin Directory
* GitHub Repository