In the DSH plugin ecosystem, handling version-number logic is a common requirement. Developers often need to compare version order or check whether a version satisfies a specified version range within Agent workflows. The dsh-semver plugin encapsulates semantic version comparison and range-matching logic, and can be called directly in a DSH session.

Core Features

The plugin provides the following capabilities:

  • Compare version order: Compare two semantic version numbers and determine which one is later.
  • Check range satisfaction: Validate whether a version number satisfies a specified version range.

Installation and Enablement

Run the following command in the terminal to install the plugin:

dsh plugin add dsh-semver

After installation, add "dsh-semver" to the dsh.profile.bundles field in the profile’s package.json to enable the plugin.

Typical Usage

After installation and enabling, call the compare_versions function in a session to use it. For example:

Call compare_versions(a="1.2.3", b="1.10.0")

Use Cases and Notes

This plugin is suitable for scenarios that require automated version checks, dependency upgrade decisions, and similar tasks within workflows.

Note: This plugin runs third-party code locally with the permissions of the current DSH process. Before installing it, please review the source code (GitHub repository) and confirm the license.