rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yhzsir/dsh-market-star-sort
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
dsh-market-star-sort —— 给 DSH Web「插件 → 发现」页的排序菜单增加一项 Star 数(按 GitHub Star 数降序)。Host-only,无客户端代码。
A Host-only plugin for DSH Web: the Discover tab builds its sort menu from the sort keys the selected plugin market index declares, and the stock index declares none. This plugin declares one extra stars key and fills each entry's value from the index site's public catalog — so the key shows up natively in the sort menu while the Host keeps doing the ordering and paging. The page itself is not patched.
在 Web 界面「插件」页的安装入口粘贴以下任一,然后在「插件」页刷新(或重启 DSH):
https://github.com/yhzsir/dsh-market-star-sort/releases/latest/download/dsh-market-star-sort.tgzhttps://github.com/yhzsir/dsh-market-star-sortdsh-market-star-sort「发现」页的排序菜单不是写死的:它由插件索引声明的排序键(metadata.sortKeys)生成,Host 再按每个条目的 metadata.sortKeys.<id> 数值排序、分页。
当前配置的索引源 https://awesome-dsh-plugin.com/index.json 声明了 sortKeys: {}(分类之外没有任何排序键),所以页面上只有「默认顺序 / 发布时间 / 最佳搜索」三种。
这个插件的 Host 半部在索引 JSON 被 Host 解析之前做一次纯增量补全:
metadata.sortKeys.stars = { title: { en: "Stars", zh: "Star 数" }, order: "desc" };metadata.sortKeys.stars = <GitHub Star 数>。补全后的文档仍然满足格式 1 校验,页面因此原生多出「Star 数」这一项,排序、翻页、再次进入都由 Host 自己完成,客户端的发现页代码一行未改。没有 Star 数据的条目按索引既有的规则排在最后。
data/stars.json(按下拉时间抓取的快照,覆盖索引里全部条目);catalogUrl(默认 https://awesome-dsh-plugin.com/catalog.json,items[].slug + items[].stars),成功后写入 <profile>/.market-star-sort/stars.json,下次启动直接读缓存;refreshHours(默认 24 小时)。刷新失败时继续用已有快照。索引条目与 Star 数据的对应关系依次尝试:条目标题 owner/repo → 仓库 URL 的 github.com/<owner>/<repo> → 索引站的条目页 /p/<owner>/<repo>/。
写在 cordis.patch.yml 中该行的 config 下:
| 字段 | 默认值 | 含义 |
|---|---|---|
catalogUrl |
https://awesome-dsh-plugin.com/catalog.json |
Star 数据来源 |
refreshHours |
24 |
重新下载 Star 数据的间隔 |
fetchTimeoutMs |
180000 |
单次下载时限(站点较慢时保留足够余量) |
indexUrls |
[](另含两个内置的 awesome-dsh-plugin 索引地址) |
额外需要补全的索引 URL |
- insert:
- id: market-star-sort
name: dsh-market-star-sort
config:
refreshHours: 12
Response.clone() 兜底)。stars 排序键,插件不会覆盖它。index.js — Host 插件:种子/缓存读取、后台刷新、索引响应补全data/stars.json — Star 快照({ updated, source, stars: { "owner/repo": n } })cordis.patch.yml — Loader 行locale/{en,zh}.json、icon.svg — 插件页显示用的元数据与图标MIT © yhzsir
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。