DeepSeek Harness 插件

dsh-url-tools

DSH plugin: URL parse/clean/decode/encode/expand tool (url_tool), zero-dependency pure ESM.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
ZhijiangTang/dsh-url-tools
最近更新
2026年8月16日
分类
工具与能力
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/ZhijiangTang/dsh-url-tools
插件名:dsh-url-tools
作者:ZhijiangTang

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-url-tools

DSH URL 工具插件。注册一个 url_tool 工具,提供 URL 解析、跟踪参数清理、字符串编解码、重定向展开四种能力。零依赖、纯 ESM、无构建

简介

  • 工具名:url_tool
  • 能力:parse(解析)/ clean(清理跟踪参数)/ decode(解码)/ encode(编码)/ expand(展开重定向)。
  • 行为:永不抛异常。参数错误、非法 URL、网络错误、非法 % 序列都折叠为 { ok: false, error };成功返回 { ok: true, ... },且始终带回 action 回显。

安装

dsh plugin --profile <name> add file:./plugins/dsh-url-tools
# 或发布后:
dsh plugin --profile <name> add dsh-url-tools

参数

参数类型必填说明
actionenumparse/clean/decode/encode/expand
urlstring目标 URL(decode/encode 时是待处理字符串)

action 表

action输入输出(ok: true失败
parse任意合法 URL{ scheme, host, port, pathname, search, hash, username, params }paramskey → [值...],重复键合并为数组ok: false + error(非法 URL)
clean含跟踪参数的 URL{ url, removed, search }url 清理后完整 URL、removed 被删参数键数组、search 原始 query 串ok: false + error(非法 URL)
decode百分号编码串{ input, output },整串 decodeURIComponentok: false + error(非法 % 序列)
encode任意字符串{ input, output },整串 encodeURIComponent
expand任意 http/https URL{ finalUrl, hops, statuses }statuses 为每跳状态码(含末跳非 3xx)ok: false + error(网络错/非法 URL/非法 Location)

parse 输出示例

// url_tool { action: "parse", url: "https://user:pw@example.com:8080/a/b?x=1&utm_source=g&y=2#f" }
{
  "ok": true,
  "action": "parse",
  "scheme": "https",
  "host": "example.com",
  "port": "8080",
  "pathname": "/a/b",
  "search": "?x=1&utm_source=g&y=2",
  "hash": "#f",
  "username": "user",
  "params": { "x": ["1"], "utm_source": ["g"], "y": ["2"] }
}

跟踪参数清单

clean 只删以下参数,其余(含 refgclsrc 等)一律保留:

  • utm_*(任意 utm_ 前缀,如 utm_source/utm_medium/utm_campaign/utm_term/utm_content/utm_id
  • fbclidgclidmsclkidmc_cidmc_eidyclidwickedid

匹配对大小写不敏感;removed 返回被删的键(去重、按首次出现顺序)。

expand 上限说明

expand 手动跟随重定向:每跳先 HEAD、失败回退 GET,读 location 头(绝对/相对都解析),最多跟 5 跳。超过 5 跳仍在 3xx 时停止,返回当前 URL 并带 maxHopsReached: true;非 3xx(或无 location)即停。每跳超时 10 秒,网络错误返回 ok: false

License

MIT