dsh-gitea-panel
Verified@nssai/dsh-gitea-panel · v0.1.0 · MIT · Web UI
DSH web GUI plugin: right-sidebar Gitea panel showing issues, pull requests and commits for the git repository of the current workspace, with a repo switcher for multi-repo workspaces
Install
dsh plugin add @nssai/dsh-gitea-panel Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
Published to npm without a public repository. Inspect the package contents before installing.
Tags
Readme
dsh-gitea-panel
DeepSeek Harness(DSH)web GUI 插件:在右侧边栏展示当前工作区 git 仓库对应的 Gitea 工单、Pull Request 与最近提交;工作区下存在多个 git 仓库时,通过下拉框切换。
功能
- 自动扫描当前工作区(深度 4 层,跳过
node_modules)下的所有 git 仓库,解析originremote 得到owner/repo; - 顶部下拉框在多仓库间切换,显示
仓库名 @ 分支 → owner/repo; - 分区展示 open 工单 / open PR(含草稿标记与
head → base分支)/ 最近提交(各 20 条),条目点击跳转到 Gitea 页面; - Gitea 地址与访问令牌在面板内填写,点「保存」后经 Host
settings服务持久化($DSH_HOME/settings.yaml的gitea-panel命名空间);令牌只保存在服务端、不回传浏览器(界面仅显示"已保存"),支持一键清除;remote 为 http(s) 地址时自动预填实例地址;公开仓库无需令牌; - 每 60 秒自动刷新,支持手动刷新。
架构
标准 DSH 双端插件包(Profile Bundle),TypeScript 源码 + tsdown 构建:
src/index.ts→lib/index.js— Host 半:基于shell服务执行git/curl,通过webServer注册仅回环地址可访问的/gitea/scan-repos、/gitea/overview、/gitea/config、/gitea/clear-tokenJSON 路由,并经settings服务持久化配置;src/client/index.ts→lib/client.js— 浏览器半(web 客户端__ModuleLoader__懒加载 CJS 格式):向sidebarRightTabs注册gitea标签页类型,面板体与标题分别注册到sidebar.right.pane.tab/sidebar.right.pane.tab.title;cordis.patch.yml— Bundle 补丁,把插件行插入 profile 组合;package.json的dsh.bundle.patch与dsh.client字段让 DSH 识别并装载两半。
开发
npm install
npm run typecheck # tsc --noEmit
npm run build # tsdown → lib/
npm run watch # 增量构建
源码变更后重新 npm run build;由于 profile 以 link: 方式引用本目录,重启 profile 即生效。
安装
发布到 npm 后:
dsh plugin --profile web add dsh-gitea-panel
本地开发(不经过 npm):
dsh plugin --profile web add link:/path/to/dsh-gitea-panel
安装后重启 profile(dsh web)生效:Host 半装载路由,浏览器半由 /plugins/dsh-gitea-panel/client.js 自动加载。
使用
打开任意会话,右侧边栏会出现 Gitea 标签页(未自动展开时在 Guide 页点击 Gitea 条目)。首次使用在"设置"区填写 Gitea 实例地址与令牌。
发布
npm publish --access public
发布前请按需修改 package.json 的 name(如改为自己的 scope,例如 @your-name/dsh-gitea-panel),并同步替换 cordis.patch.yml 与 tsdown.config.ts 中的包名。
许可
MIT