Introduction

In agent development, it is often necessary to determine the source when handling external requests. Manually parsing User-Agent strings is time-consuming and error-prone. DSH provides the dsh-useragent plugin, which parses and identifies client information.

What Is This

This is a plugin for parsing User-Agent strings, used to identify the browser/version, operating system, device type, engine, and bots. The plugin is maintained by uckkk and implemented in pure Node.

Core Features

The plugin provides the following capabilities:
* Parse UA strings
* Identify browser/version
* Identify operating system
* Identify device type
* Identify engine
* Identify bots

Installation and Enabling

Run the following command to install the plugin:

dsh plugin add dsh-useragent

After installation, the plugin is automatically added to the dsh.profile.bundles field in the profile’s package.json.

Typical Usage

Invoke the registered tool parse_ua in a session. For example:

parse_ua(ua="Mozilla/5.0 ... Chrome/120 ...")

Applicable Scenarios and Notes

This is suitable for scenarios that require environment identification of request sources. Please note that installing the plugin runs third-party code on your local machine, so review the source code yourself.

Short Conclusion

This is a lightweight parsing tool. For more details, visit the Community Catalog or the GitHub repository.