PerryLink/dsh-github
PerryLink/dsh-github官方级 GitHub CI 集成:composite action.yml、轮询 PR 评审机器人(幂等行内评论 + status-check 门禁)以及 PR/issue 工具,所有写入走人工审批门。
面向自建 Gitea / Forgejo 的只读工具,走两者共用的 REST API:实例信息、仓库列表、议题与 PR 搜索和读取、PR diff 与变更文件,以及 Actions 运行、任务与任务日志。工具元数据支持英文、繁体中文、简体中文与日文。
一個唯讀的 DeepSeek Harness 插件,讓 DSH 可以直接查詢自行託管的 Gitea 與 Forgejo 站台。插件使用兩個平台共同支援的 REST API,提供儲存庫、 議題、合併請求與 Actions 資訊。
DeepSeek Harness 目前仍是 developer preview。本插件已使用
@deepseek-ai/dsh-tools 0.1.7-rc.2測試,並保留自rc.6起的0.1.0預發布版本相容性; Harness API 變更時可能需要同步更新。
建議從 npm 安裝:
dsh plugin --profile web add @maxhsu/dsh-forge
或使用含編譯結果的 release tarball:
dsh plugin --profile web add https://github.com/maxmilian/dsh-forge/releases/latest/download/dsh-forge.tgz
或直接追蹤 GitHub repository:
dsh plugin --profile web add github:maxmilian/dsh-forge
從本機 checkout 安裝:
dsh plugin --profile web add .
dsh --profile web --dump-config
dsh --profile web
Git 安裝會執行套件的 prepare script。請先檢查並固定來源 commit,再允許 pnpm 10
執行安裝期 build。預建 tarball 不需要安裝期 build 權限。
建議用環境變數提供 URL 與 token,避免把憑證寫入 cordis.patch.yml:
export DSH_FORGE_URL='https://code.example.com'
export DSH_FORGE_TOKEN='replace-with-a-read-only-token'
dsh --profile web
也可以在 profile patch 中設定:
- id: forge-tools
name: dsh-forge
config:
baseUrl: 'https://code.example.com'
token: ''
locale: zh-TW
requestTimeoutMs: 30000
maxResponseBytes: 1000000
locale 可使用 en、zh-TW、zh-CN 或 ja,控制 tool 說明、參數說明與執行中的
標題;預設為英文。翻譯隨插件提供,不會呼叫外部翻譯服務。
請使用站台可提供的最小 token 權限。本插件不會建立、修改、合併、重新執行或刪除遠端資源。
| Tool | 用途 |
|---|---|
forge_instance_info | 讀取站台版本資訊 |
forge_list_repositories | 列出登入使用者擁有的儲存庫 |
forge_search_issues | 搜尋議題或合併請求 |
forge_get_issue | 讀取單一議題 |
forge_list_pull_requests | 列出合併請求 |
forge_get_pull_request | 讀取單一合併請求 |
forge_get_pull_request_diff | 讀取合併請求的 unified diff |
forge_list_pull_request_files | 列出合併請求變更檔案 |
forge_list_action_runs | 列出 Actions 執行記錄 |
forge_list_action_jobs | 列出 workflow 執行中的工作 |
forge_get_action_job_logs | 讀取 Actions 工作日誌 |
開發需要 Node.js 22 以上版本與 Bun:
bun install
bun run lint
bun run typecheck
bun run test:coverage
bun run build
bun pm pack --dry-run
CI 使用官方 Gitea 1.27、Forgejo 16 與各自的 Actions runner 執行真實整合測試,建立真正的 儲存庫、議題、分支、合併請求、workflow 與 job log。API JSON 會以平台原始格式回傳;diff 與 log 維持純文字。