DSH’s design philosophy is “everything is a plugin.” When developing agents, common requirements include reading image dimensions, generating thumbnails, and converting image formats (such as PNG to WebP). Manually invoking the system ffmpeg or configuring dependencies in a Node environment can be cumbersome. The dsh-image-uckkk plugin provides encapsulated image processing capabilities.
Plugin Positioning¶
This is a plugin implemented purely in Node. It is based on the built-in ffmpeg binary and supports cross-platform use. The plugin is maintained by uckkk (author istone ad571@qq.com) and aims to solve basic image processing problems in agent workflows.
Core Features¶
The plugin provides two main tools:
image_info: Reads the width × height and format of an image.resize_image: Resizes an image (supports proportional scaling or specifying a width) and converts its format (supports jpg/png/webp).
Installation and Activation¶
First, run the official installation command:
dsh plugin add dsh-image-uckkk
After installation, you need to configure the package.json file in the project root. Add "dsh-image-uckkk" to the dsh.profile.bundles field:
{
"dsh.profile.bundles": [
"dsh-image-uckkk"
]
}
This plugin requires the following dependencies:
* @deepseek-ai/cordis: ^4.0.1
* @deepseek-ai/dsh-tools: >=0.1.0-rc.6
Typical Usage¶
The following example shows how to resize and convert an image format. Assume you need to resize hero.png to 800 pixels wide and output it as hero.webp:
Call the resize_image interface:
resize_image(file="hero.png", width=800, outFile="hero.webp")
Use Cases and Notes¶
- Use Cases: Suitable for agent scenarios that require processing image metadata (dimensions, format) or resizing and converting image formats.
- Runtime Permissions: The plugin runs with the permissions of the current DSH process. Ensure the agent has sufficient permissions to read the source file and write the output file.
- Security and Compliance: It is recommended to check the source code and license (MIT) before installation. The plugin depends on
@ffmpeg-installer/ffmpeg, which automatically downloads the corresponding binary file.
Summary¶
By wrapping ffmpeg, this plugin simplifies common image processing tasks in DSH agents. For more configuration details and source code, refer to the plugin directory page or the GitHub repository.