Repository navigation
feat(agent): forge 集成——GitHub/AtomGit 仓库操作工具族(gh/ag 后端,VSCode 式) - #39
Merged
Merged
Conversation
- 新模块 packages/agent/src/forge.ts:13 个 forge_* 工具(status/repo/pr/issue/release/raw/login), host 参数统一映射 gh|ag 二进制;gh 字段列表 --json 与 ag 布尔 --json、-R 选择器与位置参数、 release --title/--notes 与 --name/--body 等线上差异在纯参数构造器中吸收(全部导出可测) - 凭据零接触:令牌永远留在 gh keyring/hosts.yml 与 ag 自有存储,hmharness 只解析 auth status 文本 - exec+quoteArg 硬化转发(execFile 无法 spawn npm 全局 ag.cmd,已实测);超时 60s; 未装/未登录诚实报错并带安装(winget/npm)与登录(forge_login)指引 - forge_login:起 gh auth login --web/ag auth login 子进程,捕获设备码+URL 即刻透出(stderr+结果), 轮询 auth status 直至登录或 3 分钟超时 - runner.ts nativeRegistry 注册 forgeTools——TUI/web/桌面三端自动可用;forge_raw 默认需确认 - prompt.ts 新增 Git forges 一节(3 行):优先 forge_* 工具、未登录先 forge_login、不建议用户去网页 - capability.ts 补 forge 风险声明(写操作 high/读操作 low,声明层不改执法) - 测试 __tests__/forge.test.ts:16 例全绿——PATH 注入 node 写的 gh/ag 假 CLI(.cmd shim,Windows 兼容), 断言参数拼装/JSON 解析/双宿主渲染/未装未登录诚实错误/超时/登录轮询翻转(第 3 次探测)/仅 forge_raw 弹卡 - 真机验证:forge_status 双平台登录态、forge_repo_list 双 host 各一页、forge_pr_list swsgbl/hmharness(只读) - 全套 npm test 1063 通过;唯一失败 project.test.ts tar 快照为本机 Windows 基线问题(主仓同样失败,非回归) Co-Authored-By: Claude Code <noreply@anthropic.com>
- forge_repo_create/pr_create/pr_merge/issue_create/release_create/release_upload 全部加 needsApproval: () => true(工具描述里的'confirm first'不是执法机制; 仓库先例:domain-ops issues.ts 与 harmony 设备写操作全部设卡) - 读操作(list/status/checks)与 forge_login 保持免卡;YOLO/auto 模式照旧直通,流畅诉求不受影响 - forge_release_upload 描述明示上传=数据外传,审批卡面(makeApproval brief)完整显示 file 路径+目标 repo/tag;不做 cwd 硬 containment——agent 本有任意读面(read_file/run_command), 外传执法点在卡,与既有工具能力面一致 - forge 测试 gating 断言更新:7 个写工具全卡、6 个读/引导工具全免,16/16 绿;typecheck 绿 Co-Authored-By: Claude Code <noreply@anthropic.com>
…立步骤,重复第二遍全量套件在 windows-latest 撞 30min 超时(PR#39 实证:独立步骤 496s 绿,重复跑恰在 1800s 被杀且零 not-ok);publish.yml 保持全量门禁不动
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.
用户需求
"像 VSCode 集成 GitHub 那样,登录后直接在智能体界面操作自己的仓库"——forge 工具族落地。
设计
指挥者独立验收
与桌面面板(PR 另提)构成完整集成。