ZhijiangTang/dsh-pkg-info ↗★ 0
dsh-pkg-info
DSH plugin: query package metadata from the npm and PyPI registries (pkg_info).
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ZhijiangTang/dsh-pkg-info说明文档
阅读完整 README ↗dsh-pkg-info
DSH 包信息查询工具插件。注册一个 pkg_info 工具,查询 npm 与 PyPI 两个 registry 的包元数据,把结果规范化为一个结构化 JSON 对象,供模型与 Code Mode 程序化调用。零依赖、纯 ESM、无构建。
简介
- 工具名:
pkg_info - 能力:查询 npm 包(
registry.npmjs.org)与 PyPI 包(pypi.org)的名称、版本、描述、许可证、作者、主页、仓库、版本数、依赖等信息。 - 行为:永不抛异常。404、网络错误、超时、JSON 解析失败都折叠为
{ ok: false, error: { stage, message?, status? } };成功返回{ ok: true, registry, name, version, ... }。
安装
dsh plugin --profile add file:./plugins/dsh-pkg-info
# 或发布后:
dsh plugin --profile add dsh-pkg-info
参数
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
registry | enum | — | npm | npm / pypi,选择要查询的 registry |
name | string | ✅ | — | 包名。npm 作用域包写 @scope/name;PyPI 项目名大小写不敏感 |
version | string | — | latest | 指定版本(npm 也支持 dist-tag 如 latest/next);缺省查最新版 |
返回字段
npm(registry: "npm")
| 字段 | 类型 | 说明 |
|---|---|---|
ok / registry / name / version | boolean/string | 状态、registry、规范包名、解析到的版本 |
description | string | null | 包描述 |
license | string | null | SPDX 许可证(对象/数组会被规范成字符串) |
author | string | null | 作者,规范为 "name " |
homepage | string | null | 主页 URL |
repository | string | null | 仓库 URL |
distTags | object | dist-tags 映射(如 ) |