[Bug]: 优化skill 市场的设计
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
Start with the SkillHub adapter in skillhub.rs, especially the search item parsing, download, and detail URL handling mentioned in the issue. Compare its current ClawHub assumptions with SkillHub’s namespace.handle, /api/v1/download parameters, and homepage response field. Done means SkillHub searches can install skills successfully while existing ClawHub sources remain supported.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Area
Desktop app
Reproduction or evidence
👤 用户:
https://skillhub.cn
我用这个作为地址失败了
先实测一下这个地址到底返回什么,再判断是配置问题还是协议不兼容。
实测了两个域名,失败原因很明确:skillhub.cn 是前端站点,不是 API 根。
1. 为什么 https://skillhub.cn 一定失败
| 我实测的请求 | 结果 |
|---|---|
https://skillhub.cn/api/v1/search?q=&limit=2&page=0 |
200 text/html(7.4 KB SPA 壳,<title>SkillHub…</title>) |
https://skillhub.cn/api/v1/auth/me |
200 text/html(同样回落 SPA,证明该域所有路径都不返回 JSON) |
https://api.skillhub.cn/api/v1/search?q=&limit=2&page=0 |
200 application/json,{"results":[…]} |
站点 bundle skill-hub.bb2n2rxv.js 里有映射表:{"skillhub.cn": "https://api.skillhub.cn", "www.skillhub.cn": "https://api.skillhub.cn", "skillhub.tencent.com": "https://api.skillhub.tencent.com"} —— 页面域和 API 域是分离的。
所以后端 response.json() 拿到 HTML,报的就是 Invalid SkillHub search response(skillhub.rs:146-149),市场页显示成 腾讯 SkillHub: Invalid SkillHub search response。
2. 改成 https://api.skillhub.cn:能搜,但装不上
搜索形状刚好对得上(skillhub.rs:27-35 的 DTO 全命中):
{"results":[{"slug":"pdf","displayName":"PDF","summary":"…","description":"…",
"namespace":{"handle":"kunlungrowth","canonicalName":"@kunlungrowth/pdf"},
"homepage":"https://api.skillhub.cn/kunlungrowth/pdf","version":"1.0.0","downloads":47}]}
不需要 Token(公开可读)。
但下载有两个硬不兼容点,我都验证过了:
| 适配层假设(ClawHub) | skillhub.cn 实测 |
|---|---|
slug = 命名空间--名称 |
slug 只有 pdf,命名空间在 namespace.handle;抽查 20 条无一含 -- |
GET /api/v1/skills/{ns}/{slug}/download |
该路径返回 405(EdgeOne 拦的)。真实路由是 GET /api/v1/download?slug=pdf&namespace=kunlungrowth → 302 到 COS 的 zip(Content-Disposition: attachment; filename="pdf-1.0.0.zip") |
详情链接 {base}/space/{ns}/{name} |
不存在;真实主页是响应里的 homepage |
因为 split_once("--") 找不到分隔符就回落 global(skillhub.rs:102、skillhub.rs:160),下载必然打到 /api/v1/skills/global/pdf/download → 405 → 前端显示 SkillHub request failed with status 405。
顺带确认:zip 本身是合规的,根级 SKILL.md + references/* + _meta.json,unpack_package 的全部校验(大小、路径穿越、符号链接、保留名)都能过。所以只差“怎么找到这个 zip”。
3. 三个可选做法
A. 半可用(只改配置):地址填 https://api.skillhub.cn,Token 留空。能搜能看,点下载报 405。不推荐长期用。
B. 做协议适配(推荐,改动很小)——在 skillhub.rs 里做“双协议兼容”,不是替换:
SearchItem加namespace.handle,坐标归一成kunlungrowth--pdf给下载用,install_id仍保持skillhub:{base}#{坐标}形式不变(否则已装标记全失效);旧的ns--name继续支持,自建 ClawHub 部署不受影响。download:先试/api/v1/download?slug=&namespace=(并可带version),失败回退旧/api/v1/skills/{ns}/{name}/download。detail_url:优先用响应里的homepage,模板兜底。- 顺手把
downloads映射到installs(现在恒为 0,市场页“安装量排序”对这类源是死的)。
C. 纯手工迂回:curl -L "https://api.skillhub.cn/api/v1/download?slug=xxx&namespace=yyy" -o x.zip,解到用户 skills 目录或用“添加 Skill → 选文件夹”导入。缺点是没有“已安装”标记、没有更新能力。
4. 一个容易踩的点
skillhub.cn 和 skillhub.tencent.com 是同一套 API 的镜像(我实测两者 search 返回同一份数据),但 install_id 里嵌了 base 字符串,两个域混填会让同一个 skill 被当成两个源,已装标记不认。团队内统一用一个域。
Environment, if relevant
No response
- Lingua principale
- Rust
- Stelle
- 2.3k
- Fork
- 236
- Merge medio
- 12h 20m
- PR unite (30g)
- 373
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GCWing/OpenBitFun
-
[Feature]: 模型服务表单缺少「图像生成」分类入口 —— 后端已支持 default_models.image_generationForse già presa @skyfireitdiy l’ha presa 23 giorni fa. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 74/100
GCWing/OpenBitFun#3279 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 49/100
GCWing/OpenBitFun#3809 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: 输出文字应该支持自然换行Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 57/100
GCWing/OpenBitFun#3796 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: 不能archive 错误使用的acpForse già presa @Raing5Days l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
GCWing/OpenBitFun#3788 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: 增加窗口化的侧边提问Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
GCWing/OpenBitFun#3784 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di GCWing/OpenBitFun
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Non-`main` default branchesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
max-sixty/worktrunk#4727 · 7 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
carrick-sh/carrick#1859 ·
I maintainer di solito rispondono entro 1 giorno
-
crate: spate-kafka documentation priority: medium
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno