feat(skills): 支持私有 GitHub 安装与静态审计#526
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景 / 动机
Skill 管理当前允许 Git/SSH 来源,但 GitHub 网页 URL 固定转换为 HTTPS,部署机只有 SSH key 或
gh auth身份时无法安装私有仓库;daemon 若从后来被删除的 checkout 启动,clone 还会继承失效 cwd。另一方面,Git discover 会留下永久 checkout,预览 URL 与最终安装 URL 不同时产生无 registry 引用的重复缓存,安装成功后也缺少可排障的静态内容摘要。改动
GITHUB_TOKEN/GH_TOKEN、~/.botmux/.env与当前gh auth身份;鉴权失败时仅对 GitHub 自动回退 SSH URL。凭证不进入 URL、argv、registry 或错误文本。[skills:audit]静态审计摘要,记录 commit、文件/目录/symlink/字节数、相对可执行文件和 shebang runtime;不执行 Skill 脚本、二进制或测试。默认值 / 兼容性依据
测试覆盖
gh authtoken 的 Git 请求头注入及已有 Git config 保留。验证
pnpm vitest run test/github-auth.test.ts test/skill-git-install.test.ts test/skill-registry-store.test.ts test/skill-sources.test.ts test/dashboard-skill-install-request.test.ts test/dashboard-skills-ui.test.ts(70 tests passed)pnpm buildgit diff --check影响范围
改动集中在公共 Skill source/registry 与 Dashboard job 日志路径,同时覆盖 CLI 同步 Git 操作和 Dashboard 异步 Git 操作。不会修改 bot 配置、会话类型、Skill 注入策略或各 CLI adapter;macOS 与 Linux 使用相同的非交互 Git argv/env 路径。