前言¶
DeepSeek Harness (DSH) 的核心能力依賴於插件生態。當本地網絡無法直接訪問 GitHub 或 api.github.com 時,開發者需要繞過網絡限制。sevastopol36/dsh-plugin-ghproxy 是一個原生 Cordis 插件,它通過公共代理鏡像轉發請求,解決直連超時問題。該插件不依賴外部運行時庫,使用 Node.js 內置模塊實現。
安裝¶
使用 DSH 命令行工具安裝該插件:
dsh plugin --profile web add github:sevastopol36/dsh-plugin-ghproxy
安裝完成後,需重啓 profile(如 dsh web)以加載插件。
核心能力¶
該插件提供以下能力:
- 多鏡像容錯:按順序嘗試多個代理,第一個健康的勝出,失效的自動跳過。
- 健康度記憶:每個鏡像的成功/失敗結果緩存 5 分鐘,避免反覆測試不健康的鏡像。
- 讀取文件:支持讀取 raw、blob、gist 及
api.github.com的 JSON 數據。 - 下載文件:支持下載 release 資產、倉庫歸檔和 gist 到本地。
- 命令行加速:生成鏡像 URL,供
git clone、curl或wget使用。 - 自帶診斷:通過命令測試每個鏡像的健康狀況。
- 零運行時依賴:僅使用 Node.js 內置的
fetch、fs和stream。
使用方式¶
插件註冊了以下工具:
-
讀取文件
使用sevastopol36_ghproxy_fetch讀取 raw / 文本 / JSON。如果文本過大或爲二進制,會自動落盤。 -
下載文件
使用sevastopol36_ghproxy_download下載 raw、release 資產、archive、gist 到本地。 -
生成 URL
使用sevastopol36_ghproxy_proxy_url生成鏡像 URL。 -
診斷
使用sevastopol36_ghproxy_probe實測每個鏡像,並給出建議的proxyBases配置。 -
終端用法
直接使用代理 URL 進行操作:
git clone https://gh-proxy.com/https://github.com/<owner>/<repo>.git
curl -LO https://gh-proxy.com/https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
配置示例¶
插件支持通過 YAML 配置。默認配置如下:
- id: sevastopol36-ghproxy
config:
proxyBases:
- 'https://gh-proxy.com'
- 'https://sevastopol36-ghproxy.net'
- 'https://ghfast.top'
- 'https://gh.ddlc.top'
- 'https://gh.jasonzeng.dev'
downloadDir: 'downloads/github'
timeoutMs: 60000
retries: 1
retryDelayMs: 800
healthCacheMs: 300000
maxTextBytes: 262144
maxBytes: 209715200
overwrite: false
allowApi: true
注意事項¶
- 版本變更:0.1.0 版本硬編碼了單一代理
https://gh.jasonzeng.dev,該服務現已失效,無法抓取任何內容。0.2.0 版本改爲多鏡像列表。 - 運行環境:僅支持 Node.js >= 22.19.0。
- 權限:插件以當前 DSH 進程的權限運行,請確保代理鏡像不會訪問敏感信息。
生態背景¶
該插件託管在社區目錄,與 DeepSeek 或幻方官方無從屬關係。
- 項目主頁:https://github.com/sevastopol36/dsh-plugin-ghproxy
- 社區目錄:https://www.skillhub.cn/plugins/sevastopol36/dsh-plugin-ghproxy